/* =========================================================================
   Centro Psicológico Consuelo Tomás — hoja de estilos principal
   ========================================================================= */

/* ------------------------------------------------------------- 1. tokens */
:root {
    /* marca — naranja tomado del logotipo */
    --brand-700: #B94708;
    --brand-600: #CE520B;
    --brand:     #E75E0E;
    --brand-400: #F07C36;
    --brand-200: #F8C4A4;
    --brand-100: #FDEADC;

    /* base fría, serena */
    --teal-950: #08211F;
    --teal-900: #0E322F;
    --teal-800: #14403C;
    --teal-700: #1B564F;
    --teal-600: #226B62;
    --teal-500: #2E867B;
    --teal-300: #7FB5AC;
    --teal-100: #DBEBE7;
    --teal-50:  #EFF6F4;

    --sand-50:  #FBF9F6;
    --sand-100: #F5F1EA;
    --sand-200: #EAE3D8;

    --ink:      #14201E;
    --ink-70:   #3E4F4B;
    --ink-50:   #6B7A76;
    --ink-25:   #A8B3B0;
    --line:     #E4EAE8;
    --paper:    #FFFFFF;

    --focus:    var(--brand);

    /* tipografía */
    --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.90rem);
    --step-0:  clamp(1.00rem, 0.96rem + 0.20vw, 1.09rem);
    --step-1:  clamp(1.20rem, 1.12rem + 0.38vw, 1.42rem);
    --step-2:  clamp(1.44rem, 1.30rem + 0.68vw, 1.85rem);
    --step-3:  clamp(1.73rem, 1.50rem + 1.10vw, 2.40rem);
    --step-4:  clamp(2.07rem, 1.72rem + 1.75vw, 3.12rem);
    --step-5:  clamp(2.60rem, 1.90rem + 3.40vw, 4.60rem);

    /* espacio */
    --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;
    --sp-4: 1rem;     --sp-5: 1.5rem;   --sp-6: 2rem;
    --sp-7: 3rem;     --sp-8: 4rem;     --sp-9: 6rem;

    /* otros */
    --wrap: 78rem;
    --wrap-narrow: 46rem;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 28px;
    --shadow-sm: 0 1px 2px rgba(20, 32, 30, .05), 0 2px 10px rgba(20, 32, 30, .04);
    --shadow: 0 4px 14px rgba(20, 32, 30, .06), 0 18px 44px -14px rgba(20, 32, 30, .14);
    --shadow-lg: 0 10px 28px rgba(20, 32, 30, .10), 0 40px 72px -24px rgba(8, 33, 31, .26);
    --ease: cubic-bezier(.22, .61, .36, 1);
    --header-h: 84px;
}

/* --------------------------------------------------------------- 2. base */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
    margin: 0;
    background: var(--sand-50);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: var(--step-0);
    line-height: 1.68;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.14;
    letter-spacing: -0.018em;
    color: var(--teal-900);
    margin: 0 0 var(--sp-4);
    text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 var(--sp-5); }
a { color: var(--teal-600); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-600); }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}

hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-7) 0; }
::selection { background: var(--brand-100); color: var(--brand-700); }

