/* ============================================================
   HEADER
   BEM: .header > __inner > __logo | __nav | __burger | __line
   ============================================================ */

.header {
    font-family: var(--tipografia-base);
    font-size: 15px;

    position: sticky;
    top: 0;
    z-index: 100;

    width: 100%;
    height: 100px;

    background-color: var(--cabecera-background);
    color: var(--color-primario);
    border-bottom: 1px solid var(--color-primario);

    display: flex;
    flex-direction: row;
    align-items: center;

    padding: 0 1.5rem;
    box-sizing: border-box;

    box-shadow: 0 4px 16px rgba(0, 0, 0, 0);
    transition: box-shadow 0.5s ease;
}

.header--scrolled {
    box-shadow: 0 4px 16px var(--color-sombra);
}


/* ── Contenedor interior ────────────────────────────────── */

.header__inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;

    width: 100%;
    height: 100%;
}


/* ── Logo ───────────────────────────────────────────────── */

.header__logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header__logo img,
.header__logo .custom-logo,
.header__logo a {
    max-height: 75px;
    width: auto;
    display: block;
    text-decoration: none;
    color: var(--color-primario);
    font-family: var(--tipografia-titulos);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    line-height: 1;
}


/* ── Claim (entre logo y menú) ──────────────────────────── */

.header__claim {
    flex: 1;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.header__claim-titulo {
    font-family: var(--tipografia-titulos);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primario);
    line-height: 1.2;
}

.header__claim-subtitulo {
    font-size: 13px;
    font-weight: 400;
    color: var(--color-texto);
    line-height: 1.2;
}


/* ── Nav / Menú ─────────────────────────────────────────── */

.header__nav {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.header__links {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.header__links > li {
    position: relative;
    margin: 0 0.33rem;
    padding-right: 20px;
}

.header__links > li > a {
    font-family: var(--tipografia-base);
    font-size: 14px;
    font-weight: 600;
    color: var(--menu-color);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.25s ease;
}

.header__links > li > a:hover {
    color: var(--menu-color-hover);
}


/* ── Submenús — desktop ─────────────────────────────────── */

.sub-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background-color: var(--menu-background);
    min-width: 220px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    list-style: none;
    margin: 0;
    padding: 0;

    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-in-out;
}

.sub-menu > li {
    padding: 12px 20px 0;
}

.sub-menu > li:first-child {
    border-top: 3px solid var(--color-primario);
    padding-top: 16px;
}

.sub-menu > li:last-child {
    padding-bottom: 16px;
}

.sub-menu > li > a {
    font-family: var(--tipografia-base);
    font-size: 12px;
    font-weight: 400;
    color: var(--menu-color);
    text-decoration: none;
    transition: padding-left 0.2s ease-in-out, color 0.2s ease;
}

.sub-menu > li > a:hover {
    border-left: 2px solid var(--color-primario);
    padding-left: 10px;
    color: var(--color-primario);
}

.menu-item-has-children > a::after {
    content: '▾';
    font-size: 14px;
    font-weight: 800;
    color: var(--color-primario);
    padding-left: 4px;
}


/* ── Burger (oculto en desktop) ─────────────────────────── */

.header__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;

    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;

    min-width: 44px;
    min-height: 44px;
}

.header__line {
    display: block;
    height: 2px;
    width: 28px;
    background-color: var(--color-primario);
    border-radius: 2px;
    transition: transform 0.45s ease, opacity 0.35s ease;
    transform-origin: center;
}


/* ============================================================
   RESPONSIVO — Móvil (≤ 800px)
   ============================================================ */

@media screen and (max-width: 800px) {

    .header {
        height: 64px;
        padding: 0 1rem;
        position: fixed;
        border-bottom: 2px solid var(--color-primario);
    }

    .header__logo img,
    .header__logo .custom-logo {
        max-height: 45px;
    }

    .header__claim {
        padding-left: 0.75rem;
    }

    .header__claim-titulo {
        font-size: 15px;
    }

    .header__claim-subtitulo {
        display: none;
    }

    .header__burger {
        display: flex;
        flex: 0 0 auto;
        order: 3;
    }

    .header__nav {
        flex: none;
        flex-direction: column;
        align-items: stretch;
        position: fixed;
        top: 64px;
        left: 0;
        width: 100%;
        background-color: var(--menu-background);
        overflow: hidden;

        max-height: 0;
        transition: max-height 0.45s ease, box-shadow 0.45s ease;
        box-shadow: none;
        z-index: 99;
    }

    .header__nav--open {
        max-height: 100vh;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    }

    .header__links {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 1rem 1.5rem 1.5rem;
        gap: 0;
    }

    .header__links > li {
        width: 100%;
        margin: 0;
        padding: 0;
        border-bottom: 1px solid var(--color-borde);
    }

    .header__links > li > a {
        display: block;
        padding: 12px 0;
    }

    .sub-menu {
        position: static;
        box-shadow: none;
        min-width: auto;
        width: 100%;
        max-height: 0;
        transition: max-height 0.4s ease-in-out;
    }

    .sub-menu > li {
        padding: 0 0 0 16px;
    }

    .sub-menu > li:first-child {
        border-top: none;
        padding-top: 0;
    }

    .sub-menu > li:last-child {
        padding-bottom: 8px;
    }

    li.menu-item-has-children > a {
        pointer-events: none;
    }
}


/* ============================================================
   Animaciones hamburguesa → X
   ============================================================ */

.header__line--line1.cross1 {
    transform: translateY(7px) rotate(45deg);
}

.header__line--line2.cross2 {
    opacity: 0;
    transform: scaleX(0);
}

.header__line--line3.cross3 {
    transform: translateY(-7px) rotate(-45deg);
}
