/* ==========================================
   ENCABEZADO COMPARTIDO - MATEL
========================================== */

.header {
    font-family: 'Inter', sans-serif;
    line-height: normal;
    position: relative;
    z-index: 20;
    width: 100%;
    background: #ffffff;
    border-bottom: 2px solid var(--gold-border);
}

.header-inner {
    position: relative;
    width: 100%;
    min-height: 250px;
    display: grid;

    grid-template-columns: 195px minmax(0, 1fr) auto;
    grid-template-rows: 1fr 1fr;

    grid-template-areas:
        "logo slogan slogan"
        "logo company actions";

    column-gap: 35px;
    padding: 10px clamp(18px, 2.5vw, 45px);

    background: linear-gradient(
        to bottom,
        #ffffff 0%,
        #ffffff 50%,
        var(--cream-light) 50%,
        var(--cream-light) 100%
    );
}

/* LOGO */

.logo-box {
    grid-area: logo;
    width: 180px;
    height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    overflow: hidden;
    background: #ffffff;
    border: 2px solid var(--gold-border);
    border-radius: 8px;
    margin-left: 15px;
}

.logo-box a {
    display: block;
    width: 100%;
    height: 100%;
}

.logo-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* ESLOGAN */

.header-slogan {
    grid-area: slogan;
    align-self: center;
    min-width: 0;
    padding-left: 30px;
    text-align: left;
}

.header-slogan h1 {
    color: #3d3524;
    font-size: clamp(1.8rem, 2.5vw, 2.7rem);
    font-weight: 700;
    line-height: 1.15;
}

.header-slogan p {
    margin-top: 10px;
    color: var(--gold-dark);
    font-size: clamp(1rem, 1.3vw, 1.3rem);
    font-weight: 500;
}

/* NOMBRE DE LA DISTRIBUIDORA */

.header-company {
    grid-area: company;
    align-self: center;
    min-width: 0;
    margin-left: 30px;
    padding: 10px 15px;
    border-left: 3px solid var(--gold);
    color: #3d3524;
}

.header-company p {
    font-size: clamp(1rem, 1.3vw, 1.45rem);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.2px;
    overflow-wrap: break-word;
}

/* BUSCADOR */

.header-right {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    align-self: end;
    gap: 12px;
    margin-bottom: 6px;
}

.search {
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #f8f8f8;
    border: 1.5px solid var(--gold-border);
    border-radius: 24px;
}

.search input {
    width: 260px;
    min-width: 0;
    padding: 12px 16px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
}

.search button {
    width: 46px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--gold);
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search button:hover {
    background: var(--gold-dark);
}

.search:focus-within {
    border-color: var(--gold-dark);
}

/* ICONOS */

.header-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
    color: var(--gold-dark);
    background: rgba(201, 168, 75, 0.12);
}

.mobile-search-container {
    display: none;
}

/* MENÚ HAMBURGUESA */

.burger {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gold);
    border-radius: 6px;
    background: transparent;
    color: var(--gold-dark);
    font-size: 1.2rem;
    cursor: pointer;
}

.burger:hover {
    background: var(--gold);
    color: #ffffff;
}

/* NAVEGACIÓN */

.nav {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    width: 100%;
    min-height: 75px;
    padding: 12px 60px;
    gap: 40px;
    background: var(--nav-bg);
    border-top: 1px solid var(--gold-border);
}