/* ------------------------------------------------------------ 3. utilidades */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, var(--wrap-narrow)); margin-inline: auto; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: var(--sp-4); top: -4rem; z-index: 200;
    background: var(--teal-800); color: #fff; padding: var(--sp-3) var(--sp-5);
    border-radius: var(--radius-sm); transition: top .2s;
}
.skip-link:focus { top: var(--sp-4); color: #fff; }

.section { padding-block: clamp(3.25rem, 6.5vw, 6rem); }
.section--tight { padding-block: clamp(2rem, 4vw, 3.5rem); }
.section--sand { background: var(--sand-100); }
.section--teal { background: var(--teal-900); color: var(--teal-100); }
.section--teal h2, .section--teal h3 { color: #fff; }

.eyebrow {
    display: inline-flex; align-items: center; gap: .55rem;
    font-family: var(--font-sans);
    font-size: var(--step--1);
    font-weight: 650;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--brand-600);
    margin: 0 0 var(--sp-3);
}
.eyebrow::before {
    content: ""; width: 1.6rem; height: 2px; border-radius: 2px;
    background: var(--brand); flex: none;
}
.lede { font-size: var(--step-1); color: var(--ink-70); line-height: 1.6; }

/* --------------------------------------------------------------- 4. botones */
.btn {
    --btn-bg: var(--teal-800);
    --btn-fg: #fff;
    position: relative;
    display: inline-flex; align-items: center; gap: var(--sp-2);
    padding: 0.92em 1.7em;
    background: var(--btn-bg); color: var(--btn-fg);
    border: 1px solid transparent; border-radius: 999px;
    font: 600 var(--step-0)/1 var(--font-sans);
    letter-spacing: -.005em;
    text-decoration: none; cursor: pointer;
    transition: transform .22s var(--ease), box-shadow .22s var(--ease),
                background .2s var(--ease), border-color .2s;
    box-shadow: 0 1px 2px rgba(20, 32, 30, .08);
}
.btn:hover {
    color: var(--btn-fg); transform: translateY(-2px);
    box-shadow: 0 10px 24px -8px rgba(20, 32, 30, .35);
}
.btn:active { transform: translateY(0); }
.btn svg { transition: transform .22s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn--accent { --btn-bg: var(--brand); }
.btn--accent:hover { --btn-bg: var(--brand-600); box-shadow: 0 12px 28px -10px rgba(231, 94, 14, .65); }
.btn--ghost {
    --btn-bg: transparent; --btn-fg: var(--teal-800);
    border-color: var(--teal-300); box-shadow: none;
}
.btn--ghost:hover { background: var(--teal-50); box-shadow: none; }
.btn--light { --btn-bg: #fff; --btn-fg: var(--teal-800); }
.btn--glass {
    --btn-bg: rgba(255, 255, 255, .12);
    --btn-fg: #fff;
    border-color: rgba(255, 255, 255, .34);
    backdrop-filter: blur(8px);
    box-shadow: none;
}
.btn--glass:hover { --btn-bg: rgba(255, 255, 255, .22); }
.btn--glass:hover svg { transform: none; }
.btn--sm { padding: .66em 1.25em; font-size: var(--step--1); }

/* ------------------------------------------------------------- 5. cabecera */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
    transition: background .3s var(--ease), border-color .3s, box-shadow .3s, backdrop-filter .3s;
}
.site-header.is-stuck { box-shadow: 0 2px 20px rgba(20, 32, 30, .07); }

/* modo hero: la cabecera flota sobre la imagen */
.site-header--overlay {
    position: fixed; inset-inline: 0; top: 0;
    background: transparent;
    backdrop-filter: none;
    border-bottom-color: transparent;
}
.site-header--overlay:not(.is-stuck) {
    --nav-fg: rgba(255, 255, 255, .88);
    --nav-fg-strong: #fff;
    --nav-hover-bg: rgba(255, 255, 255, .14);
}
.site-header--overlay.is-stuck {
    position: fixed;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom-color: var(--line);
    box-shadow: 0 2px 20px rgba(20, 32, 30, .07);
}

.header-bar {
    display: flex; align-items: center; gap: var(--sp-5);
    min-height: var(--header-h);
}

/* logotipo */
.brand { display: block; position: relative; flex: none; line-height: 0; text-decoration: none; }
.brand__logo {
    width: auto; height: 42px;
    transition: opacity .3s var(--ease);
}
.brand__logo--light {
    position: absolute; inset: 0; opacity: 0; pointer-events: none;
}
.site-header--overlay:not(.is-stuck) .brand__logo--dark { opacity: 0; }
.site-header--overlay:not(.is-stuck) .brand__logo--light { opacity: 1; }
.brand__name {
    font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
    color: var(--teal-900); line-height: 1.2;
}

/* navegación */
.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.nav__link {
    position: relative;
    display: inline-flex; align-items: center; gap: 5px;
    padding: .58rem .85rem; border-radius: 999px;
    font-size: .95rem; font-weight: 500;
    color: var(--nav-fg, var(--ink-70));
    text-decoration: none; white-space: nowrap;
    transition: background .2s var(--ease), color .2s var(--ease);
}
.nav__link:hover,
.nav__item:focus-within > .nav__link {
    background: var(--nav-hover-bg, var(--teal-50));
    color: var(--nav-fg-strong, var(--teal-800));
}
.nav__item.is-current > .nav__link {
    color: var(--nav-fg-strong, var(--teal-800)); font-weight: 600;
}
.nav__item.is-current > .nav__link::after {
    content: ""; position: absolute; left: .85rem; right: .85rem; bottom: .12rem;
    height: 2px; background: var(--brand); border-radius: 2px;
}
.nav__item { position: relative; }
.nav__caret { width: 10px; height: 10px; transition: transform .25s var(--ease); opacity: .6; }
.nav__item:hover > .nav__link .nav__caret { transform: rotate(180deg); }

/* desplegables */
.nav__panel {
    position: absolute; top: calc(100% + 8px); left: 50%; translate: -50% 0;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: var(--sp-5);
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.985);
    transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
    z-index: 20;
}
.nav__item:hover > .nav__panel,
.nav__item:focus-within > .nav__panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.nav__panel--simple { min-width: 19rem; }
.nav__panel--mega { display: flex; gap: var(--sp-5); min-width: min(70rem, 92vw); }
.nav__col { flex: 1 1 0; min-width: 12rem; }
.nav__col-title {
    font-size: .7rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
    color: var(--brand-600); margin: 0 0 var(--sp-2); padding-inline: .6rem;
}
.nav__sub { list-style: none; margin: 0; padding: 0; }
.nav__sub a {
    display: block; padding: .5rem .6rem; border-radius: var(--radius-sm);
    font-size: .92rem; color: var(--ink-70); text-decoration: none; line-height: 1.35;
    transition: background .15s, color .15s, padding-left .15s var(--ease);
}
.nav__sub a:hover { background: var(--teal-50); color: var(--teal-800); padding-left: .9rem; }

.header-cta { display: flex; align-items: center; gap: var(--sp-3); flex: none; }
.header-phone {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    font-weight: 600; font-size: .95rem; text-decoration: none;
    color: var(--nav-fg-strong, var(--teal-800));
    transition: color .2s;
}
.header-phone svg { width: 18px; height: 18px; }

/* menú móvil */
.nav-toggle {
    display: none; flex: none; width: 44px; height: 44px; padding: 0;
    background: none; border: 1px solid var(--line); border-radius: 12px;
    cursor: pointer; color: var(--nav-fg-strong, var(--teal-800));
}
.site-header--overlay:not(.is-stuck) .nav-toggle { border-color: rgba(255, 255, 255, .4); }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px;
    transition: transform .25s var(--ease), opacity .2s;
}
.nav-toggle span { margin-inline: auto; position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------------------------------------------------------------- 6. héroe */
.hero {
    position: relative;
    /* Las fotos del carrusel son panorámicas (1923x570, 3,37:1). Con un hero
       muy alto, object-fit las amplía al doble y se ven borrosas y recortadas.
       Esta altura mantiene el recorte en un rango razonable. */
    min-height: clamp(26rem, 36vw, 34rem);
    display: flex; flex-direction: column; justify-content: flex-end;
    background: var(--teal-950);
    overflow: hidden;
    isolation: isolate;
}
.hero__stage { position: absolute; inset: 0; display: grid; }

.hero__slide {
    grid-area: 1 / 1; position: relative;
    display: grid; align-items: center;
    opacity: 0; visibility: hidden;
    transition: opacity 1s var(--ease), visibility 1s;
}
.hero__slide.is-active { opacity: 1; visibility: visible; }

.hero__media { position: absolute; inset: 0; overflow: hidden; }
.hero__media img {
    width: 100%; height: 100%; object-fit: cover;
    transform: scale(1.035);
    transition: transform 11s linear;
}
.hero__slide.is-active .hero__media img { transform: scale(1); }
.hero__media::after {
    content: ""; position: absolute; inset: 0;
    background:
        linear-gradient(100deg, rgba(8, 33, 31, .86) 0%, rgba(8, 33, 31, .60) 42%, rgba(8, 33, 31, .08) 78%),
        linear-gradient(to top, rgba(8, 33, 31, .62), transparent 46%),
        linear-gradient(to bottom, rgba(8, 33, 31, .42), transparent 24%);
}

.hero__inner { position: relative; z-index: 2; width: min(100% - 2.5rem, var(--wrap)); }
.hero__body {
    padding-block: calc(var(--header-h) + clamp(1.75rem, 4vw, 3rem)) clamp(4.5rem, 8vw, 6rem);
    max-width: 40rem; color: #fff;
}
.hero__title {
    font-size: var(--step-5); color: #fff; margin: 0 0 var(--sp-4);
    letter-spacing: -.03em; line-height: 1.02;
}
.hero__text {
    font-size: var(--step-1); color: rgba(255, 255, 255, .85);
    margin: 0 0 var(--sp-6); max-width: 34rem; line-height: 1.5;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* animación de entrada del texto */
.hero__slide.is-active .hero__title,
.hero__slide.is-active .hero__text,
.hero__slide.is-active .hero__actions {
    animation: heroIn .85s var(--ease) both;
}
.hero__slide.is-active .hero__text { animation-delay: .1s; }
.hero__slide.is-active .hero__actions { animation-delay: .2s; }
@keyframes heroIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* controles */
.hero__controls {
    position: relative; z-index: 3;
    /* la tarjeta de atención se solapa con el hero: los indicadores se
       levantan para que no queden ocultos debajo */
    padding-bottom: clamp(3.75rem, 6vw, 4.5rem);
    display: flex; align-items: center; gap: var(--sp-5);
}
.hero__dots { display: flex; gap: var(--sp-2); }
.hero__dot {
    position: relative; width: 44px; height: 3px; padding: 0; border: 0;
    border-radius: 3px; cursor: pointer; overflow: hidden;
    background: rgba(255, 255, 255, .3);
    transition: width .35s var(--ease), background .3s;
}
.hero__dot:hover { background: rgba(255, 255, 255, .5); }
.hero__dot.is-active { width: 72px; background: rgba(255, 255, 255, .28); }
.hero__dot-fill {
    position: absolute; inset: 0; transform-origin: left;
    background: var(--brand); transform: scaleX(0);
}
.hero__dot.is-active .hero__dot-fill { animation: dotFill var(--hero-interval, 7s) linear forwards; }
@keyframes dotFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero__count {
    margin: 0; font-size: .82rem; font-weight: 600; letter-spacing: .1em;
    color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums;
}
.hero__count span { color: #fff; }

.hero__scroll {
    position: absolute; z-index: 3; right: max(1.25rem, calc((100vw - var(--wrap)) / 2));
    bottom: clamp(3.5rem, 5.5vw, 4.25rem);
    width: 46px; height: 46px; display: grid; place-items: center;
    border: 1px solid rgba(255, 255, 255, .32); border-radius: 50%;
    color: #fff; text-decoration: none;
    transition: background .25s, transform .25s var(--ease);
    animation: bob 2.4s ease-in-out infinite;
}
.hero__scroll:hover { background: rgba(255, 255, 255, .16); color: #fff; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* barra de contacto bajo el héroe */
.hero-strip { background: var(--teal-800); color: var(--teal-100); padding-block: var(--sp-5); }
.hero-strip__inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--sp-4);
}
.hero-strip p { margin: 0; }
.hero-strip strong { color: #fff; }

/* ------------------------------------------------------- 7. cinta de teléfono */
.cta-band {
    position: relative; overflow: hidden;
    background: linear-gradient(126deg, var(--teal-900) 0%, var(--teal-700) 58%, var(--teal-600) 100%);
    color: #fff; border-radius: var(--radius-lg);
    padding: clamp(2rem, 4.5vw, 3.25rem);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--sp-5);
    margin-block: var(--sp-8);
    box-shadow: var(--shadow);
}
.cta-band::after {
    content: ""; position: absolute; inset: auto -12% -70% auto;
    width: 28rem; height: 28rem; border-radius: 50%;
    background: radial-gradient(circle, rgba(231, 94, 14, .34), transparent 68%);
    pointer-events: none;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band__title { color: #fff; margin: 0 0 var(--sp-2); font-size: var(--step-2); }
.cta-band p { margin: 0; color: rgba(255, 255, 255, .8); }
.cta-band__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); }
.cta-band__phone {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    font-family: var(--font-display); font-size: var(--step-2); font-weight: 600;
    color: #fff; text-decoration: none; letter-spacing: -.02em;
}
.cta-band__phone:hover { color: var(--brand-200); }

/* teléfono en línea: presencia sin insistencia */
.phone-inline {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-5);
    margin: var(--sp-5) 0 0;
}
.phone-inline a {
    display: inline-flex; align-items: center; gap: var(--sp-3);
    font-family: var(--font-display); font-size: var(--step-3); font-weight: 600;
    letter-spacing: -.02em; color: var(--teal-900); text-decoration: none;
    transition: color .2s var(--ease);
}
.phone-inline a svg { color: var(--brand); flex: none; }
.phone-inline a:hover { color: var(--brand-600); }
.phone-inline__note {
    font-size: .88rem; color: var(--ink-50);
}

/* --------------------------------------------------------- 8. rejilla de cards */
.card-grid {
    display: grid; gap: var(--sp-4);
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.pcard {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
    padding: var(--sp-6) var(--sp-4);
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    text-align: center; text-decoration: none; color: var(--teal-900);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.pcard::before {
    content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px;
    background: var(--brand); transform: scaleX(0); transform-origin: left;
    transition: transform .3s var(--ease);
}
.pcard:hover {
    transform: translateY(-5px); box-shadow: var(--shadow);
    border-color: var(--brand-200); color: var(--teal-800);
}
.pcard:hover::before { transform: scaleX(1); }
.pcard__icon {
    width: 60px; height: 60px; display: grid; place-items: center;
    background: var(--teal-50); border-radius: 50%; padding: 13px;
    transition: background .25s, transform .25s var(--ease);
}
.pcard:hover .pcard__icon { background: var(--brand-100); transform: scale(1.06); }
.pcard__icon img { width: 100%; height: 100%; object-fit: contain; }
.pcard__label { font-weight: 600; font-size: .95rem; line-height: 1.3; }

/* tarjetas de tratamiento */
.tcard-grid {
    display: grid; gap: var(--sp-5);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 62rem) { .tcard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .tcard-grid { grid-template-columns: 1fr; } }
.tcard {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
    text-decoration: none; color: inherit;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.tcard:hover { transform: translateY(-5px); box-shadow: var(--shadow); color: inherit; }
.tcard__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--teal-50); }
.tcard__media img { width: 100%; height: 100%; object-fit: cover; transition: scale .5s var(--ease); }
.tcard:hover .tcard__media img { scale: 1.06; }
.tcard__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.tcard__title { margin: 0; font-size: var(--step-1); }
.tcard__text { margin: 0; color: var(--ink-50); font-size: .95rem; }
.tcard__more {
    margin-top: auto; padding-top: var(--sp-3);
    font-weight: 600; font-size: .9rem; color: var(--brand-600);
    display: inline-flex; align-items: center; gap: 6px;
    transition: gap .2s var(--ease);
}
.tcard:hover .tcard__more { gap: 11px; }

/* ------------------------------------------- 8b. portada de página interior */
.page-hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(90rem 40rem at 88% -20%, rgba(231, 94, 14, .12), transparent 62%),
        radial-gradient(70rem 36rem at -8% 8%, rgba(46, 134, 123, .16), transparent 60%),
        linear-gradient(170deg, var(--teal-50) 0%, var(--sand-50) 78%);
    border-bottom: 1px solid var(--line);
    padding-block: clamp(2.5rem, 5vw, 4.25rem);
}
.page-hero__grid {
    position: relative; z-index: 1;
    display: grid; gap: clamp(1.75rem, 4vw, 3.5rem);
    align-items: center;
}
@media (min-width: 60rem) {
    .page-hero--media .page-hero__grid { grid-template-columns: 1.05fr .95fr; }
}
.page-hero__text { display: grid; justify-items: start; gap: var(--sp-4); }
.page-hero__text > * { margin: 0; }
.page-hero__text > .eyebrow { margin-bottom: calc(var(--sp-2) * -1); }
.page-hero h1 { max-width: 18ch; }
.page-hero .lede { max-width: 54ch; }
.page-hero__actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4);
    padding-top: var(--sp-2);
}
.page-hero__phone {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    font-weight: 650; color: var(--teal-800); text-decoration: none;
    transition: color .2s;
}
.page-hero__phone svg { color: var(--brand); }
.page-hero__phone:hover { color: var(--brand-600); }

