/* ==========================================================================
   ANALYTIX — Header global (fijo) y marco de páginas a ancho completo
   Markup: templates/header.php · Comportamiento: assets/js/header.js
   Archivo escrito a mano: NO lo regenera _build.py.
   ========================================================================== */

:root {
    --vc-header-h: 72px;
}

/* Se oculta el header de Kadence; el nuestro lo reemplaza */
body #masthead {
    display: none;
}

/* Que los anclas (#seccion) no queden tapados por el header fijo */
html {
    scroll-padding-top: calc(var(--vc-header-h) + 16px);
}

/* ─── Barra ───────────────────────────────────────────────────────── */
.vc-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid #F3F4F6;
    font-family: 'Inter', sans-serif;
    transition: box-shadow 0.25s ease;
}

.vc-header.is-scrolled {
    box-shadow: 0 4px 20px rgba(13, 27, 42, 0.08);
}

/* Con la barra de administración de WordPress visible */
.admin-bar .vc-header { top: 32px; }
@media (max-width: 782px) {
    .admin-bar .vc-header { top: 46px; }
}

.vc-header__inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 80rem;
    height: var(--vc-header-h);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

/* ─── Logo ────────────────────────────────────────────────────────── */
.vc-header__logo {
    justify-self: start;
    display: inline-flex;
    align-items: center;
}

.vc-header__logo img {
    display: block;
    width: auto;
    height: 52px;
}

/* ─── Menú ────────────────────────────────────────────────────────── */
.vc-header__list {
    display: flex;
    align-items: center;
    gap: 2.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.vc-header__link {
    position: relative;
    padding-block: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #333333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.vc-header__link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--vc-primary, #185FA5);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.vc-header__link:hover,
.vc-header__link:focus-visible,
.vc-header__link[aria-current="page"] {
    color: var(--vc-primary, #185FA5);
}

.vc-header__link:hover::after,
.vc-header__link:focus-visible::after,
.vc-header__link[aria-current="page"]::after {
    transform: scaleX(1);
}

/* ─── Botón CTA ───────────────────────────────────────────────────── */
.vc-header__cta {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.75rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--vc-bg-dark, #0D1B2A) 0%, var(--vc-primary, #185FA5) 100%);
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.vc-header__cta:hover,
.vc-header__cta:focus-visible {
    background: var(--vc-primary, #185FA5);
    color: #FFFFFF;
    transform: translateY(-1px);
}

.vc-header__cta--mobile { display: none; }

.vc-header a:focus-visible,
.vc-header button:focus-visible {
    outline: 2px solid var(--vc-primary-light, #378ADD);
    outline-offset: 3px;
}

/* ─── Botón hamburguesa (solo móvil) ──────────────────────────────── */
.vc-header__toggle {
    display: none;
    justify-self: end;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.vc-header__bar {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--vc-bg-dark, #0D1B2A);
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.vc-header__toggle[aria-expanded="true"] .vc-header__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.vc-header__toggle[aria-expanded="true"] .vc-header__bar:nth-child(2) { opacity: 0; }
.vc-header__toggle[aria-expanded="true"] .vc-header__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Tablet y móvil: menú desplegable ────────────────────────────── */
@media (max-width: 900px) {
    :root { --vc-header-h: 64px; }

    .vc-header__inner {
        grid-template-columns: 1fr auto;
    }

    .vc-header__logo img { height: 46px; }

    .vc-header__cta--desktop { display: none; }
    .vc-header__toggle { display: inline-flex; }

    .vc-header__nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 1.5rem 1.5rem;
        background: #FFFFFF;
        border-bottom: 1px solid #F3F4F6;
        box-shadow: 0 12px 24px rgba(13, 27, 42, 0.08);
    }

    .vc-header.is-open .vc-header__nav { display: flex; }

    .vc-header__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .vc-header__link {
        display: block;
        padding: 0.9rem 0;
        border-bottom: 1px solid #F3F4F6;
    }

    .vc-header__link::after { display: none; }

    .vc-header__cta--mobile {
        display: inline-flex;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vc-header,
    .vc-header__link,
    .vc-header__link::after,
    .vc-header__cta,
    .vc-header__bar { transition: none; }
}

/* ─── Páginas a ancho completo (clase vc-fullbleed, ver functions.php) ─ */
/* Quita el margen y el relleno del contenedor de Kadence para que el bloque
   oscuro llegue de borde a borde, justo debajo del header. */
body.vc-fullbleed .content-area {
    margin-block: 0;
}

body.vc-fullbleed .content-container,
body.vc-fullbleed .site-container {
    max-width: none;
    padding-inline: 0;
}

body.vc-fullbleed .entry-content-wrap,
body.vc-fullbleed .entry-content,
body.vc-fullbleed .content-wrap {
    padding: 0;
    margin: 0;
}