.nav-item {
    padding: 12px 18px;
    color: #3d3524;
    text-decoration: none;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active {
    background: var(--gold);
    color: #ffffff;
}

.header button,
.header input {
    font-family: inherit;
}

/* ==========================================
   ESCRITORIOS MEDIANOS
========================================== */

@media (min-width: 1351px) and (max-width: 1600px) {

    .header-inner {
        column-gap: 20px;
    }

    .header-slogan {
        padding-left: 20px;
    }

    .header-company {
        margin-left: 20px;
    }

    .nav {
        gap: 25px;
        padding: 12px 35px;
    }

    .nav-item {
        padding: 12px 10px;
        font-size: 1rem;
    }

    .search-desktop input {
        width: 170px;
    }

    .header-right {
        gap: 6px;
    }

    .header-icons {
        gap: 2px;
    }

    .icon-btn {
        width: 38px;
        height: 40px;
        font-size: 1.15rem;
    }
}

/* ==========================================
   COMPUTADORES PEQUEÑOS
========================================== */

@media (max-width: 1350px) {

    .header-inner {
        min-height: 170px;
        grid-template-columns: 130px minmax(0, 1fr) auto;
        column-gap: 20px;
        padding: 6px 20px;
    }

    .logo-box {
        width: 120px;
        height: 155px;
        margin-left: 10px;
    }

    .header-slogan {
        padding-left: 0;
    }

    .header-slogan h1 {
        font-size: 1.6rem;
    }

    .header-slogan p {
        font-size: 1rem;
        margin-top: 5px;
    }

    .header-company {
        margin-left: 0;
        padding: 5px 10px;
    }

    .header-company p {
        font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    }

    .header-right {
        gap: 6px;
    }

    .search-desktop input {
        width: clamp(130px, 16vw, 220px);
    }

    .header-icons {
        gap: 2px;
    }

    .icon-btn {
        width: 38px;
        height: 40px;
        font-size: 1.15rem;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 30;
        flex-direction: column;
        justify-content: center;
        gap: 0;
        min-height: auto;
        padding: 10px 0;
        background: var(--nav-bg);
        border-top: none;
        border-bottom: 2px solid var(--gold-border);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    }

    .nav.open {
        display: flex;
    }

    .nav-item {
        width: 100%;
        padding: 14px 20px;
        font-size: 0.9rem;
        text-align: center;
        border-bottom: 1px solid rgba(168, 139, 46, 0.2);
        border-radius: 0;
    }

    .burger {
        display: flex;
    }
}

/* ==========================================
   TABLETAS
========================================== */

@media (min-width: 651px) and (max-width: 950px) {

    .header-inner {
        min-height: 220px;
        grid-template-columns: 130px minmax(0, 1fr);
        grid-template-rows: 1fr auto auto;

        grid-template-areas:
            "logo slogan"
            "logo company"
            "logo actions";

        row-gap: 10px;
    }

    .header-company {
        align-self: center;
    }

    .header-company p {
        font-size: 0.95rem;
    }

    .header-right {
        margin-bottom: 4px;
    }

    .search-desktop input {
        width: clamp(100px, 18vw, 180px);
    }
}

/* ==========================================
   CELULARES
========================================== */

@media (max-width: 650px) {

    .header-inner {
        min-height: 205px;
        grid-template-columns: 95px minmax(0, 1fr);
        grid-template-rows: auto auto auto;

        grid-template-areas:
            "logo slogan"
            "logo company"
            "actions actions";

        gap: 12px;
        padding: 12px;

        background: linear-gradient(
            to bottom,
            #ffffff 0%,
            #ffffff 45%,
            var(--cream-light) 45%,
            var(--cream-light) 100%
        );
    }

    .logo-box {
        width: 95px;
        height: 125px;
        margin-left: 0;
        align-self: start;
    }

    .header-slogan {
        padding: 0;
        align-self: start;
        margin-top: 3px;
    }

    .header-slogan h1 {
        font-size: clamp(1rem, 4vw, 1.3rem);
        line-height: 1.2;
    }

    .header-slogan p {
        margin-top: 5px;
        font-size: clamp(0.7rem, 2.8vw, 0.85rem);
        line-height: 1.35;
    }

    .header-company {
        margin-left: 0;
        padding: 4px 8px;
        border-left-width: 2px;
        align-self: center;
    }

    .header-company p {
        font-size: clamp(0.75rem, 3vw, 0.9rem);
        line-height: 1.4;
    }

    .header-right {
        justify-content: flex-end;
        gap: 5px;
        margin-bottom: 0;
    }

    .header-icons {
        gap: 1px;
    }

    .icon-btn {
        width: 34px;
        height: 36px;
        font-size: 1.05rem;
    }

    .burger {
        width: 38px;
        height: 38px;
        margin-left: 3px;
    }

    .search-desktop {
        display: none;
    }

    .mobile-search-container {
        display: block;
        padding: 10px 12px 12px;
        background: var(--cream-light);
    }

    .search-mobile {
        width: 100%;
    }

    .search-mobile input {
        flex: 1;
        width: 100%;
    }

    .nav {
        padding: 8px 0;
    }
}

/* ==========================================
   CELULARES PEQUEÑOS
========================================== */

@media (max-width: 360px) {

    .header-inner {
        min-height: 185px;
        grid-template-columns: 78px minmax(0, 1fr);
        padding: 8px;
        gap: 8px;
    }

    .logo-box {
        width: 78px;
        height: 103px;
    }

    .header-slogan h1 {
        font-size: 0.95rem;
    }

    .header-slogan p {
        font-size: 0.7rem;
    }

    .header-company p {
        font-size: 0.72rem;
    }

    .header-right {
        gap: 2px;
    }

    .icon-btn {
        width: 29px;
        height: 34px;
        font-size: 0.95rem;
    }

    .burger {
        width: 34px;
        height: 34px;
    }

    .mobile-search-container {
        padding: 8px;
    }
}