/* la fotografía, con una pastilla de color desplazada detrás */
.page-hero__media {
    position: relative; margin: 0;
    border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 5 / 4;
    animation: coverIn .9s var(--ease) both;
}
.page-hero__media::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(200deg, transparent 55%, rgba(8, 33, 31, .22));
}
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero--media .page-hero__grid::after {
    content: ""; position: absolute; z-index: -1;
    inset: auto -4% -18% 58%; height: 70%;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--brand), var(--brand-400));
    opacity: .14;
}
@keyframes coverIn {
    from { opacity: 0; transform: translateY(22px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@media (max-width: 60rem) {
    .page-hero__media { aspect-ratio: 16 / 9; }
    .page-hero--media .page-hero__grid::after { display: none; }
}

/* --------------------------------------------------------------- 9. artículo */
.page-head {
    position: relative; overflow: hidden;
    background: linear-gradient(168deg, var(--teal-50) 0%, var(--sand-50) 72%);
    border-bottom: 1px solid var(--line);
    padding-block: clamp(2.75rem, 5.5vw, 4.5rem);
}
.page-head::after {
    content: ""; position: absolute; inset: -40% -10% auto auto;
    width: 26rem; height: 26rem; border-radius: 50%;
    background: radial-gradient(circle, rgba(231, 94, 14, .10), transparent 66%);
    pointer-events: none;
}
.page-head__inner { position: relative; z-index: 1; display: grid; gap: var(--sp-4); }
.page-head h1 { margin: 0; max-width: 22ch; }
.page-head .lede { margin: 0; max-width: 62ch; }

.breadcrumb { font-size: .85rem; color: var(--ink-50); margin: 0 0 var(--sp-2); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.breadcrumb li::after { content: "›"; margin-left: .4rem; color: var(--ink-25); }
.breadcrumb li:last-child::after { content: none; }
.breadcrumb a { color: var(--ink-50); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-600); text-decoration: underline; }

.article-layout {
    display: grid; gap: clamp(2rem, 4vw, 4rem);
    grid-template-columns: minmax(0, 1fr);
    padding-block: clamp(2.5rem, 5vw, 4.5rem);
}
@media (min-width: 62rem) {
    .article-layout.has-toc { grid-template-columns: 16rem minmax(0, 1fr); }
}

.toc { position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start; }
@media (max-width: 62rem) {
    .toc {
        position: static; background: var(--teal-50); border: 1px solid var(--teal-100);
        border-radius: var(--radius); padding: var(--sp-4) var(--sp-5);
        max-height: 16rem; overflow-y: auto;
    }
}
.toc__title {
    font-size: .7rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
    color: var(--brand-600); margin: 0 0 var(--sp-3);
}
.toc__list { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc__list a {
    display: block; padding: .4rem 0 .4rem .9rem; margin-left: -2px;
    border-left: 2px solid transparent;
    font-size: .88rem; line-height: 1.35; color: var(--ink-50); text-decoration: none;
    transition: color .18s, border-color .18s, padding-left .18s var(--ease);
}
.toc__list a:hover { color: var(--teal-700); padding-left: 1.1rem; }
.toc__list a.is-active { color: var(--teal-800); border-left-color: var(--brand); font-weight: 600; }
.toc__list .toc--h3 a { padding-left: 1.6rem; font-size: .83rem; }
.toc__list .toc--h3 a:hover { padding-left: 1.8rem; }

/* tipografía del contenido */
.prose { max-width: 68ch; font-size: 1.05rem; }
.prose > *:first-child { margin-top: 0; }
/* la entradilla del artículo entra con algo más de cuerpo */
.prose > p:first-of-type {
    font-size: 1.14rem; line-height: 1.6; color: var(--ink);
}
/* las imágenes se ensanchan hacia el margen libre de la derecha */
@media (min-width: 62rem) {
    .prose .c-figure { width: calc(100% + 7rem); max-width: none; }
}
.prose h2 {
    font-size: var(--step-2); margin: var(--sp-8) 0 var(--sp-4);
    padding-top: var(--sp-3); position: relative;
}
.prose h2::before {
    content: ""; position: absolute; top: -.2rem; left: 0;
    width: 2.6rem; height: 3px; border-radius: 3px; background: var(--brand);
}
.prose h3 { font-size: var(--step-1); margin: var(--sp-6) 0 var(--sp-3); color: var(--teal-800); }
.prose h4 { font-size: 1.08rem; margin: var(--sp-5) 0 var(--sp-2); color: var(--teal-700); }
.prose p { margin: 0 0 var(--sp-5); color: var(--ink-70); }
.prose strong, .prose b { color: var(--ink); font-weight: 650; }
.prose a { color: var(--teal-600); text-decoration: underline; text-decoration-color: var(--teal-300); }
.prose a:hover { color: var(--brand-600); text-decoration-color: currentColor; }
.prose ul, .prose ol { margin: 0 0 var(--sp-5); padding-left: 1.25rem; color: var(--ink-70); }
.prose li { margin-bottom: var(--sp-2); }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.6rem; }
.prose ul > li::before {
    content: ""; position: absolute; left: .3rem; top: .64em;
    width: 7px; height: 7px; border-radius: 50%; background: var(--brand-200);
}
.prose ol > li::marker { color: var(--brand); font-weight: 600; }
.prose blockquote {
    margin: var(--sp-6) 0; padding: var(--sp-5) var(--sp-6);
    background: var(--teal-50); border-left: 3px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: var(--step-1); font-family: var(--font-display); color: var(--teal-800);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: var(--sp-6) 0; font-size: .94rem; }
.prose th, .prose td { padding: .7rem .9rem; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--teal-50); color: var(--teal-800); font-weight: 600; }

.c-figure { margin: var(--sp-6) 0; }
.c-figure img {
    width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-sm);
    background: var(--sand-100);
}
.c-figure figcaption {
    margin-top: var(--sp-2); font-size: .85rem; color: var(--ink-50); text-align: center;
}

/* ---------------------------------------------------------------- 10. blog */
.post-grid {
    display: grid; gap: var(--sp-5);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 62rem) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .post-grid { grid-template-columns: 1fr; } }
