/* =============================================================
   LAYOUT — header, footer
   ============================================================= */

/* ── Iconos Lucide (SVG inline) — base global ── */
.cusvib-ic {
    width: 1.8rem;
    height: 1.8rem;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    stroke: currentColor;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.08);
    transition: background .35s ease, border-color .35s ease, box-shadow .35s ease;
}

.site-header--transparent {
    background: transparent;
    border-bottom-color: transparent;
}

.site-header.scrolled {
    background: #fff;
    border-bottom-color: rgba(0,0,0,.08);
    box-shadow: 0 2px 20px rgba(0,0,0,.12);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 2.4rem;
    max-width: 134rem;
    margin: 0 auto;
    padding: 0 2.4rem;
    height: 7.2rem;
}

/* Logo — two variants: dark (on white bg) / light (on transparent) */
.site-header__logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.site-header__logo img {
    height: 4.4rem;
    width: auto;
}

/* Default state: dark logo visible, light hidden */
.site-header .logo-dark  { display: block; }
.site-header .logo-light { display: none; }

/* Transparent state: show light logo */
.site-header--transparent:not(.scrolled) .logo-dark  { display: none; }
.site-header--transparent:not(.scrolled) .logo-light { display: block; }

/* Nav */
.site-header__nav {
    flex: 1;
}

