/* ===== HEADER MÍNIMO — Jennifer =====
   Logo · tres enlaces · un botón. Paleta hueso / blanco / negro.
   Arranca transparente encima del hero (position absolute) y pasa a fijo
   en hueso con una línea fina al hacer scroll (clase .scrolled, ver header.php).
   Sobre heros oscuros (/servicios, /nosotros y la home en celular) el header
   hereda color blanco: el logo usa currentColor y los enlaces color: inherit. */

:root { --hdr-h: 72px; --hdr-h-movil: 64px; }

.site-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    color: #111111;
    background: transparent;
}

.site-header.scrolled {
    position: fixed;
    /* Sin backdrop-filter ni transform persistente: crearían un contenedor para
       el panel móvil (position: fixed) y el menú no se abriría bien. */
    background: #F7F4EE;
    border-bottom: 1px solid #E6DED2;
    animation: hdrIn 0.3s ease;
}

@keyframes hdrIn {
    from { transform: translateY(-100%); }
    to   { transform: none; }
}

.header-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 2rem;
    height: var(--hdr-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* ── Logo (SVG inline, currentColor) ── */
.logo-link { display: inline-flex; align-items: center; color: inherit; flex-shrink: 0; }
.logo-svg { display: block; }
.logo-img { height: 46px; width: auto; }

/* ── Enlaces ── */
.main-nav { display: flex; align-items: center; }

.nav-list {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item--inicio { display: none; }

.nav-link {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: inherit;
    text-decoration: none;
    padding: 0.35rem 0;
    border-bottom: 1px solid transparent;
    opacity: 0.78;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible { opacity: 1; }
.nav-link.active { opacity: 1; border-bottom-color: currentColor; }
.nav-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.nav-foot { display: none; }

/* ── Acciones: botón WhatsApp + hamburguesa ── */
.header-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

.btn-header-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 42px;
    padding: 0 1.2rem;
    border-radius: 100px;
    background: #8FDCCB;
    color: #0B2F29;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease;
}
.btn-header-cta i { font-size: 1.05rem; }
.btn-header-cta:hover { background: #6FCDB8; color: #0B2F29; }
.btn-header-cta:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 42px;
    height: 42px;
    padding: 0;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
}
.menu-toggle .bar {
    width: 18px;
    height: 1.5px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.25s ease;
}
.menu-toggle.active .bar:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
.menu-toggle.active .bar:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }

/* ── Variante clara sobre heros oscuros ── */

body:has(.ab-hero) .site-header:not(.scrolled) { color: #FFFFFF; }

/* ===== CELULAR ===== */
@media (max-width: 768px) {
    .header-container { height: var(--hdr-h-movil); }
    .logo-img { height: 40px; }

    /* La home lleva foto oscura de fondo en celular */
    body:has(.hero) .site-header:not(.scrolled) { color: #FFFFFF; }

    .header-actions { gap: 0.5rem; }
    .header-actions .btn-header-cta { width: 42px; padding: 0; justify-content: center; }
    .header-actions .btn-header-cta span { display: none; }
    .menu-toggle { display: flex; }

    /* Panel a pantalla completa debajo del header */
    .main-nav {
        position: fixed;
        top: var(--hdr-h-movil);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 2rem 2rem;
        background: #F7F4EE;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0.2s;
        overflow-y: auto;
    }
    .main-nav.active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

    .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-item--inicio { display: block; }
    .nav-link {
        display: block;
        font-family: "Times New Roman", Times, "Liberation Serif", serif;
        font-size: 2rem;
        font-weight: 400;
        letter-spacing: -0.01em;
        color: #111111;
        padding: 0.9rem 0;
        border-bottom: 1px solid #E6DED2;
        opacity: 1;
    }
    .nav-link.active { font-style: italic; border-bottom-color: #E6DED2; }

    .nav-foot {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        margin: auto 0 0;
        padding-top: 1.5rem;
        font-family: var(--font-body);
        font-size: 0.95rem;
        color: #6B6B6B;
    }
    .nav-foot a { color: #111111; font-weight: 600; text-decoration: none; }

    /* Con el menú abierto el header se fija en hueso, en negro, sobre cualquier hero */
    html:has(body.menu-open), body.menu-open { overflow: hidden; }
    body.menu-open .site-header,
    body.menu-open .site-header:not(.scrolled) {
        position: fixed;
        top: 0;
        color: #111111;
        background: #F7F4EE;
        border-bottom: 1px solid #E6DED2;
        animation: none;
    }
}

@media (min-width: 769px) {
    .main-nav { position: static; opacity: 1; visibility: visible; transform: none; }
}