.post-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
    text-decoration: none; color: inherit;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); color: inherit; }
.post-card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--teal-50); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: scale .5s var(--ease); }
.post-card:hover .post-card__media img { scale: 1.05; }
.post-card__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.post-card__meta {
    display: flex; align-items: center; gap: var(--sp-2);
    font-size: .78rem; color: var(--ink-50); text-transform: uppercase; letter-spacing: .06em;
}
.chip {
    display: inline-block; padding: .2rem .65rem; border-radius: 999px;
    background: var(--brand-100); color: var(--brand-700);
    font-size: .72rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
    text-decoration: none;
}
a.chip:hover { background: var(--brand); color: #fff; }
.post-card__title { margin: 0; font-size: var(--step-1); line-height: 1.24; }
.post-card__excerpt { margin: 0; font-size: .94rem; color: var(--ink-50); }

.pagination { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-7); }
.pagination a, .pagination span {
    min-width: 2.7rem; padding: .58rem .85rem; text-align: center;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--paper); color: var(--ink-70); text-decoration: none; font-size: .92rem;
    transition: border-color .18s, color .18s, background .18s;
}
.pagination a:hover { border-color: var(--brand-200); color: var(--brand-600); }
.pagination .is-current { background: var(--teal-800); border-color: var(--teal-800); color: #fff; font-weight: 600; }

.post-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
    font-size: .88rem; color: var(--ink-50); margin-bottom: var(--sp-5);
}

/* -------------------------------------------------------------- 11. formulario */
.form { display: grid; gap: var(--sp-4); }
.form__row { display: grid; gap: var(--sp-4); }
@media (min-width: 40rem) { .form__row--2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: var(--sp-2); }
.field label { font-size: .88rem; font-weight: 600; color: var(--teal-800); }
.field input, .field textarea, .field select {
    width: 100%; padding: .85rem 1rem;
    font: inherit; font-size: .98rem; color: var(--ink);
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
    transition: border-color .18s, box-shadow .18s;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--brand-400);
    box-shadow: 0 0 0 3px var(--brand-100);
}
.field--check { grid-template-columns: auto 1fr; align-items: start; gap: var(--sp-3); }
.field--check input { width: 1.1rem; height: 1.1rem; margin-top: .3rem; accent-color: var(--brand); }
.field--check label { font-weight: 400; font-size: .86rem; color: var(--ink-50); line-height: 1.5; }
.hp { position: absolute; left: -9999px; }

.alert {
    padding: var(--sp-4) var(--sp-5); border-radius: var(--radius);
    border: 1px solid; margin-bottom: var(--sp-5);
}
.alert--ok { background: var(--teal-50); border-color: var(--teal-300); color: var(--teal-800); }
.alert--error { background: var(--brand-100); border-color: var(--brand-200); color: var(--brand-700); }

.contact-grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
@media (min-width: 56rem) { .contact-grid { grid-template-columns: 1.15fr .85fr; } }
.contact-card {
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.25rem);
    box-shadow: var(--shadow-sm);
}
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); }
.contact-list li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.contact-list svg { width: 20px; height: 20px; flex: none; color: var(--brand); margin-top: .2rem; }
.contact-list a { color: var(--teal-800); text-decoration: none; font-weight: 600; }
.contact-list a:hover { color: var(--brand-600); }
.contact-list span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-50); }