.nav-list,
.site-header__nav ul {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.nav-list > li > a,
.site-header__nav ul > li > a {
    display: block;
    padding: 0.6rem 1.2rem;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #232B1E;
    text-decoration: none;
    border-radius: 0.4rem;
    transition: color .2s ease, background .2s ease;
}

.nav-list > li > a:hover,
.nav-list > li.current-menu-item > a,
.nav-list > li.current-page-ancestor > a,
.site-header__nav ul > li > a:hover,
.site-header__nav ul > li.current-menu-item > a,
.site-header__nav ul > li.current-page-ancestor > a {
    color: #232B1E;
    background: rgba(31,71,104,.06);
}

/* Transparent mode: white links */
.site-header--transparent:not(.scrolled) .nav-list > li > a,
.site-header--transparent:not(.scrolled) .site-header__nav ul > li > a {
    color: rgba(255,255,255,.92);
}
.site-header--transparent:not(.scrolled) .nav-list > li > a:hover,
.site-header--transparent:not(.scrolled) .nav-list > li.current-menu-item > a,
.site-header--transparent:not(.scrolled) .site-header__nav ul > li > a:hover,
.site-header--transparent:not(.scrolled) .site-header__nav ul > li.current-menu-item > a {
    color: #fff;
    background: rgba(255,255,255,.15);
}

/* Language switcher */
.lang-switch {
    display: flex;
    align-items: center;
    gap: .6rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    > li {
        height: 2.6rem;
    }
}
/* En la barra del header (desktop) el nombre del idioma no se muestra: solo bandera */
.lang-switch--bar .lang-switch__name { display: none; }
/* Contenedor mobile dentro del panel — oculto por defecto (desktop) */
.nav-mobile-lang { display: none; }
.lang-switch__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: .5rem;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}
.lang-switch__flag {
    display: block;
    width: 3.8rem;
    height: 2.6rem;
    object-fit: cover;
    border-radius: .4rem;
    box-shadow: 0 .1rem .4rem rgba(27,33,23,.25);
    transition: transform .2s ease, box-shadow .2s ease;
}
.lang-switch__link:hover .lang-switch__flag {
    transform: translateY(-1px) scale(1.06);
    box-shadow: 0 .4rem 1rem rgba(27,33,23,.3);
}
/* Fallback abreviatura si falta el SVG */
.lang-switch__abbr {
    display: inline-block;
    padding: .4rem .7rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #232B1E;
    border-radius: .6rem;
    opacity: .7;
}
.site-header--transparent:not(.scrolled) .lang-switch__abbr { color: #fff; }
.site-header--transparent:not(.scrolled) .lang-switch__flag {
    box-shadow: 0 .1rem .5rem rgba(0,0,0,.4);
}

/* Header CTA */
.site-header__cta {
    flex-shrink: 0;
}

/* WhatsApp del header — 3 estados:
   - sobre hero oscuro (transparent): glass/ghost con borde claro
   - sticky/scrolled (fondo blanco): gradient burgundy
   - hover/active: verde WhatsApp */
.btn--wa-header {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .9rem 2rem;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: .04em;
    border-radius: 10rem;
    text-decoration: none;
    white-space: nowrap;
    border: 1.5px solid transparent;
    transition: background .25s ease, border-color .25s ease, color .25s ease, transform .15s ease, box-shadow .25s ease;
}
.btn--wa-header i { font-size: 1.6rem; }

/* Estado normal: header con fondo blanco (default + scrolled) → gradient burgundy */
.btn--wa-header,
.site-header.scrolled .btn--wa-header {
    background: linear-gradient(135deg, var(--son-deep-burgundy, #8A6632) 0%, var(--son-rose-red, #AA7E42) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 .6rem 1.6rem rgba(117,38,50,.28);
}

/* Estado normal: header transparente sobre hero oscuro → glass/ghost */
.site-header--transparent:not(.scrolled) .btn--wa-header {
    background: rgba(255,255,255,.1);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-color: rgba(255,255,255,.55);
    color: #fff;
    box-shadow: none;
}

/* Hover / active / focus → verde WhatsApp (en cualquier estado) */
.btn--wa-header:hover,
.btn--wa-header:focus-visible,
.btn--wa-header:active,
.site-header.scrolled .btn--wa-header:hover,
.site-header--transparent:not(.scrolled) .btn--wa-header:hover {
    background: var(--color-whatsapp, #25d366);
    border-color: var(--color-whatsapp, #25d366);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 .8rem 2rem rgba(37,211,102,.4);
}

/* Hamburger */
.nav-toggle {
    display: none;
    position: relative;
    width: 3.6rem;
    height: 3.6rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
/* Las 3 barras posicionadas absolutas → cruce exacto al formar la X */
.nav-toggle span {
    position: absolute;
    left: 50%;
    width: 2.4rem;
    height: .25rem;
    margin-left: -1.2rem;
    background: #232B1E;
    border-radius: .2rem;
    transform-origin: center;
    transition: background .2s ease, transform .3s ease, opacity .2s ease, top .3s ease;
}
.nav-toggle span:nth-child(1) { top: 1.1rem; }
.nav-toggle span:nth-child(2) { top: 1.75rem; }
.nav-toggle span:nth-child(3) { top: 2.4rem; }
.site-header--transparent:not(.scrolled) .nav-toggle span {
    background: #fff;
}
/* Estado X: las 3 al centro, dos rotadas, la del medio desaparece */
.nav-toggle.active span:nth-child(1) { top: 1.75rem; transform: rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.active span:nth-child(3) { top: 1.75rem; transform: rotate(-45deg); }

/* Push content below fixed header (excepto cuando hay hero oscuro a pantalla completa) */
body:not(.home):not(.has-dark-hero) .site-content,
body:not(.home):not(.has-dark-hero) main {
    padding-top: 7.2rem;
}

/* CTA WhatsApp del panel móvil: oculto en desktop */
.nav-mobile-cta { display: none; }

/* ── MOBILE NAV (panel deslizante — línea Pencil) ─────────────── */
@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .site-header__cta { display: none; }

    /* Backdrop oscuro a pantalla completa (overlay del header, detrás del panel) */
    .site-header::after {
        content: '';
        position: fixed; inset: 0;
        background: rgba(27,33,23,.5);
        -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
        opacity: 0; pointer-events: none;
        transition: opacity .35s ease;
        z-index: 1000;
    }
    .site-header:has(.site-header__nav.nav-open)::after { opacity: 1; pointer-events: auto; }

    /* Panel deslizante desde la derecha — verde oscuro */
    .site-header__nav {
        position: fixed;
        top: 0; right: 0; bottom: 0;
        width: min(84vw, 35rem);
        background: #1B2117;
        transform: translateX(105%);
        transition: transform .4s cubic-bezier(.4,0,.2,1), box-shadow .4s ease;
        overflow-y: auto;
        padding: 0;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        z-index: 1001;
    }
    .site-header__nav.nav-open {
        transform: translateX(0);
        box-shadow: -2rem 0 6rem rgba(27,33,23,.3);
    }

    /* Barra de acento superior del panel */
    .site-header__nav::after {
        content: '';
        position: sticky; top: 0; left: 0; right: 0; height: .5rem;
        flex-shrink: 0;
        background: linear-gradient(90deg, var(--son-deep-burgundy, #8A6632), var(--son-rose-red, #AA7E42));
        z-index: 2;
    }

    .nav-list,
    .site-header__nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 5.6rem 0 2rem;
        margin: 0;
    }
    .nav-list > li,
    .site-header__nav ul > li {
        width: 100%;
        border: none;
        border-bottom: 1px solid rgba(255,255,255,.1);
    }
    .nav-list > li:first-child,
    .site-header__nav ul > li:first-child { border-top: 1px solid rgba(255,255,255,.1); }

    .nav-list > li > a,
    .site-header__nav ul > li > a {
        display: flex; align-items: center; justify-content: space-between;
        padding: 1.8rem 2.4rem !important;
        font-family: var(--son-font-heading, 'Cormorant Garamond', serif);
        font-size: 2.2rem !important;
        font-weight: 600;
        letter-spacing: 0;
        text-transform: none;
        color: #EFEAD6 !important;
        background: none !important;
        transition: color .2s ease, background .2s ease, padding-left .2s ease;
    }
    .nav-list > li > a::after {
        content: '\203A';
        font-family: 'Inter', sans-serif;
        font-size: 2rem; font-weight: 400;
        color: rgba(239,234,214,.45);
        transition: transform .2s ease, color .2s ease;
    }
    .nav-list > li > a:active,
    .nav-list > li.current-menu-item > a,
    .nav-list > li > a:hover {
        color: var(--son-gold-light, #D1B178) !important;
        background: rgba(255,255,255,.05) !important;
        padding-left: 2.8rem !important;
    }
    .nav-list > li > a:hover::after,
    .nav-list > li.current-menu-item > a::after { color: var(--son-gold-light, #D1B178); transform: translateX(.3rem); }

    /* CTA WhatsApp dentro del panel (al pie) — oculto: ya existe FAB flotante */
    .nav-mobile-cta { display: none; }

    /* Burger por encima del panel + oscuro cuando el menú está abierto */
    .nav-toggle { position: relative; z-index: 1002; }
    .site-header__nav { z-index: 1001; }
    .nav-toggle.active span { background: #EFEAD6 !important; }

    /* mobile: logo claro en hero transparente, oscuro al hacer scroll (igual que desktop) */
    .site-header .logo-dark  { display: block; }
    .site-header .logo-light { display: none; }
    .site-header--transparent:not(.scrolled) .logo-dark  { display: none; }
    .site-header--transparent:not(.scrolled) .logo-light { display: block; }
    .site-header--transparent:not(.scrolled) .nav-toggle span { background: #fff; }
    .site-header.scrolled .nav-toggle span { background: #232B1E; }

    /* Idiomas: ocultar de la barra, mostrar dentro del panel */
    .lang-switch--bar { display: none !important; }
    .nav-mobile-lang {
        display: block;
        margin-top: auto;
        padding: 2.4rem;
        border-top: 1px solid rgba(255,255,255,.1);
    }
    .nav-mobile-lang__label {
        display: block;
        font-family: 'Inter', sans-serif;
        font-size: 1.2rem; font-weight: 700; letter-spacing: .12em;
        text-transform: uppercase;
        color: var(--son-gold-light, #D1B178);
        margin-bottom: 1.4rem;
    }
    .lang-switch--in-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .lang-switch--in-menu > li { height: auto; }
    .lang-switch--in-menu .lang-switch__link {
        justify-content: flex-start;
        gap: 1.4rem;
        padding: 1rem 1.2rem;
        border-radius: .8rem;
        background: rgba(255,255,255,.05);
        transition: background .2s ease;
    }
    .lang-switch--in-menu .lang-switch__link:hover { background: rgba(255,255,255,.1); }
    .lang-switch--in-menu .lang-switch__flag {
        width: 3.4rem; height: 2.3rem; flex-shrink: 0;
    }
    .lang-switch--in-menu .lang-switch__name {
        display: inline-block;
        font-family: var(--son-font-heading, 'Cormorant Garamond', serif);
        font-size: 1.9rem; font-weight: 600;
        color: #EFEAD6;
    }
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
    background: #1B2117;
    color: rgba(255,255,255,.8);
    font-size: 1.4rem;
}

.site-footer__main {
    padding: 7.2rem 0 5.6rem;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.4fr;
    gap: 4rem;
}
/* Footer por widgets: brand + 1 widget Grupo (que contiene las 3 columnas en un Row) */
.site-footer__grid:has(.footer-widget) {
    grid-template-columns: 2fr 4fr;
    align-items: start;
}
.footer-widget { min-width: 0; }
.footer-widget > .wp-block-group { margin: 0; }
.footer-cols-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 4rem;
    margin: 0;
    align-items: start !important;
    align-content: start !important;
}
.footer-cols-row > .footer-col { min-width: 0; align-self: start; margin: 0; }

/* Brand col */
.footer-logo {
    display: inline-block;
    margin-bottom: 1.6rem;
}
.footer-logo img {
    height: 5.2rem;
    width: auto;
}
.footer-tagline {
    font-size: 1.4rem;
    line-height: 1.7;
    color: rgba(255,255,255,.65);
    margin-bottom: 2rem;
    max-width: 30rem;
}
.footer-social {
    display: flex;
    gap: 1.2rem;
}
.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.8);
    font-size: 1.5rem;
    text-decoration: none;
    transition: background .2s, color .2s, transform .15s;
}
.footer-social a:hover {
    background: #AA7E42;
    color: #fff;
    transform: translateY(-2px);
}

/* Columns */
.footer-col__title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1.8rem;
    letter-spacing: .02em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .8rem;
}
.footer-links a {
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: 1.4rem;
    transition: color .2s;
}
.footer-links a:hover {
    color: #fff;
    padding-left: .4rem;
}

/* Contact col */
.footer-contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.footer-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: rgba(255,255,255,.65);
}
.footer-contact-list i {
    color: #AA7E42;
    font-size: 1.4rem;
    width: 1.6rem;
    flex-shrink: 0;
    margin-top: .2rem;
}
.footer-contact-list a {
    color: rgba(255,255,255,.65);
    text-decoration: none;
    transition: color .2s;
}
.footer-contact-list a:hover { color: #fff; }

.footer-certifications {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}
.footer-cert-badge {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.2rem;
    color: rgba(255,255,255,.5);
}
.footer-cert-badge i {
    color: #AA7E42;
}

/* ── Bloques nativos dentro de los widgets del footer (heredan estética) ── */
.footer-col h2, .footer-col h3, .footer-col h4,
.footer-col .wp-block-heading {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 1.8rem;
    letter-spacing: .02em;
}
.footer-col ul, .footer-col ol,
.footer-col .wp-block-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .8rem;
}
.footer-col li { color: rgba(255,255,255,.65); font-size: 1.4rem; line-height: 1.5; }
.footer-col a {
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: 1.4rem;
    transition: color .2s, padding-left .2s;
}
.footer-col a:hover { color: #fff; }
.footer-col li a:hover { padding-left: .4rem; }
.footer-col p { color: rgba(255,255,255,.65); font-size: 1.4rem; line-height: 1.6; margin: 0 0 1rem; }
.footer-col .wp-block-social-links { gap: 1rem; }
/* Iconos lucide/FA dentro del widget de contacto */
.footer-col .cusvib-ic, .footer-col i { color: #AA7E42; }

/* Bottom bar */
.site-footer__bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 2rem 0;
}
.site-footer__bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.footer-copyright {
    font-size: 1.3rem;
    color: rgba(255,255,255,.4);
}
.footer-legal-nav {
    display: flex;
    gap: 2rem;
}
.footer-legal-nav a {
    font-size: 1.3rem;
    color: rgba(255,255,255,.4);
    text-decoration: none;
    transition: color .2s;
}
.footer-legal-nav a:hover { color: rgba(255,255,255,.8); }

/* ── FOOTER RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 1100px) {
    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 3.2rem;
    }
    .footer-col--brand {
        grid-column: 1 / -1;
    }
    /* Widget path: brand sobre la fila de columnas */
    .site-footer__grid:has(.footer-widget) {
        grid-template-columns: 1fr;
    }
    .footer-cols-row {
        grid-template-columns: 1fr 1fr 1.4fr;
    }
}

@media (max-width: 640px) {
    .site-footer__grid {
        grid-template-columns: 1fr;
    }
    .footer-col--brand { grid-column: auto; }
    /* Widget path: columnas internas apiladas en mobile */
    .footer-cols-row {
        grid-template-columns: 1fr !important;
        gap: 3.2rem;
    }
    .site-footer__bottom-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* ── WhatsApp float ──────────────────────────────────────────── */
.wa-float {
    position: fixed;
    bottom: 2.4rem;
    right: 2.4rem;
    z-index: 900;
    width: 5.6rem;
    height: 5.6rem;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37,211,102,.45);
    transition: transform .2s, box-shadow .2s;
    text-decoration: none;
}
.wa-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37,211,102,.6);
}
