/* ============================================================
   CPR — Landing: Header
   Ex <style> inline de Landing/00-Header.html. Encolado desde
   inc/theme/assets-loader.php (cpr_encolar_assets_landing) en
   /terapia-online. Los tokens locales --color-verde-* que tenía
   este bloque (duplicados con hero.css) se centralizaron en
   assets/css/tokens.css (--green-*, --brown-*).
   Complemento JS: assets/js/landing/header.js
   ============================================================ */

#header-landing {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--grey-200);
    box-shadow: var(--shadow-strong);
    font-family: var(--font-sans);
}

#header-landing *,
#header-landing *::before,
#header-landing *::after {
    box-sizing: border-box;
    font-family: inherit;
}

#header-landing-spacer {
    height: 0;
}

/* Compensa el header fijo al saltar a un ancla (#seccion-...) — sin esto
   la sección quedaría tapada bajo el header. --header-h la fija
   assets/js/landing/header.js con el alto real; 70px es fallback antes
   de que corra el JS o si no corre. */
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h, 70px);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

#header-landing .cpr-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.7rem clamp(1rem, 5vw, 4rem);
}

.cpr-header-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: var(--space-4);
}

.cpr-header-logo-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
    cursor: pointer;
}

.cpr-header-logo {
    height: 40px !important;
    width: auto !important;
    max-width: none;
    display: block;
}

.cpr-header-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.cpr-header-brand strong {
    font-size: var(--fs-body);
    font-weight: var(--fw-semibold);
    color: var(--green-800);
    line-height: 1.3;
}

.cpr-header-brand span {
    font-size: 0.825rem;
    font-weight: var(--fw-regular);
    font-style: italic;
    color: var(--green-800);
}

.cpr-header-links {
    display: none;
}

.cpr-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}

.cpr-header-actions > .cpr-header-cta {
    display: none;
}

.cpr-header-cta {
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    background-color: var(--green-600);
    color: var(--white) !important;
    font-size: 0.9rem;
    font-weight: var(--fw-semibold);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--dur-fast) ease;
}

.cpr-header-cta:hover {
    background-color: var(--brown-700);
}

.cpr-header-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 34px;
    height: 34px;
    padding: 0;
    background: none;
    border: 1.5px solid var(--border-card);
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.cpr-header-burger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--green-800);
    border-radius: 2px;
    transition: transform var(--dur-base) ease, opacity var(--dur-base) ease;
}

.cpr-header-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cpr-header-burger.is-open span:nth-child(2) { opacity: 0; }
.cpr-header-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Resetea cualquier color heredado (p.ej. :focus/:active globales del tema
   padre Astra) para que el botón no quede "pintado" tras el tap en mobile.
   !important porque el tema padre suele aplicar sus propios estilos de
   :focus/:active a todos los <button> con mayor especificidad. */
.cpr-header-burger:hover,
.cpr-header-burger:focus,
.cpr-header-burger:active {
    background: none !important;
    border-color: var(--border-card) !important;
    box-shadow: none !important;
    outline: none !important;
}

.cpr-header-burger:focus-visible {
    outline: 2px solid var(--grey-700) !important;
    outline-offset: 2px;
}

.cpr-header-mobile-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--white);
    border-top: 1px solid rgba(38, 63, 30, 0.15);
    padding: 0 clamp(1rem, 5vw, 4rem);
    box-shadow: var(--shadow-strong);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.28s ease, opacity var(--dur-base) ease, padding-block 0.28s ease;
}

.cpr-header-mobile-panel.is-open {
    max-height: calc(100vh - 60px);
    opacity: 1;
    overflow-y: auto;
    pointer-events: auto;
    padding-block: 0.25rem 1.25rem;
}

.cpr-header-mobile-panel a:not(.cpr-header-cta) {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(38, 63, 30, 0.1);
    font-size: var(--fs-body);
    font-weight: var(--fw-medium);
    color: var(--green-800);
    text-decoration: none;
}

.cpr-header-mobile-panel .cpr-header-cta {
    display: flex;
    margin-top: 0.85rem;
}

@media (min-width: 1024px) {
    #header-landing .cpr-header-inner {
        max-width: none;
        padding: 0.7rem 2rem;
    }

    .cpr-header-links {
        display: flex;
        gap: 1.75rem;
        margin-left: auto;
    }

    .cpr-header-actions {
        margin-left: 0;
    }

    .cpr-header-links a {
        font-size: 0.95rem;
        font-weight: var(--fw-semibold);
        color: var(--grey-700);
        text-decoration: none;
        transition: color var(--dur-fast) ease;
    }

    .cpr-header-links a:hover {
        color: var(--green-800);
    }

    .cpr-header-actions > .cpr-header-cta {
        display: inline-flex;
        margin-left: 2rem;
    }

    .cpr-header-burger,
    .cpr-header-mobile-panel {
        display: none !important;
    }
}