/* ------------------------------------------------------------------ 12. pie */
.site-footer {
    background:
        radial-gradient(60rem 28rem at 88% 0%, rgba(231, 94, 14, .16), transparent 62%),
        radial-gradient(52rem 26rem at 4% 12%, rgba(46, 134, 123, .18), transparent 60%),
        var(--teal-950);
    color: rgba(255, 255, 255, .7);
    margin-top: var(--sp-9);
}
.footer-top { padding-block: clamp(3.25rem, 6.5vw, 5rem); }
.footer-grid {
    display: grid; gap: var(--sp-7);
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.footer-brand { max-width: 22rem; }
.footer-brand .brand__logo { height: 46px; }
.footer-brand p { margin: var(--sp-4) 0 0; font-size: .92rem; line-height: 1.6; }
.footer-title {
    font-family: var(--font-sans); font-size: .72rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase; color: var(--brand-400);
    margin: 0 0 var(--sp-4);
}
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.footer-list a {
    color: rgba(255, 255, 255, .7); text-decoration: none; font-size: .92rem;
    transition: color .18s;
}
.footer-list a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding-block: var(--sp-5);
    display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; justify-content: space-between;
    font-size: .85rem;
}
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: var(--sp-4); list-style: none; margin: 0; padding: 0; }
.footer-bottom a { color: rgba(255, 255, 255, .55); text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* botón flotante de llamada (móvil) */
.call-fab {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 90;
    display: none; align-items: center; gap: .5rem;
    padding: .9rem 1.3rem; border-radius: 999px;
    background: var(--brand); color: #fff; text-decoration: none;
    font-weight: 600; box-shadow: 0 10px 30px -8px rgba(231, 94, 14, .8);
}
.call-fab svg { width: 18px; height: 18px; }

/* -------------------------------------------- 12b. movimiento y micro-detalle */

/* aparición al entrar en pantalla */
/* Aparición al entrar en pantalla.
   El estado normal del elemento es VISIBLE: nunca se parte de opacity 0.
   La animación solo se dispara al añadir .is-in, así que si el JavaScript
   falla, no se carga o el observador no llega a ejecutarse, el contenido
   se ve igual. Un efecto decorativo no puede esconder texto. */
.js [data-reveal].is-in {
    animation: aparecer .55s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 55ms);
}
/* El fotograma inicial NO toca la opacidad a propósito: si el navegador
   congela la animación (pestaña en segundo plano, ventana sin pintar), el
   peor caso es un texto desplazado 18px, nunca un texto invisible. */
@keyframes aparecer {
    from { transform: translateY(18px); }
    to   { transform: none; }
}

/* foco luminoso que sigue al cursor sobre las tarjetas */
[data-spotlight] { position: relative; }
[data-spotlight]::after {
    content: ""; position: absolute; inset: 0; z-index: 0;
    border-radius: inherit; pointer-events: none;
    opacity: 0; transition: opacity .3s var(--ease);
    background: radial-gradient(
        14rem circle at var(--mx, 50%) var(--my, 50%),
        rgba(231, 94, 14, .12), transparent 62%
    );
}
[data-spotlight]:hover::after { opacity: 1; }
[data-spotlight] > * { position: relative; z-index: 1; }

/* grano sutil sobre las superficies oscuras */
.hero::after,
.site-footer::before,
.cta-band::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    pointer-events: none; opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}
.hero::after { z-index: 2; }
.site-footer { position: relative; overflow: hidden; }
.site-footer > * { position: relative; z-index: 2; }

/* ------------------------------------------------------------- 13. responsive */
@media (max-width: 68rem) {
    .nav-toggle { display: grid; place-items: center; }
    .header-cta .btn { display: none; }
    .nav {
        position: fixed; inset: var(--header-h) 0 0; z-index: 99;
        background: var(--paper); overflow-y: auto;
        padding: var(--sp-5) 1.25rem var(--sp-9);
        transform: translateX(100%); transition: transform .3s var(--ease);
        visibility: hidden;
        --nav-fg: var(--ink-70);
        --nav-fg-strong: var(--teal-800);
        --nav-hover-bg: var(--teal-50);
    }
    .nav.is-open { transform: none; visibility: visible; }
    .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
    .nav__item { border-bottom: 1px solid var(--line); }
    .nav__link { padding: 1rem .5rem; font-size: 1.05rem; justify-content: space-between; }
    .nav__item.is-current > .nav__link::after { content: none; }
    .nav__panel {
        position: static; opacity: 1; visibility: visible; transform: none;
        border: 0; box-shadow: none; padding: 0 0 var(--sp-3) var(--sp-4);
        min-width: 0; display: none; flex-direction: column; gap: var(--sp-4);
    }
    .nav__item.is-expanded > .nav__panel { display: flex; }
    .nav__panel--mega { min-width: 0; }
    .call-fab { display: inline-flex; }
    body.nav-open { overflow: hidden; }
}

@media (max-width: 48rem) {
    .header-bar { gap: var(--sp-3); }
    .header-cta { gap: var(--sp-2); }
    .brand__logo { height: 34px; }
    .header-phone span { display: none; }
    .header-phone {
        width: 40px; height: 40px; justify-content: center;
        border: 1px solid var(--line); border-radius: 12px;
    }
    .site-header--overlay:not(.is-stuck) .header-phone { border-color: rgba(255, 255, 255, .4); }
    .hero { min-height: min(88svh, 44rem); }
    .hero__scroll { display: none; }
}

@media (max-width: 40rem) {
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: var(--sp-3); }
    .pcard { padding: var(--sp-4) var(--sp-2); }
    .pcard__icon { width: 46px; height: 46px; padding: 10px; }
    .pcard__label { font-size: .84rem; }
    .cta-band { border-radius: var(--radius); }
    .hero__actions .btn { width: 100%; justify-content: center; }
    /* los indicadores se estrechan para que quepa el contador */
    .hero__controls { gap: var(--sp-4); }
    .hero__dots { gap: 6px; }
    .hero__dot { width: 24px; }
    .hero__dot.is-active { width: 38px; }
    .hero__count { font-size: .76rem; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important; animation-iteration-count: 1 !important;
        transition-duration: .01ms !important; scroll-behavior: auto !important;
    }
    .js [data-reveal].is-in { animation: none; }
    .hero__media img { transform: none; }
}

/* ------------------------------------------------------------- 14. impresión */
@media print {
    .site-header, .site-footer, .toc, .call-fab, .cta-band, .hero { display: none !important; }
    body { background: #fff; }
    .prose { max-width: none; }
}

/* ----------------------------------------------------------- 15. cookies */
.cookies {
    position: fixed; inset: auto 0 0 0; z-index: 150;
    padding: var(--sp-4);
    animation: cookiesIn .4s var(--ease) both;
}
.cookies[hidden] { display: none; }
.cookies__box {
    width: min(100%, var(--wrap)); margin-inline: auto;
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: var(--sp-5);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--sp-4);
}
.cookies__title {
    margin: 0 0 var(--sp-1);
    font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
    color: var(--teal-900);
}
.cookies__text { margin: 0; font-size: .88rem; color: var(--ink-50); max-width: 62ch; line-height: 1.55; }
.cookies__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); flex: none; }
@keyframes cookiesIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 40rem) {
    .cookies__box { flex-direction: column; align-items: stretch; }
    .cookies__actions .btn { flex: 1; justify-content: center; }
}

/* <picture> solo aporta la fuente WebP: no debe alterar el layout */
picture { display: contents; }

/* buscador del blog */
.blog-buscador {
    display: flex; align-items: center; gap: var(--sp-3);
    background: var(--paper); border: 1px solid var(--line);
    border-radius: 999px; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-5);
    margin-bottom: var(--sp-6); max-width: 34rem;
    box-shadow: var(--shadow-sm);
    transition: border-color .2s, box-shadow .2s;
}
.blog-buscador:focus-within { border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-100); }
.blog-buscador svg { color: var(--ink-25); flex: none; }
.blog-buscador input {
    flex: 1; min-width: 0; border: 0; background: none; padding: .4rem 0;
    font: inherit; font-size: .96rem; color: var(--ink);
}
.blog-buscador input:focus { outline: none; }
.blog-buscador__limpiar { font-size: .82rem; color: var(--ink-50); white-space: nowrap; padding-right: var(--sp-3); }
@media (max-width: 34rem) {
    .blog-buscador { flex-wrap: wrap; border-radius: var(--radius); padding: var(--sp-3); }
    .blog-buscador input { flex: 1 1 60%; }
}

/* ------------------------------------ 16. franja de atención bajo el hero */
.franja {
    position: relative;
    z-index: 5;
    margin-top: -2rem;
    padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.franja__caja {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: clamp(1.5rem, 3.5vw, 2.5rem) clamp(1.5rem, 4vw, 3rem);
    display: grid;
    gap: clamp(1.25rem, 3vw, 3rem);
    align-items: center;
}
@media (min-width: 58rem) {
    .franja__caja { grid-template-columns: 1.15fr auto; }
    /* separador entre el mensaje y el teléfono */
    .franja__accion { border-left: 1px solid var(--line); padding-left: clamp(1.5rem, 3vw, 3rem); }
}
.franja__texto { max-width: none; }
.franja__texto > *:last-child { margin-bottom: 0; }
.franja__texto h2 {
    font-size: var(--step-2);
    margin: 0 0 var(--sp-2);
    padding-top: 0;
    max-width: 26ch;
}
.franja__texto h2::before { content: none; }   /* sin la raya, aquí sobra */
.franja__texto p { margin: 0; color: var(--ink-50); font-size: .96rem; }
.franja__accion .phone-inline { margin: 0; flex-direction: column; align-items: flex-start; gap: var(--sp-1); }
.franja__accion .phone-inline a { font-size: var(--step-3); }

/* =========================================================================
   17. Movimiento
   Todo lo de esta sección es decorativo y se apaga entero con
   prefers-reduced-motion (al final del archivo). Nada de lo que hay aquí
   es necesario para leer o navegar.
   ========================================================================= */

/* ---- transición entre páginas -------------------------------------------
   Con la API de View Transitions el paso de una página a otra se funde en
   vez de parpadear. Los navegadores que no la soportan navegan como siempre. */
@view-transition { navigation: auto; }

::view-transition-old(root) {
    animation: salidaPagina .28s cubic-bezier(.4, 0, 1, 1) both;
}
::view-transition-new(root) {
    animation: entradaPagina .42s cubic-bezier(0, 0, .2, 1) both;
}
@keyframes salidaPagina  { to   { opacity: 0; transform: translateY(-6px); } }
@keyframes entradaPagina { from { opacity: 0; transform: translateY(10px); } }

/* la cabecera y el pie no se mueven: dan sensación de continuidad */
.site-header { view-transition-name: cabecera; }
.site-footer { view-transition-name: pie; }

/* ---- paralaje del hero --------------------------------------------------
   La foto se desplaza un poco más despacio que el scroll. Se usa animación
   ligada al scroll: la calcula el compositor, sin JavaScript. */
/* Paralaje del hero: lo aplica site.js sobre esta variable. Si el JS no
   llega a ejecutarse, la foto se queda quieta y centrada, que es correcto. */
.hero__slide.is-active .hero__media img {
    transform: translateY(var(--paralaje, 0)) scale(1.035);
}

/* ---- barra de progreso de lectura --------------------------------------- */
.progreso {
    position: fixed; top: 0; left: 0; right: 0; z-index: 120;
    height: 3px; background: transparent; pointer-events: none;
}
.progreso__barra {
    height: 100%; width: 100%; transform-origin: left; transform: scaleX(0);
    background: linear-gradient(90deg, var(--brand), var(--brand-400));
}
/* El relleno lo mueve site.js: las animaciones ligadas al scroll todavía
   fallan en algunos navegadores (se enganchan pero no avanzan). */
.progreso__barra { transition: transform .08s linear; }

/* ---- tarjetas con relieve ------------------------------------------------
   Inclinación muy leve siguiendo al cursor (las variables las pone el JS). */
@media (hover: hover) and (pointer: fine) {
    .tcard, .post-card {
        transform: perspective(900px)
                   rotateX(var(--rx, 0deg))
                   rotateY(var(--ry, 0deg))
                   translateY(var(--ty, 0));
        transform-style: preserve-3d;
        will-change: transform;
    }
    .tcard:hover, .post-card:hover { --ty: -5px; }
}

/* ---- destello al pasar por encima de las tarjetas de servicio ---------- */
.tcard__media { position: relative; }
.tcard__media::after {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.28) 50%, transparent 62%);
    transform: translateX(-100%);
    transition: transform .8s var(--ease);
}
.tcard:hover .tcard__media::after { transform: translateX(100%); }

/* ---- aurora en movimiento sobre la banda de contacto ------------------- */
.cta-band::after { animation: aurora 14s ease-in-out infinite alternate; }
@keyframes aurora {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-12%, -8%) scale(1.25); }
}

/* ---- subrayado que crece en los enlaces del contenido ------------------ */
.prose p > a, .prose li > a {
    text-decoration: none;
    background-image: linear-gradient(var(--brand), var(--brand));
    background-size: 0% 1.5px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    box-shadow: inset 0 -1.5px 0 var(--teal-100);
    transition: background-size .35s var(--ease), color .2s;
}
.prose p > a:hover, .prose li > a:hover { background-size: 100% 1.5px; color: var(--brand-700); }

/* ---- respeto por quien pide menos movimiento ---------------------------
   Va al final a propósito: anula todo lo decorativo de la sección 17,
   que se añadió después del primer bloque de prefers-reduced-motion. */
@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    ::view-transition-old(root),
    ::view-transition-new(root) { animation: none; }

    .cta-band::after { animation: none !important; }
    .progreso__barra { transition: none; }
    .hero__slide.is-active .hero__media img { transform: none; }
    .progreso { display: none; }
    .tcard, .post-card { transform: none !important; }
    .tcard__media::after { display: none; }
    .prose p > a, .prose li > a { transition: none; }
}

/* ------------------------------------------ 17. botón de contacto flotante */
/* Presente en todas las páginas. Cerrado es la marca del centro; abierto
   despliega WhatsApp, llamada y el formulario. La altura del aviso de cookies
   la mide el JS y la deja en --acciones-abajo para que no se solapen. */
.acciones {
    position: fixed; z-index: 160;
    right: clamp(var(--sp-4), 3vw, var(--sp-6));
    bottom: calc(var(--acciones-abajo, 0px) + clamp(var(--sp-4), 3vw, var(--sp-6)));
    display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-3);
}

/* --- lanzador --- */
.acciones__lanzador {
    position: relative;
    width: 3.75rem; height: 3.75rem;
    border: 0; border-radius: 50%; cursor: pointer;
    background: var(--brand); color: #fff;
    box-shadow: 0 6px 18px rgba(231, 94, 14, .34), var(--shadow);
    display: grid; place-items: center;
    transition: transform .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease);
}
.acciones__lanzador:hover { transform: translateY(-2px) scale(1.04); background: var(--brand-600); }
.acciones__lanzador:active { transform: translateY(0) scale(.98); }
.acciones__lanzador:focus-visible { outline: 3px solid var(--teal-800); outline-offset: 3px; }

.acciones__marca,
.acciones__cerrar {
    grid-area: 1 / 1;
    transition: opacity .2s var(--ease), transform .28s var(--ease);
}
.acciones__marca { display: grid; place-items: center; }
.acciones__marca img { display: block; width: 2.125rem; height: 2.125rem; }
.acciones__cerrar { opacity: 0; transform: rotate(-45deg) scale(.7); }

.acciones.is-open .acciones__marca { opacity: 0; transform: rotate(45deg) scale(.7); }
.acciones.is-open .acciones__cerrar { opacity: 1; transform: none; }

/* pulso suave para que se note la primera vez */
.acciones__lanzador::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--brand);
    animation: accionesPulso 2.8s var(--ease) infinite;
}
.acciones.is-open .acciones__lanzador::after { animation: none; opacity: 0; }
@keyframes accionesPulso {
    0%   { opacity: .55; transform: scale(1); }
    70%  { opacity: 0;   transform: scale(1.5); }
    100% { opacity: 0;   transform: scale(1.5); }
}

/* --- menú desplegable --- */
.acciones__menu {
    display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-2);
}
.acciones__menu[hidden] { display: none; }

.acciones__item {
    display: inline-flex; align-items: center; gap: var(--sp-3);
    border: 0; background: none; padding: 0; cursor: pointer;
    text-decoration: none; color: inherit;
    animation: accionesEntra .32s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 45ms);
}
.acciones__etiqueta {
    background: var(--paper); color: var(--ink);
    border: 1px solid var(--line); border-radius: 999px;
    padding: .44rem .8rem;
    font-size: .84rem; font-weight: 600; white-space: nowrap;
    box-shadow: var(--shadow-sm);
}
.acciones__icono {
    width: 2.875rem; height: 2.875rem; border-radius: 50%;
    display: grid; place-items: center; color: #fff;
    box-shadow: var(--shadow);
    transition: transform .2s var(--ease);
}
.acciones__item:hover .acciones__icono { transform: scale(1.08); }
.acciones__item:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 999px; }

.acciones__item--wa   .acciones__icono { background: #25D366; }
.acciones__item--tel  .acciones__icono { background: var(--brand); }
.acciones__item--form .acciones__icono { background: var(--teal-800); }

@keyframes accionesEntra {
    from { opacity: 0; transform: translateY(10px) scale(.94); }
    to   { opacity: 1; transform: none; }
}

/* --- panel del formulario --- */
.acciones-panel { position: fixed; inset: 0; z-index: 200; }
.acciones-panel[hidden] { display: none; }
.acciones-panel__fondo {
    position: absolute; inset: 0;
    background: rgba(8, 33, 31, .45);
    backdrop-filter: blur(2px);
    animation: accionesFundido .25s var(--ease) both;
}
.acciones-panel__caja {
    position: absolute;
    right: clamp(var(--sp-4), 3vw, var(--sp-6));
    bottom: calc(var(--acciones-abajo, 0px) + 5.75rem);
    width: min(24rem, calc(100vw - 2 * var(--sp-4)));
    /* nunca debe tocar el borde de arriba: se descuenta lo que el aviso de
       cookies haya empujado el panel hacia arriba */
    max-height: min(32rem, calc(100vh - var(--acciones-abajo, 0px) - 9rem));
    overflow-y: auto;
    background: var(--paper); border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-5);
    animation: accionesPanel .3s var(--ease) both;
}
.acciones-panel__caja h2 { margin: 0 0 var(--sp-2); font-size: var(--step-1); }
.acciones-panel__lede { margin: 0 0 var(--sp-4); font-size: .9rem; color: var(--ink-50); }
.acciones-panel__x {
    position: absolute; top: var(--sp-3); right: var(--sp-3);
    width: 2rem; height: 2rem; border-radius: 50%;
    border: 0; cursor: pointer; display: grid; place-items: center;
    background: var(--sand-100); color: var(--ink-70);
}
.acciones-panel__x:hover { background: var(--sand-200); }
.form--compacto .field { margin-bottom: var(--sp-3); }
.form--compacto .btn { width: 100%; justify-content: center; }

@keyframes accionesFundido { from { opacity: 0; } to { opacity: 1; } }
@keyframes accionesPanel {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* En pantallas estrechas o bajas deja de ser un globo junto al botón y pasa a
   ser una hoja pegada abajo, que es lo que se espera en un móvil. */
@media (max-width: 34rem), (max-height: 40rem) {
    .acciones-panel__caja {
        right: var(--sp-3); left: var(--sp-3);
        bottom: var(--sp-3);
        width: auto; max-height: calc(100vh - 3rem);
    }
}

/* Nada de esto es imprescindible: si se pide menos movimiento, aparece y ya. */
@media (prefers-reduced-motion: reduce) {
    .acciones__item,
    .acciones-panel__fondo,
    .acciones-panel__caja { animation: none; }
    .acciones__lanzador::after { animation: none; opacity: 0; }
    .acciones__lanzador,
    .acciones__icono,
    .acciones__marca,
    .acciones__cerrar { transition: none; }
}

@media print { .acciones, .acciones-panel { display: none !important; } }

/* --------------------------------------------- 18. tests de autoevaluación */
.test__meta { color: var(--ink-50); font-size: .88rem; margin: var(--sp-2) 0 0; }
.test, .test-lista, .test-res { padding-block: var(--sp-7) var(--sp-8); }

.test__disclaimer {
    background: var(--teal-50); border-left: 4px solid var(--teal-500);
    border-radius: var(--radius-sm);
    padding: var(--sp-4) var(--sp-5); margin: 0 0 var(--sp-6);
    font-size: .92rem; line-height: 1.6; color: var(--ink-70);
}
.test__fuente { color: var(--ink-25); font-size: .78rem; line-height: 1.6; margin-top: var(--sp-6); }

/* --- listado --- */
.test-tarjeta {
    display: flex; align-items: center; gap: var(--sp-4);
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: var(--sp-5); margin-bottom: var(--sp-4);
    text-decoration: none; color: inherit;
    box-shadow: var(--shadow-sm);
    transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.test-tarjeta:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-200); }
.test-tarjeta h2 { margin: 0 0 var(--sp-2); font-size: var(--step-1); }
.test-tarjeta p { margin: 0; color: var(--ink-50); font-size: .95rem; line-height: 1.6; }
.test-tarjeta__meta { margin-top: var(--sp-2) !important; font-size: .82rem !important; color: var(--ink-25) !important; }
.test-tarjeta__flecha {
    flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%;
    background: var(--brand-100); color: var(--brand);
    display: grid; place-items: center;
    transition: background-color .22s var(--ease), transform .22s var(--ease);
}
.test-tarjeta:hover .test-tarjeta__flecha { background: var(--brand); color: #fff; transform: translateX(3px); }

/* --- cuestionario --- */
.test__enunciado {
    font-size: var(--step-1); font-family: var(--font-display);
    color: var(--teal-800); margin: 0 0 var(--sp-5); line-height: 1.45;
}
.test__barra { height: 6px; background: var(--sand-200); border-radius: 3px; overflow: hidden; margin-bottom: var(--sp-3); }
.test__barra-relleno {
    height: 100%; width: 0; background: var(--brand); border-radius: 3px;
    transition: width .35s var(--ease);
}
.test__contador { font-size: .84rem; color: var(--ink-50); margin: 0 0 var(--sp-5); font-weight: 600; }

.test__pregunta { border: 0; padding: 0; margin: 0 0 var(--sp-6); }
.test__pregunta legend {
    display: flex; gap: var(--sp-3); align-items: baseline;
    font-size: var(--step-0); font-weight: 600; color: var(--ink);
    margin-bottom: var(--sp-4); line-height: 1.5; padding: 0;
}
.test__numero {
    flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%;
    background: var(--teal-800); color: #fff;
    display: inline-grid; place-items: center;
    font-size: .8rem; font-weight: 700;
}
.test__opciones { display: grid; gap: var(--sp-2); }
.test__opcion {
    display: flex; align-items: center; gap: var(--sp-3);
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    padding: var(--sp-3) var(--sp-4); cursor: pointer;
    font-size: .95rem;
    transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.test__opcion:hover { border-color: var(--brand-200); background: var(--brand-100); }
.test__opcion input { accent-color: var(--brand); width: 1.1rem; height: 1.1rem; flex: none; }
.test__opcion:has(input:checked) { border-color: var(--brand); background: var(--brand-100); }
.test__opcion:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }

.test__pie { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
/* .btn trae su propio display, que gana al atributo hidden si no se dice esto */
.test__pie .btn[hidden], .test__barra[hidden], .test__contador[hidden] { display: none; }

/* Con JS solo se ve una pregunta cada vez. Sin JS salen todas y funciona igual. */
.js .test__form[data-paso] .test__pregunta { display: none; }
.js .test__form[data-paso] .test__pregunta.is-actual { display: block; animation: testEntra .3s var(--ease) both; }
@keyframes testEntra {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: none; }
}

/* --- termómetro --- */
.termo {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: var(--sp-6); box-shadow: var(--shadow-sm); text-align: center;
    margin-bottom: var(--sp-5);
}
.termo__nivel {
    margin: 0; font-family: var(--font-display); font-size: var(--step-3);
    line-height: 1.15; color: var(--teal-800);
}
.termo__puntos { margin: var(--sp-1) 0 var(--sp-5); font-size: var(--step-2); font-weight: 700; color: var(--brand); }
.termo__puntos span { font-size: .55em; font-weight: 500; color: var(--ink-25); }

.termo__escala { position: relative; padding-bottom: var(--sp-4); }
.termo__pista { display: flex; gap: 3px; height: 14px; }
.termo__zona { border-radius: 7px; opacity: .3; }
.termo__zona--ok    { background: var(--teal-500); }
.termo__zona--leve  { background: #C98A1E; }
.termo__zona--medio { background: var(--brand); }
.termo__zona--alto  { background: #B23A2B; }
.termo--ok    .termo__zona--ok,
.termo--leve  .termo__zona--leve,
.termo--medio .termo__zona--medio,
.termo--alto  .termo__zona--alto { opacity: 1; }

.termo__aguja { position: absolute; top: -6px; transform: translateX(-50%); transition: left .6s var(--ease); }
.termo__aguja-punto {
    display: block; width: 1.6rem; height: 1.6rem; border-radius: 50%;
    background: var(--paper); border: 4px solid var(--teal-900);
    box-shadow: var(--shadow);
}
.termo__leyenda {
    list-style: none; margin: var(--sp-3) 0 0; padding: 0;
    display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); justify-content: center;
    font-size: .8rem; color: var(--ink-25);
}
.termo__leyenda-item { display: inline-flex; align-items: center; gap: var(--sp-2); }
.termo__leyenda-item.is-activo { color: var(--ink); font-weight: 700; }
.termo__punto { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }
.termo__punto--ok { background: var(--teal-500); }
.termo__punto--leve { background: #C98A1E; }
.termo__punto--medio { background: var(--brand); }
.termo__punto--alto { background: #B23A2B; }
.termo__texto { margin: var(--sp-5) 0 0; font-size: var(--step-0); line-height: 1.65; color: var(--ink-70); }

/* --- aviso de ayuda: tiene que verse antes que nada --- */
.test-ayuda {
    background: #FBEDEB; border: 1px solid #E8BDB6; border-left: 5px solid #B23A2B;
    border-radius: var(--radius); padding: var(--sp-5); margin-bottom: var(--sp-5);
}
.test-ayuda h2 { margin: 0 0 var(--sp-3); font-size: var(--step-1); color: #8F2A1E; }
.test-ayuda p { margin: 0 0 var(--sp-3); line-height: 1.65; }
.test-ayuda__lista { margin: 0; padding-left: 1.1rem; line-height: 2; font-size: .95rem; }

/* --- por áreas --- */
.test-areas { margin-bottom: var(--sp-6); }
.test-areas h2, .test-lead h2, .test-cierre h2 { font-size: var(--step-1); margin: 0 0 var(--sp-4); }
.area { margin-bottom: var(--sp-5); }
.area__cab { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.area__nombre { font-weight: 600; }
.area__nivel { font-size: .85rem; color: var(--ink-50); }
.area__barra { height: 9px; background: var(--sand-200); border-radius: 5px; overflow: hidden; }
.area__relleno { height: 100%; background: var(--brand); border-radius: 5px; animation: areaCrece .8s var(--ease) both; }
@keyframes areaCrece { from { width: 0; } }
.area__texto { margin: var(--sp-2) 0 0; font-size: .9rem; color: var(--ink-50); line-height: 1.6; }

/* --- captación --- */
.test-lead {
    background: var(--sand-50); border: 1px solid var(--line); border-radius: var(--radius);
    padding: var(--sp-6); margin-bottom: var(--sp-6);
}
.test-lead--ok { background: var(--teal-50); border-color: var(--teal-100); }
.test-lead__lede { margin: 0 0 var(--sp-5); color: var(--ink-50); }
.test-lead__nota { margin: var(--sp-4) 0 0; font-size: .8rem; color: var(--ink-25); line-height: 1.6; }
.field__opcional { color: var(--ink-25); font-weight: 400; }
.test-cierre p { line-height: 1.7; color: var(--ink-70); }

@media (prefers-reduced-motion: reduce) {
    .test__pregunta.is-actual, .area__relleno { animation: none; }
    .termo__aguja, .test__barra-relleno { transition: none; }
}

/* Invitación al test desde las páginas de problemas y tratamientos. Discreta
   a propósito: no es otra llamada a la acción más, es una ayuda. */
.test-invita {
    display: flex; align-items: flex-start; gap: var(--sp-4);
    background: var(--teal-50); border: 1px solid var(--teal-100);
    border-radius: var(--radius); padding: var(--sp-5);
    margin: var(--sp-7) 0 0;
    text-decoration: none; color: inherit;
    transition: border-color .22s var(--ease), transform .22s var(--ease);
}
.test-invita:hover { border-color: var(--teal-300); transform: translateY(-2px); }
.test-invita__icono {
    flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%;
    background: var(--teal-800); color: #fff; display: grid; place-items: center;
}
.test-invita__texto { font-size: .95rem; line-height: 1.6; color: var(--ink-70); }
.test-invita__texto strong { display: block; color: var(--teal-800); font-size: var(--step-0); margin-bottom: var(--sp-1); }
.test-invita__flecha {
    flex: none; margin-left: auto; align-self: center;
    width: 2rem; height: 2rem; border-radius: 50%;
    background: var(--paper); color: var(--teal-800);
    display: grid; place-items: center;
    transition: transform .22s var(--ease);
}
.test-invita:hover .test-invita__flecha { transform: translateX(3px); }
@media (max-width: 34rem) {
    .test-invita { flex-wrap: wrap; }
    .test-invita__flecha { display: none; }
}
