/* ==========================================================================
   Úraga · Sistema visual v2
   Referencia: Instituto Médico Ricart. Heros a pantalla completa, dos voces
   tipográficas, barra de pestañas bajo el hero, paleta contenida.

   Tipografía: Cormorant Garamond (display) + Instrument Sans (todo lo demás)
   Color: crema cálido · tinta · marrón profundo · un hilo de dorado Úraga
   ========================================================================== */

:root {
  /* Color */
  --crema: #F4F2EB;
  --crema-2: #ECE8DE;
  --blanco: #FBFAF6;
  --tinta: #1A1714;
  --tinta-2: #3D3733;
  --cuerpo: #57504A;
  --mudo: #8A827A;
  --linea: #DED9CE;
  --linea-2: #CFC8BA;
  --marron: #4B3427;
  --marron-2: #5C3F2E;
  --oro: #B77A37;
  --oro-2: #96602A;

  /* Tipografía */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-base: 1.0625rem;
  --fs-lead: clamp(1.125rem, 1.05rem + .3vw, 1.3rem);
  --fs-h3: clamp(1.3rem, 1.15rem + .6vw, 1.7rem);
  --fs-h2-sans: clamp(1.9rem, 1.35rem + 1.9vw, 3.1rem);
  --fs-h2-serif: clamp(2.5rem, 1.6rem + 3vw, 4.4rem);
  --fs-hero: clamp(3rem, 1.8rem + 5.2vw, 6.6rem);
  --fs-hero-interior: clamp(2.8rem, 1.6rem + 4.6vw, 5.8rem);

  /* Espaciado */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem;
  --s6: 2rem; --s7: 3rem; --s8: 4rem; --s9: 6rem; --s10: 8rem;
  --gutter: clamp(1.25rem, .5rem + 4.6vw, 6rem);
  --shell: min(100% - (var(--gutter) * 2), 1700px);
  --section-y: clamp(4.5rem, 3rem + 5.5vw, 8rem);
  --header-h: 96px;

  /* Forma */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
  --sh-1: 0 2px 8px rgba(40, 28, 18, .05), 0 12px 32px rgba(40, 28, 18, .06);
  --sh-2: 0 4px 12px rgba(40, 28, 18, .07), 0 24px 56px rgba(40, 28, 18, .10);

  /* Movimiento */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }

/* Cormorant trae cifras antiguas (el 9 baja); en todo el sitio van alineadas. */
html { font-variant-numeric: lining-nums; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--crema);
  color: var(--tinta);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }

img, video { display: block; max-width: 100%; }
:where(a, a:visited) { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

section[id] { scroll-margin-top: calc(var(--header-h) + 56px); }
.shell { width: var(--shell); 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: fixed; z-index: 1000; top: var(--s3); left: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-sm);
  background: var(--tinta); color: var(--crema);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: translateY(0); }
:where(a, button):focus-visible { outline: 2px solid var(--marron); outline-offset: 3px; border-radius: var(--r-sm); }

/* ── Iconos ──────────────────────────────────────────────────────────────── */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.1em; height: 1.1em; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-xs { width: .95em; height: .95em; }
.icon-md { width: 1.5rem; height: 1.5rem; }
.icon-lg { width: 2rem; height: 2rem; }
.icon-xl { width: 4.75rem; height: 4.75rem; stroke-width: 1; }
/* Con el aro, el dibujo ocupa menos: el icono crece para leerse igual. */
.icon-especialidad { --icono-acento: var(--oro); width: 6rem; height: 6rem; stroke-width: 1.15; }

/* ── Tipografía ──────────────────────────────────────────────────────────── */
.serif { font-family: var(--font-display); font-weight: 500; letter-spacing: -.01em; }
.eyebrow {
  color: var(--mudo);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: .02em;
}
.h-serif {
  font-family: var(--font-display);
  font-size: var(--fs-h2-serif);
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.05;
  text-wrap: balance;
}
.h-sans {
  font-family: var(--font-sans);
  font-size: var(--fs-h2-sans);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.12;
  text-wrap: balance;
}
h3 { font-size: var(--fs-h3); letter-spacing: -.015em; line-height: 1.25; }
.lead { color: var(--cuerpo); font-size: var(--fs-lead); line-height: 1.65; }
.prose { color: var(--cuerpo); font-size: var(--fs-base); line-height: 1.7; }
.prose p + p { margin-top: 1.1em; }
.prose strong { color: var(--tinta); font-weight: 600; }

/* ── Botones ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s3);
  min-height: 54px;
  padding: var(--s3) var(--s6);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 220ms var(--ease-out), color 220ms var(--ease-out),
              border-color 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.btn .icon { transition: transform 220ms var(--ease-out); }
.btn:hover .icon, .btn:focus-visible .icon { transform: translateX(3px); }
.btn:hover, .btn:focus-visible { transform: translateY(-1px); }

.btn-crema { background: var(--crema); border-color: var(--crema); color: var(--tinta); }
.btn-crema:hover, .btn-crema:focus-visible { background: var(--blanco); }
.btn-borde { background: transparent; border-color: currentColor; color: inherit; }
.btn-borde:hover, .btn-borde:focus-visible { background: rgba(255, 255, 255, .12); }
.btn-marron { background: var(--marron); border-color: var(--marron); color: var(--crema); }
.btn-marron:hover, .btn-marron:focus-visible { background: var(--marron-2); border-color: var(--marron-2); }
.btn-tinta { background: transparent; border-color: var(--tinta); color: var(--tinta); }
.btn-tinta:hover, .btn-tinta:focus-visible { background: var(--tinta); color: var(--crema); }

.enlace {
  display: inline-flex; align-items: center; gap: var(--s2);
  color: var(--tinta);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
}
.enlace .icon { transition: transform 220ms var(--ease-out); }
.enlace:hover .icon, .enlace:focus-visible .icon { transform: translateX(4px); }

/* ══ HEADER ═══════════════════════════════════════════════════════════════
   Fijo y transparente sobre el hero, con texto en blanco. Al bajar se vuelve
   crema con texto oscuro. Los dos logos viven en el DOM y se alternan.
   ────────────────────────────────────────────────────────────────────── */
.site-header {
  position: fixed; z-index: 100; top: 0; left: 0; right: 0;
  height: var(--header-h);
  color: #fff;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 320ms var(--ease-out), color 320ms var(--ease-out),
              border-color 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}
.site-header.is-solid {
  color: var(--tinta);
  background: rgba(244, 242, 235, .96);
  border-bottom-color: var(--linea);
}
.header-inner {
  display: grid; align-items: center;
  width: var(--shell); height: 100%;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s6);
  margin-inline: auto;
}
/* Desde 1081px: botón de menú a la izquierda, logo al centro y cita a la
   derecha. Por debajo, logo a la izquierda y botón a la derecha. */
.brand { display: block; width: 118px; grid-column: 2; grid-row: 1; justify-self: center; }
.brand img { width: 100%; height: auto; }
.brand .logo-oscuro { display: none; }
.site-header.is-solid .logo-claro, .site-header.menu-abierto .logo-claro { display: none; }
.site-header.is-solid .logo-oscuro, .site-header.menu-abierto .logo-oscuro { display: block; }
.site-header.menu-abierto { color: var(--tinta); background: var(--crema); border-bottom-color: var(--linea); }

.header-actions { display: contents; }
.btn-header {
  grid-column: 3; grid-row: 1; justify-self: end;
  min-height: 46px; padding-inline: var(--s5);
  background: transparent; border-color: currentColor; color: inherit;
  font-size: var(--fs-sm);
}
.btn-header:hover, .btn-header:focus-visible { background: rgba(255, 255, 255, .14); }
.site-header.is-solid .btn-header:hover, .site-header.is-solid .btn-header:focus-visible,
.site-header.menu-abierto .btn-header:hover, .site-header.menu-abierto .btn-header:focus-visible { background: var(--tinta); color: var(--crema); }

.menu-toggle {
  grid-column: 1; grid-row: 1; justify-self: start;
  display: inline-grid; grid-template-columns: 18px auto; align-content: center; align-items: center; gap: 6px var(--s3);
  height: 46px; padding: 0 var(--s5) 0 var(--s4);
  border: 1px solid currentColor; border-radius: var(--r-pill);
  background: transparent; color: inherit; cursor: pointer;
  font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 500; line-height: 1;
  transition: background 220ms var(--ease-out), color 220ms var(--ease-out);
}
.menu-toggle span { grid-column: 1; display: block; width: 18px; height: 1.5px; background: currentColor; transition: transform 220ms var(--ease-out); }
.menu-toggle[aria-expanded="true"] span:first-of-type { transform: translateY(3.75px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-of-type { transform: translateY(-3.75px) rotate(-45deg); }
.menu-toggle b { grid-column: 2; grid-row: 1 / span 2; font-weight: inherit; }
.menu-toggle b::after { content: "Menú"; }
.menu-toggle[aria-expanded="true"] b::after { content: "Cerrar"; }
/* Solo con ratón: en táctil el hover se queda pegado tras el toque. */
@media (hover: hover) {
  .menu-toggle:hover { background: rgba(255, 255, 255, .14); }
  .site-header.is-solid .menu-toggle:hover, .site-header.menu-abierto .menu-toggle:hover { background: var(--tinta); color: var(--crema); }
}

/* ══ MENÚ ═════════════════════════════════════════════════════════════════
   Un solo panel para todas las pantallas, siempre tras el botón. En móvil es
   un acordeón; desde 1081px, la lista a la izquierda y las páginas de la
   entrada abierta a la derecha.
   ────────────────────────────────────────────────────────────────────── */
.mobile-menu {
  position: fixed; z-index: 99; inset: var(--header-h) 0 0;
  display: flex; flex-direction: column;
  background: var(--crema); color: var(--tinta);
  animation: menu-entra 320ms var(--ease-out) both;
}
.mobile-menu[hidden] { display: none; }
@keyframes menu-entra { from { opacity: 0; transform: translateY(-10px); } }
.mm-nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--s3) var(--gutter) var(--s6); }
.mm-link, .mm-grupo > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  min-height: 60px; padding: var(--s3) 0;
  border-bottom: 1px solid var(--linea);
  font-family: var(--font-display); font-size: 1.65rem; font-weight: 500; line-height: 1.1;
  text-decoration: none; cursor: pointer; list-style: none;
}
.mm-grupo > summary::-webkit-details-marker { display: none; }
.mm-grupo > summary .icon { width: 1.1rem; height: 1.1rem; color: var(--mudo); transition: transform 260ms var(--ease-out); }
.mm-grupo[open] > summary { border-bottom-color: transparent; }
.mm-grupo[open] > summary .icon { transform: rotate(180deg); color: var(--tinta); }
.mm-link .icon-xs { color: var(--mudo); }
.mm-link.is-activo, .mm-grupo.is-activo > summary { color: var(--marron); }
.mm-sub { display: grid; gap: var(--s4); padding: var(--s1) 0 var(--s5); border-bottom: 1px solid var(--linea); }
.mm-bloque { display: grid; }
.mm-sub-titulo { margin: 0 0 var(--s2); color: var(--mudo); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.mm-bloque a { display: block; padding: 9px 0; color: var(--tinta-2); font-size: var(--fs-base); text-decoration: none; }
.mm-bloque a:active, .mm-bloque a[aria-current="page"] { color: var(--marron); }
.mm-hub {
  display: inline-flex; align-items: center; gap: var(--s2); justify-self: start;
  min-height: 40px;
  color: var(--tinta); font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
}
.mm-hub .icon { transition: transform 220ms var(--ease-out); }
.mm-hub:hover .icon, .mm-hub:focus-visible .icon { transform: translateX(4px); }
.mm-pie {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--s3);
  padding: var(--s4) var(--gutter) calc(var(--s4) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--linea);
  background: var(--blanco);
  box-shadow: 0 -8px 24px rgba(40, 28, 18, .06);
}
.mm-cta, .mm-wa { width: 100%; justify-content: center; min-height: 52px; }
.mm-wa { border-color: var(--linea-2); background: transparent; color: var(--tinta); }
.mm-wa .icon { width: 1.05rem; height: 1.05rem; color: var(--marron); }

@media (min-width: 1081px) {
  .mm-nav {
    --mm-lista: min(34%, 26rem);
    --mm-arriba: clamp(var(--s4), 4.5vh, var(--s8));
    position: relative;
    padding: var(--mm-arriba) var(--gutter) var(--s4);
  }
  .mm-link, .mm-grupo > summary {
    width: var(--mm-lista);
    min-height: clamp(28px, 5.3vh, 56px); padding: 0 var(--s5) 0 0;
    border-bottom: 0;
    font-size: clamp(1.3rem, 3.6vh, 2rem);
    color: var(--tinta-2);
    transition: color 180ms ease;
  }
  .mm-link:hover, .mm-link:focus-visible, .mm-grupo > summary:hover, .mm-grupo[open] > summary { color: var(--marron); }
  .mm-link { justify-content: flex-start; }
  .mm-grupo > summary .icon { transform: rotate(-90deg); width: .9rem; height: .9rem; }
  .mm-grupo[open] > summary .icon { transform: rotate(-90deg) translateY(4px); color: var(--marron); }
  .mm-sub {
    position: absolute; top: var(--mm-arriba); bottom: var(--s4);
    left: calc(var(--gutter) + var(--mm-lista)); right: var(--gutter);
    display: flex; flex-wrap: wrap; align-content: flex-start; gap: var(--s4) var(--s8);
    padding: var(--s2) 0 0 var(--s8);
    border-bottom: 0; border-left: 1px solid var(--linea);
    animation: sub-entra 260ms var(--ease-out) both;
  }
  .mm-hub { flex: 0 0 100%; font-size: var(--fs-base); }
  .mm-bloque { min-width: 14rem; align-content: start; }
  .mm-bloque a { padding: 7px 0; transition: color 160ms ease, padding-left 160ms var(--ease-out); }
  .mm-bloque a:hover, .mm-bloque a:focus-visible { color: var(--marron); padding-left: var(--s2); }
  .mm-pie { display: none; }
}
@keyframes sub-entra { from { opacity: 0; transform: translateX(-8px); } }

/* ══ HERO A PANTALLA COMPLETA ═════════════════════════════════════════════
   Foto o video de fondo, título abajo a la izquierda. La foto lleva un
   Ken Burns lento; si hay video y carga, se muestra encima y la foto queda
   de póster.
   ────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; align-items: end;
  min-height: 100svh;
  color: #fff;
  background: var(--marron);
}
.hero-interior { min-height: clamp(560px, 84svh, 900px); }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img, .hero-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--foco, 50% 40%);
}
.hero-media img { animation: kenburns 24s var(--ease-io) infinite alternate; }
.hero-media video { opacity: 0; transition: opacity 900ms ease; }
.hero-media.has-video video { opacity: 1; }
.hero-media.has-video img { animation: none; }
@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.09) translate(-1.2%, -1%); }
}
/* Fondo para páginas sin fotografía: cálido y con textura, no una foto ajena. */
.hero-media-vacio {
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 226, 190, .35), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(120, 78, 50, .55), transparent 50%),
    linear-gradient(160deg, #8A6448 0%, #5C3F2E 55%, #3E2A1F 100%);
}
.hero-media-vacio::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(255, 255, 255, .025) 22px 23px);
}
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(20, 14, 10, .32) 0%, transparent 28%),
    linear-gradient(90deg, rgba(20, 14, 10, .62) 0%, rgba(20, 14, 10, .28) 45%, transparent 75%),
    linear-gradient(0deg, rgba(20, 14, 10, .55) 0%, transparent 55%);
}
.hero-copy {
  width: var(--shell);
  margin-inline: auto;
  padding: calc(var(--header-h) + var(--s7)) 0 clamp(3rem, 7vh, 5.5rem);
}
.hero h1 {
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: .98;
  text-wrap: balance;
}
.hero-interior h1 { font-size: var(--fs-hero-interior); max-width: 16ch; }
.hero-sub {
  max-width: 52ch;
  margin-top: var(--s5);
  font-size: var(--fs-lead);
  line-height: 1.55;
  opacity: .96;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s6); }
.hero-nota {
  position: absolute; right: calc(var(--gutter) + 84px); bottom: var(--s6);
  padding: var(--s2) var(--s3);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .8;
}

/* Pantallas anchas y bajas (portátil de 1366×768 con el navegador al 100%):
   el título se mide también contra el alto, para que el hero completo quepa
   en la primera pantalla y nada quede debajo del header. */
@media (min-width: 1081px) and (max-height: 780px) {
  .hero-copy { padding: calc(var(--header-h) + var(--s5)) 0 var(--s6); }
  .hero h1 { max-width: 20ch; font-size: max(2.75rem, min(var(--fs-hero), 12.5svh)); }
  .hero-interior h1 { max-width: 22ch; font-size: max(2.6rem, min(var(--fs-hero-interior), 11.5svh)); }
  .hero-sub { margin-top: var(--s4); }
  .hero-actions { margin-top: var(--s5); }
}

/* Entrada del título: cada palabra sube y se posa. */
/* La máscara lleva aire arriba y abajo (compensado con margen negativo) para
   que tildes y descendentes no queden recortados por el overflow. */
.hero [data-split] .palabra { display: inline-block; overflow: hidden; vertical-align: top; padding: .16em .06em .1em; margin: -.16em -.06em -.1em; }
.hero [data-split] .palabra > span { display: inline-block; transform: translateY(110%); }
body.motion-ready .hero.is-in [data-split] .palabra > span {
  animation: subir 900ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms + 120ms);
}
body.motion-ready .hero .hero-sub, body.motion-ready .hero .hero-actions, body.motion-ready .hero .hero-nota {
  opacity: 0; transform: translateY(18px);
}
body.motion-ready .hero.is-in .hero-sub { animation: aparecer 800ms var(--ease-out) 520ms both; }
body.motion-ready .hero.is-in .hero-actions { animation: aparecer 800ms var(--ease-out) 660ms both; }
body.motion-ready .hero.is-in .hero-nota { animation: aparecer 800ms var(--ease-out) 900ms both; }
@keyframes subir { to { transform: translateY(0); } }
@keyframes aparecer { to { opacity: 1; transform: translateY(0); } }

/* ══ BARRA DE PESTAÑAS ════════════════════════════════════════════════════
   Debajo del hero de cada página interior. Cada pestaña salta a una sección
   y la activa se marca con fondo; el scroll la actualiza.
   ────────────────────────────────────────────────────────────────────── */
.subnav {
  position: sticky; z-index: 90; top: var(--header-h);
  display: flex;
  padding-inline: calc(var(--gutter) - var(--s4));
  border-bottom: 1px solid var(--linea);
  background: rgba(244, 242, 235, .88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.subnav a {
  position: relative;
  flex: 1 1 0;
  padding: var(--s5) var(--s4);
  color: var(--tinta-2);
  font-size: var(--fs-sm);
  font-weight: 400;
  letter-spacing: .01em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background 220ms var(--ease-out), color 220ms ease;
}
.subnav a:hover { color: var(--tinta); background: rgba(236, 232, 222, .55); }
.subnav a.is-active { background: var(--crema-2); color: var(--tinta); font-weight: 500; }

.migas {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  padding: var(--s6) 0 0;
  color: var(--mudo);
  font-size: var(--fs-sm);
}
.migas a { text-decoration: none; }
.migas a:hover { color: var(--tinta); }
.migas li + li::before { content: "/"; margin-right: var(--s2); opacity: .6; }

/* ══ SECCIONES ════════════════════════════════════════════════════════════ */
.seccion { padding: var(--section-y) 0; }
.seccion + .seccion { padding-top: 0; }
.seccion-titulo { margin-bottom: var(--s7); }
.seccion-titulo .eyebrow { display: block; margin-bottom: var(--s4); }
.seccion-titulo .lead { max-width: 64ch; margin-top: var(--s5); }
.seccion-centro { text-align: center; }
.seccion-centro .h-serif, .seccion-centro .h-sans { margin-inline: auto; max-width: 22ch; }
.seccion-centro .lead { max-width: 60ch; margin: var(--s5) auto 0; }

/* Frase grande centrada, como el "20 años liderando..." de la referencia. */
.declaracion {
  padding: var(--section-y) 0;
  text-align: center;
}
.declaracion .h-serif { max-width: 24ch; margin-inline: auto; font-size: clamp(2.2rem, 1.4rem + 3.2vw, 4.6rem); }
.declaracion .lead { max-width: 58ch; margin: var(--s6) auto 0; }

/* Dos columnas: texto y foto redondeada. */
.dos-col {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(2.5rem, 6vw, 7rem);
}
.dos-col.invertido > :first-child { order: 2; }
.dos-col .h-sans { margin-bottom: var(--s6); }
.dos-col figure { margin: 0; }
.dos-col img, .dos-col .foto-pendiente {
  width: 100%; height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-lg);
}
.dos-col .acciones { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s6); }

/* ══ REJILLA DE ESPECIALIDADES ════════════════════════════════════════════
   Icono ilustrativo y etiqueta en serif, con aire. Una destacada en marrón.
   ────────────────────────────────────────────────────────────────────── */
.especialidades-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s4);
}
.especialidad {
  display: grid; justify-items: center; align-content: center; gap: var(--s5);
  min-height: 280px;
  padding: var(--s7) var(--s5);
  border-radius: var(--r-lg);
  color: var(--tinta);
  text-align: center;
  text-decoration: none;
  transition: background 260ms var(--ease-out), color 260ms var(--ease-out), transform 260ms var(--ease-out);
}
.especialidad .icon-xl { color: var(--tinta); transition: color 260ms ease, transform 360ms var(--ease-out); }
.especialidad h3 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 1.2rem + .9vw, 2rem);
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.15;
}
.especialidad:focus-visible {
  background: var(--marron); color: var(--crema);
}
.especialidad:focus-visible .icon-xl { color: var(--crema); transform: translateY(calc(-1 * var(--s1))); }
@media (hover: hover) {
  .especialidad:hover {
  background: var(--marron); color: var(--crema);
 transform: translateY(calc(-1 * var(--s1))); }
  .especialidad:hover .icon-xl { color: var(--crema); transform: translateY(calc(-1 * var(--s1))); }
}
/* Táctil: el mismo color mientras se toca. */
.especialidad.is-tocada, .especialidad:active {
  background: var(--marron); color: var(--crema);
  transform: scale(.98); }
.especialidad.is-tocada .icon-xl, .especialidad:active .icon-xl { color: var(--crema); transform: translateY(calc(-1 * var(--s1))); }
/* pathLength=1 normaliza cada trazo; los acentos rellenos quedan estables. */
.icon-especialidad .icono-trazo { stroke-dasharray: 1; stroke-dashoffset: 0; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  body.motion-ready .especialidad:hover .icono-trazo {
    animation: dibujar-icono 900ms var(--ease-out);
  }
}
@keyframes dibujar-icono { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .especialidad, .especialidad .icon-xl { transform: none !important; }
}

/* ══ LISTADOS ═════════════════════════════════════════════════════════════ */
.lista-titulo {
  margin-bottom: var(--s5);
  color: var(--mudo);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.lista {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 3vw, 3.5rem);
  border-top: 1px solid var(--linea);
}
.lista[data-columns="2"] { --cols: 2; }
.lista[data-columns="3"] { --cols: 3; }
.lista li {
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--linea);
  color: var(--tinta-2);
  font-size: var(--fs-base);
  line-height: 1.45;
}

/* Tarjetas ligeras para tecnologías o pasos. */
.tarjetas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.tarjetas-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tarjetas-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tarjeta {
  display: flex; flex-direction: column; gap: var(--s4);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  border-radius: var(--r-lg);
  background: var(--blanco);
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
}
.tarjeta:hover { transform: translateY(-3px); box-shadow: var(--sh-1); }
.tarjeta .icon-lg { color: var(--marron); }
.tarjeta h3 { font-size: clamp(1.2rem, 1.05rem + .5vw, 1.5rem); }
.tarjeta p { color: var(--cuerpo); font-size: var(--fs-sm); line-height: 1.6; }
.tarjeta-num { color: var(--mudo); font-size: var(--fs-sm); font-weight: 500; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.tarjeta-enlace { color: inherit; text-decoration: none; }
.tarjeta-enlace .enlace { margin-top: auto; padding-top: var(--s2); }
.tarjeta-enlace:hover h3 { color: var(--marron); }

/* Proceso en pasos, con hilo. */
.proceso { display: grid; grid-template-columns: repeat(var(--pasos, 4), minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2.5rem); margin-top: var(--s7); }
.proceso li { position: relative; padding-top: var(--s7); }
.proceso li::before { content: ""; position: absolute; top: 20px; right: 0; left: 0; height: 1px; background: var(--linea-2); }
.proceso li:first-child::before { left: 20px; }
.proceso li:last-child::before { right: calc(100% - 20px); }
.proceso .num {
  position: absolute; top: 0; left: 0;
  display: grid; width: 40px; height: 40px; place-items: center;
  border: 1px solid var(--marron); border-radius: 50%;
  background: var(--crema);
  color: var(--marron);
  font-family: var(--font-display); font-size: 1.1rem;
}
.proceso h3 { margin-bottom: var(--s2); font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); }
.proceso p { color: var(--cuerpo); font-size: var(--fs-sm); line-height: 1.55; }

/* ══ ACORDEÓN ═════════════════════════════════════════════════════════════ */
.acordeon { max-width: 60rem; margin-inline: auto; border-top: 1px solid var(--linea); }
.acordeon details { border-bottom: 1px solid var(--linea); }
.acordeon summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s5);
  padding: var(--s5) 0;
  font-size: var(--fs-lead);
  font-weight: 400;
  cursor: pointer;
  list-style: none;
}
.acordeon summary::-webkit-details-marker { display: none; }
.acordeon summary .icon { flex: 0 0 auto; transition: transform 300ms var(--ease-out); }
.acordeon details[open] summary .icon { transform: rotate(180deg); }
.acordeon .respuesta { max-width: 62ch; padding: 0 0 var(--s5); color: var(--cuerpo); line-height: 1.7; }

/* ══ ESPECIALISTAS ════════════════════════════════════════════════════════ */
.equipo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); }
.persona { text-decoration: none; color: inherit; }
.persona-foto {
  position: relative; overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 50% 42%, rgba(75, 52, 39, .10), transparent 62%),
    repeating-linear-gradient(135deg, transparent 0 13px, rgba(75, 52, 39, .05) 13px 14px),
    var(--crema-2);
  display: grid; place-items: center;
}
.persona-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.persona:hover .persona-foto img { transform: scale(1.04); }
.persona-foto span {
  color: var(--marron);
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  font-weight: 500;
}
.persona-foto::after {
  content: attr(data-pending);
  position: absolute; bottom: var(--s3); left: 50%;
  padding: 3px var(--s3);
  border-radius: var(--r-pill);
  background: rgba(251, 250, 246, .85);
  color: var(--cuerpo);
  font-size: .625rem; letter-spacing: .1em; text-transform: uppercase;
  transform: translateX(-50%);
}
.persona-foto[data-pending=""]::after { display: none; }
.persona h3 { margin-top: var(--s4); font-size: clamp(1.15rem, 1.05rem + .4vw, 1.4rem); }
.persona-cargo { margin-top: var(--s1); color: var(--marron); font-size: var(--fs-sm); font-weight: 500; }
.persona-areas { margin-top: var(--s2); color: var(--cuerpo); font-size: var(--fs-sm); line-height: 1.5; }

/* ══ SEDES ════════════════════════════════════════════════════════════════ */
.sedes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.25rem, 2.5vw, 2rem); }
.sede-foto { overflow: hidden; aspect-ratio: 3 / 4; border-radius: var(--r-lg); }
.sede-foto img, .sede-foto .foto-pendiente { width: 100%; height: 100%; object-fit: cover; }
.sede h3 { margin: var(--s5) 0 var(--s3); font-size: clamp(1.5rem, 1.2rem + 1vw, 2.2rem); font-weight: 400; letter-spacing: -.02em; }
.sede-datos { color: var(--cuerpo); font-size: var(--fs-base); line-height: 1.6; }
.sede-datos strong { color: var(--tinta); font-weight: 600; }
.sede-datos a { color: var(--tinta); text-underline-offset: 4px; }
.sede-acciones { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.sede-acciones .btn { min-height: 46px; padding-inline: var(--s5); font-size: var(--fs-xs); }
.provisional {
  display: inline-block; margin-top: var(--s2);
  padding: 2px var(--s2);
  border-radius: var(--r-pill);
  background: var(--crema-2); color: var(--marron);
  font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase;
}

/* ══ LÍNEA DE TIEMPO ══════════════════════════════════════════════════════ */
.linea-tiempo { position: relative; margin-top: var(--s7); }
.linea-tiempo::before, .linea-tiempo::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 1px; }
.linea-tiempo::before { background: var(--linea); }
.linea-tiempo::after { background: var(--marron); transform: scaleY(var(--progreso, 1)); transform-origin: top; transition: transform 120ms linear; }
.hito {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 8rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: 0 0 var(--s8) var(--s7);
}
.hito:last-child { padding-bottom: 0; }
.hito::before {
  content: ""; position: absolute; top: .6em; left: 0;
  width: 11px; height: 11px;
  border: 1px solid var(--marron); border-radius: 50%;
  background: var(--crema);
  transform: translateX(-5px);
  transition: background 300ms ease;
}
.hito.is-visible::before { background: var(--marron); }
.hito-anio { color: var(--marron); font-size: clamp(1.7rem, 1.25rem + 1.5vw, 2.7rem); font-weight: 500; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.hito h3 { margin-bottom: var(--s3); }
.hito > div p { max-width: 62ch; color: var(--cuerpo); line-height: 1.7; }

/* ══ CIFRAS ═══════════════════════════════════════════════════════════════ */
.cifras {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding-block: var(--s8);
  border-block: 1px solid var(--linea);
}
.cifra { padding: var(--s2) var(--s6); border-left: 1px solid var(--linea); }
.cifra:first-child { padding-left: 0; border-left: 0; }
.cifra dt {
  font-size: clamp(3rem, 2rem + 3.4vw, 5.6rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .95;
  font-variant-numeric: tabular-nums;
}
.cifra dt sup { margin-right: .06em; font-size: .5em; font-weight: 400; vertical-align: .5em; color: var(--marron); }
.cifra dd { margin: var(--s4) 0 0; max-width: 20ch; color: var(--cuerpo); font-size: var(--fs-sm); line-height: 1.5; }

/* ══ CONTACTO ═════════════════════════════════════════════════════════════ */
.contacto-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.contacto-tarjeta {
  display: flex; flex-direction: column; gap: var(--s3);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  border-radius: var(--r-lg);
  background: var(--blanco);
  color: inherit; text-decoration: none;
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
}
.contacto-tarjeta:hover { transform: translateY(-3px); box-shadow: var(--sh-1); }
.contacto-tarjeta .icon-lg { color: var(--marron); }
.contacto-tarjeta strong { font-size: clamp(1.25rem, 1.05rem + .7vw, 1.7rem); font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.contacto-tarjeta span { color: var(--cuerpo); font-size: var(--fs-sm); line-height: 1.5; }
.contacto-dos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: start; margin-top: var(--s9); }
.contacto-dos h3 { font-size: var(--fs-h3); }
.horarios { display: grid; gap: var(--s3); margin: var(--s5) 0 0; padding: 0; list-style: none; }
.horarios li { display: flex; justify-content: space-between; gap: var(--s4); padding-bottom: var(--s3); border-bottom: 1px solid var(--linea); color: var(--cuerpo); }
.horarios li span:last-child { color: var(--tinta); font-weight: 500; font-variant-numeric: tabular-nums; }
.formulario { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); padding: clamp(1.5rem, 2.5vw, 2.5rem); border-radius: var(--r-lg); background: var(--blanco); }
.formulario label { display: grid; gap: var(--s2); font-size: var(--fs-sm); font-weight: 500; }
.formulario .ancho { grid-column: 1 / -1; }
.formulario input, .formulario select, .formulario textarea {
  width: 100%; padding: var(--s3) var(--s4);
  border: 1px solid var(--linea-2); border-radius: var(--r-sm);
  background: var(--crema); color: var(--tinta);
  font: inherit; font-size: var(--fs-base);
}
.formulario input:focus, .formulario select:focus, .formulario textarea:focus { outline: 2px solid var(--marron); outline-offset: 1px; border-color: var(--marron); }
.formulario textarea { min-height: 140px; resize: vertical; }
.formulario .consent { grid-column: 1 / -1; display: flex; gap: var(--s3); align-items: flex-start; font-weight: 400; color: var(--cuerpo); line-height: 1.5; }
.formulario .consent input { width: auto; margin-top: .3em; }
.formulario .consent a { color: var(--tinta); }
@media (max-width: 1080px) {
  .contacto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contacto-dos { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .contacto-grid, .formulario { grid-template-columns: 1fr; }
}

/* ══ CIERRE ═══════════════════════════════════════════════════════════════ */
.cierre {
  padding: var(--section-y) 0;
  background: var(--marron);
  color: var(--crema);
  text-align: center;
}
.cierre .h-serif { max-width: 22ch; margin-inline: auto; }
.cierre .lead { max-width: 52ch; margin: var(--s5) auto 0; color: rgba(244, 242, 235, .82); }
.cierre .acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s4); margin-top: var(--s7); }

/* ══ FOOTER ═══════════════════════════════════════════════════════════════ */
.site-footer { padding: var(--s9) 0 var(--s6); background: var(--crema); color: var(--cuerpo); font-size: var(--fs-sm); border-top: 1px solid var(--linea); }
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, .8fr)) minmax(0, 1.2fr);
  gap: clamp(2rem, 4vw, 4rem);
  padding-bottom: var(--s8);
  border-bottom: 1px solid var(--linea);
}
.footer-brand img { width: 128px; height: auto; }
.footer-brand p { max-width: 34ch; margin: var(--s5) 0 var(--s6); line-height: 1.7; }
.footer-col { display: grid; align-content: start; gap: var(--s3); }
.footer-col h2 { margin-bottom: var(--s2); color: var(--tinta); font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 600; }
.footer-col a { width: fit-content; text-decoration: none; transition: color 180ms ease; }
.footer-col a:hover, .footer-col a:focus-visible { color: var(--marron); }
.footer-sedes address { margin-bottom: var(--s4); font-style: normal; line-height: 1.6; }
.footer-sedes strong { display: block; color: var(--tinta); font-weight: 600; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); padding-top: var(--s5); color: var(--mudo); font-size: var(--fs-xs); }
.footer-bottom nav { display: flex; gap: var(--s5); }
.footer-bottom a { text-decoration: none; }

/* ══ WHATSAPP ════════════════════════════════════════════════════════════
   Botón píldora fijo abajo a la derecha y panel con accesos directos.
   ────────────────────────────────────────────────────────────────────── */
.wa { pointer-events: none; position: fixed; z-index: 95; right: clamp(1rem, 2.5vw, 2.5rem); bottom: clamp(1rem, 2.5vw, 2.5rem); display: flex; flex-direction: column; align-items: flex-end; gap: var(--s3); }
.wa-boton, .wa-boton:visited {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: var(--s3);
  color: var(--tinta); text-decoration: none;
}
.wa-icono {
  position: relative; display: grid; flex: 0 0 60px; width: 60px; height: 60px; place-items: center;
  border: 1px solid rgba(75, 52, 39, .14);
  border-radius: 50%;
  background: rgba(251, 250, 246, .88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: var(--marron);
  box-shadow: 0 1px 2px rgba(40, 28, 18, .06), 0 12px 32px rgba(40, 28, 18, .16);
  transition: background 260ms ease, color 260ms ease, transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}
.wa-boton:focus-visible .wa-icono { background: var(--marron); color: var(--crema); transform: translateY(-2px); box-shadow: 0 16px 36px rgba(40, 28, 18, .24); }
.wa-icono .icon { position: absolute; width: 1.6rem; height: 1.6rem; stroke-width: 1.4; transition: opacity 220ms ease, transform 320ms var(--ease-out); }
.wa-i-cerrar { opacity: 0; transform: rotate(-90deg) scale(.6); }
@media (hover: hover) {
  .wa-boton:hover .wa-icono { background: var(--marron); color: var(--crema); transform: translateY(-2px); box-shadow: 0 16px 36px rgba(40, 28, 18, .24); }
  .wa-boton:hover .wa-texto { opacity: 1; transform: none; }
}
/* Punto de estado: verde en horario, ámbar fuera de horario. */
.wa-dot { position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; border: 2px solid var(--blanco); border-radius: 50%; background: #7FB685; }
.wa-dot.is-fuera { background: #D6A85E; }
/* Etiqueta flotante: aparece al pasar el ratón y una vez como saludo. */
.wa-texto {
  padding: 10px 16px;
  border: 1px solid rgba(75, 52, 39, .1);
  border-radius: var(--r-pill);
  background: rgba(251, 250, 246, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(40, 28, 18, .12);
  color: var(--cuerpo); font-size: var(--fs-xs); white-space: nowrap;
  opacity: 0; transform: translateX(8px); pointer-events: none;
  transition: opacity 260ms ease, transform 320ms var(--ease-out);
}
.wa-texto b { color: var(--tinta); font-weight: 600; }
.wa-boton:focus-visible .wa-texto, .wa.is-saludo .wa-texto { opacity: 1; transform: none; }
/* Anillo que late al aparecer, para señalar el botón sin molestar. */
.wa-icono::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; box-shadow: 0 0 0 0 rgba(75, 52, 39, .28); pointer-events: none; }
body.motion-ready .wa-boton.is-llamando .wa-icono::after { animation: wa-latido 1.8s var(--ease-out) 2; }
@keyframes wa-latido { to { box-shadow: 0 0 0 14px rgba(75, 52, 39, 0); } }
body.motion-ready .wa { opacity: 0; transform: translateY(16px); transition: opacity 500ms var(--ease-out), transform 600ms var(--ease-out); }
body.motion-ready .wa.is-listo { opacity: 1; transform: none; }
/* Abierto: círculo marrón con una X; la etiqueta se oculta. */
.wa.is-abierto .wa-icono { background: var(--marron); color: var(--crema); }
.wa.is-abierto .wa-texto { opacity: 0 !important; }
.wa.is-abierto .wa-dot { opacity: 0; }
.wa.is-abierto .wa-i-abrir { opacity: 0; transform: rotate(90deg) scale(.6); }
.wa.is-abierto .wa-i-cerrar { opacity: 1; transform: none; }

.wa-panel {
  width: min(360px, calc(100vw - 2rem));
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--blanco);
  box-shadow: 0 24px 60px rgba(40, 28, 18, .22);
  transform-origin: bottom right;
  opacity: 0; transform: translateY(10px) scale(.96);
  transition: opacity 220ms var(--ease-out), transform 320ms var(--ease-out);
}
.wa-panel[hidden] { display: block; visibility: hidden; pointer-events: none; }
.wa.is-abierto .wa-panel { opacity: 1; transform: none; visibility: visible; pointer-events: auto; }
.wa-cabecera { display: flex; align-items: center; gap: var(--s3); padding: var(--s5); background: var(--marron); color: var(--crema); }
.wa-avatar { display: grid; flex: 0 0 44px; height: 44px; place-items: center; border-radius: 50%; background: var(--crema); color: var(--marron); font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; line-height: 1; }
.wa-quien { flex: 1; min-width: 0; }
.wa-titulo { margin: 0; font-weight: 600; font-size: var(--fs-base); }
.wa-estado { display: flex; align-items: center; gap: var(--s2); margin: 2px 0 0; color: rgba(244, 242, 235, .78); font-size: var(--fs-xs); }
.wa-punto { flex: 0 0 8px; height: 8px; border-radius: 50%; background: #9FC7A2; box-shadow: 0 0 0 3px rgba(159, 199, 162, .25); }
.wa-estado.is-fuera .wa-punto { background: #D9B77E; box-shadow: 0 0 0 3px rgba(217, 183, 126, .25); }
.wa-cerrar { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.wa-cerrar:hover { background: rgba(244, 242, 235, .14); }
.wa-cuerpo { padding: var(--s5); background: var(--crema); }
.wa-mensaje { position: relative; margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border-radius: 4px var(--r) var(--r) var(--r); background: var(--blanco); box-shadow: 0 1px 2px rgba(40, 28, 18, .06); font-size: var(--fs-sm); line-height: 1.5; }
.wa-opciones { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.wa-opciones a {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--linea); border-radius: var(--r);
  background: var(--blanco); color: var(--tinta);
  text-decoration: none;
  transition: border-color 200ms ease, transform 220ms var(--ease-out);
}
.wa-opciones a:hover, .wa-opciones a:focus-visible { border-color: var(--marron); transform: translateX(3px); }
.wa-opciones .icon { flex: 0 0 auto; width: 1.2rem; height: 1.2rem; color: var(--marron); }
.wa-opciones span { display: grid; flex: 1; min-width: 0; }
.wa-opciones strong { font-size: var(--fs-sm); font-weight: 600; }
.wa-opciones small { color: var(--cuerpo); font-size: var(--fs-xs); line-height: 1.4; }
.wa-opciones .wa-flecha { width: 1rem; height: 1rem; color: var(--mudo); }
.wa-agenda { display: inline-flex; align-items: center; gap: var(--s2); margin-top: var(--s4); color: var(--tinta); font-size: var(--fs-sm); font-weight: 500; text-underline-offset: 4px; }
.wa-agenda .icon { width: 1rem; height: 1rem; }
.wa-pie { margin: 0; padding: var(--s3) var(--s5); border-top: 1px solid var(--linea); background: var(--blanco); color: var(--mudo); font-size: var(--fs-xs); text-align: center; }
/* Escalonado de las opciones al abrir. */
body.motion-ready .wa-opciones li { opacity: 0; transform: translateY(6px); transition: opacity 260ms ease, transform 320ms var(--ease-out); }
body.motion-ready .wa.is-abierto .wa-opciones li { opacity: 1; transform: none; }
body.motion-ready .wa.is-abierto .wa-opciones li:nth-child(2) { transition-delay: 50ms; }
body.motion-ready .wa.is-abierto .wa-opciones li:nth-child(3) { transition-delay: 100ms; }
body.motion-ready .wa.is-abierto .wa-opciones li:nth-child(4) { transition-delay: 150ms; }
@media (max-width: 720px) {
  .wa-panel { display: flex; flex-direction: column; max-height: calc(100svh - 120px); }
  .wa-cuerpo { overflow-y: auto; }
  .wa-opciones small { display: none; }
  .wa-icono { flex-basis: 56px; width: 56px; height: 56px; }
  .wa.is-saludo .wa-texto { opacity: 1; }
}

/* ══ MODAL AGENDA TU CITA ════════════════════════════════════════════════ */
.agenda {
  width: min(560px, calc(100vw - 2rem)); max-height: calc(100svh - 2rem);
  padding: 0; border: 0; border-radius: var(--r-lg);
  background: var(--crema); color: var(--tinta);
  box-shadow: 0 30px 80px rgba(20, 14, 10, .35);
  overflow: hidden;
}
.agenda[open] { display: flex; flex-direction: column; }
.agenda::backdrop { background: rgba(26, 23, 20, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
body.motion-ready .agenda[open] { animation: agenda-entra 360ms var(--ease-out); }
body.motion-ready .agenda[open]::backdrop { animation: agenda-fondo 300ms ease; }
@keyframes agenda-entra { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes agenda-fondo { from { opacity: 0; } }
.agenda-form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.agenda-form[hidden] { display: none; }
.agenda-cabecera { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); padding: var(--s6) var(--s6) var(--s4); }
.agenda-eyebrow { margin: 0 0 var(--s2); color: var(--mudo); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.agenda h2 { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 1.6rem + 1.4vw, 2.6rem); font-weight: 500; line-height: 1; }
.agenda-sub { margin: var(--s3) 0 0; color: var(--cuerpo); font-size: var(--fs-sm); line-height: 1.5; }
.agenda-cerrar { display: grid; flex: 0 0 40px; height: 40px; place-items: center; border: 1px solid var(--linea-2); border-radius: 50%; background: transparent; color: var(--tinta); cursor: pointer; }
.agenda-cerrar .icon { width: 1.1rem; height: 1.1rem; }
.agenda-cuerpo { display: grid; gap: var(--s4); padding: var(--s2) var(--s6) var(--s5); overflow-y: auto; overscroll-behavior: contain; }
.campo { display: grid; gap: var(--s2); min-width: 0; margin: 0; padding: 0; border: 0; font-size: var(--fs-sm); font-weight: 500; }
.campo legend { margin-bottom: var(--s2); padding: 0; }
.campo .opcional { color: var(--mudo); font-weight: 400; }
.campo input, .campo select, .campo textarea {
  width: 100%; min-height: 48px; padding: var(--s3) var(--s4);
  border: 1px solid var(--linea-2); border-radius: var(--r-sm);
  background: var(--blanco); color: var(--tinta);
  font: inherit; font-size: 16px; font-weight: 400;
}
.campo textarea { min-height: 72px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 2px solid var(--marron); outline-offset: 1px; border-color: var(--marron); }
.campo-dos { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.pildoras { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pildoras label { position: relative; }
.pildoras input { position: absolute; opacity: 0; pointer-events: none; }
.pildoras span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s5);
  border: 1px solid var(--linea-2); border-radius: var(--r-pill);
  background: var(--blanco); font-weight: 400; cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.pildoras-dias span { padding: 0 var(--s4); }
.pildoras input:checked + span { border-color: var(--marron); background: var(--marron); color: var(--crema); }
.pildoras input:focus-visible + span { outline: 2px solid var(--marron); outline-offset: 2px; }
.agenda-consent { display: flex; gap: var(--s3); align-items: flex-start; color: var(--cuerpo); font-size: var(--fs-xs); line-height: 1.5; }
.agenda-consent input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; accent-color: var(--marron); }
.agenda-consent a { color: var(--tinta); }
.agenda-error { margin: 0; padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: #F3E1D6; color: #7A3A1C; font-size: var(--fs-xs); }
.agenda-pie { display: grid; gap: var(--s3); justify-items: center; padding: var(--s4) var(--s6) calc(var(--s5) + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); background: var(--blanco); }
.agenda-enviar { width: 100%; justify-content: center; min-height: 52px; }
.agenda-externo { display: inline-flex; align-items: center; gap: var(--s2); color: var(--cuerpo); font-size: var(--fs-xs); text-underline-offset: 3px; }
.agenda-externo .icon { width: .9rem; height: .9rem; }
.agenda-ok { display: grid; justify-items: center; gap: var(--s4); padding: var(--s9) var(--s6) var(--s8); text-align: center; }
.agenda-ok[hidden] { display: none; }
.agenda-ok-icono { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 50%; background: var(--marron); color: var(--crema); }
.agenda-ok-icono .icon { width: 1.7rem; height: 1.7rem; }
.agenda-ok p { max-width: 34ch; margin: 0; color: var(--cuerpo); line-height: 1.6; }
.agenda-volver { border: 0; background: none; color: var(--cuerpo); font: inherit; font-size: var(--fs-sm); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 720px) {
  .agenda { width: 100vw; max-width: 100vw; max-height: 92svh; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  body.motion-ready .agenda[open] { animation: agenda-sube 380ms var(--ease-out); }
  @keyframes agenda-sube { from { transform: translateY(40px); opacity: .4; } }
  .agenda-cabecera { padding: var(--s5) var(--gutter) var(--s3); }
  .campo-dos { grid-template-columns: 1fr; }
  .agenda-cuerpo { padding: var(--s2) var(--gutter) var(--s4); }
  .agenda-pie { padding-inline: var(--gutter); }
}
html.agenda-abierta { overflow: hidden; }

/* ══ HUECO DE FOTO (sin foto todavía, sin texto) ═══════════════════════ */
.foto-vacia {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  background: radial-gradient(120% 90% at 20% 15%, #F1EADF 0%, #E6DDCF 55%, #DCD1C0 100%);
}
.foto-vacia::after {
  content: "Ú"; position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(75, 52, 39, .12); font-family: var(--font-display); font-size: clamp(4rem, 3rem + 4vw, 7rem); font-weight: 500;
}
.foto-vacia[data-ratio="16-9"] { aspect-ratio: 16 / 9; }
.foto-vacia[data-ratio="4-3"] { aspect-ratio: 4 / 3; }
.foto-vacia[data-ratio="3-4"] { aspect-ratio: 3 / 4; }
.sede-foto .foto-vacia { width: 100%; height: 100%; }
.persona-foto[data-pending=""]::after { display: none; }

/* ══ FOTOGRAFÍA PENDIENTE ═════════════════════════════════════════════════ */
.foto-pendiente {
  display: grid; place-items: center; align-content: center; gap: var(--s2);
  padding: var(--s6) var(--s5);
  border: 1px dashed var(--linea-2);
  border-radius: var(--r-lg);
  background: repeating-linear-gradient(135deg, transparent 0 11px, rgba(75, 52, 39, .04) 11px 22px), var(--crema-2);
  color: var(--cuerpo);
  text-align: center;
}
.foto-pendiente[data-ratio="16-9"] { aspect-ratio: 16 / 9; }
.foto-pendiente[data-ratio="4-3"] { aspect-ratio: 4 / 3; }
.foto-pendiente[data-ratio="3-4"] { aspect-ratio: 3 / 4; }
.foto-pendiente .icon { color: var(--marron); opacity: .7; }
.foto-pendiente b { color: var(--tinta-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.foto-pendiente span { max-width: 32ch; font-size: var(--fs-xs); line-height: 1.5; }

.nota-pendiente {
  display: flex; align-items: flex-start; gap: var(--s3);
  max-width: 72ch;
  margin-top: var(--s6);
  padding: var(--s5);
  border-radius: var(--r);
  background: var(--crema-2);
  color: var(--cuerpo);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.nota-pendiente .icon { margin-top: .2em; color: var(--marron); }
.nota-pendiente > span { flex: 1; }
.nota-pendiente strong { color: var(--tinta); font-weight: 600; }

/* ══ MOVIMIENTO ═══════════════════════════════════════════════════════════ */
body.motion-ready [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 800ms var(--ease-out) var(--reveal-delay, 0ms),
              transform 1000ms var(--ease-out) var(--reveal-delay, 0ms);
}
body.motion-ready [data-reveal="left"] { transform: translate3d(-28px, 0, 0); }
body.motion-ready [data-reveal="right"] { transform: translate3d(28px, 0, 0); }
body.motion-ready [data-reveal="scale"] { transform: scale(.96); }
/* Wipe: la figura no se recorta (si se recortara, el observador y el lazy-load
   la verian con area cero y nunca se mostraria). Una cortina del color del
   fondo la cubre y se retira hacia la derecha. */
body.motion-ready [data-reveal="wipe"] { position: relative; opacity: 1; transform: none; }
body.motion-ready [data-reveal="wipe"]::after {
  content: ""; position: absolute; z-index: 2; inset: -1px;
  background: var(--crema);
  transform-origin: right center;
  transition: transform 1100ms var(--ease-out) var(--reveal-delay, 0ms);
  pointer-events: none;
}
body.motion-ready [data-reveal].is-visible { opacity: 1; transform: none; }
body.motion-ready [data-reveal="wipe"].is-visible::after { transform: scaleX(0); }

.paralaje { will-change: transform; transform: translate3d(0, var(--desplazamiento, 0), 0); }

/* Transición entre páginas: un fundido corto, donde el navegador lo soporta. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 220ms var(--ease-out) both fundir-salida; }
::view-transition-new(root) { animation: 320ms var(--ease-out) both fundir-entrada; }
@keyframes fundir-salida { to { opacity: 0; } }
@keyframes fundir-entrada { from { opacity: 0; } }

/* ══ RESPONSIVE ═══════════════════════════════════════════════════════════
   Punto de corte del header y del menú: 1080px. script.js usa la MISMA consulta.
   ────────────────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .especialidades-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equipo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tarjetas-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  :root { --header-h: 76px; }
  .header-inner { grid-template-columns: 1fr auto; }
  .brand { width: 100px; grid-column: 1; justify-self: start; }
  .btn-header { display: none; }
  .menu-toggle { grid-column: 2; justify-self: end; grid-template-columns: 18px; justify-content: center; width: 46px; padding: 0; border-radius: 50%; }
  .menu-toggle b { display: none; }

  .hero { min-height: 92svh; }
  .hero-interior { min-height: clamp(480px, 74svh, 700px); }
  .subnav {
    overflow-x: auto; scrollbar-width: none; padding-inline: 0;
    scroll-padding-inline: var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { flex: 0 0 auto; padding: 14px var(--s4); font-size: var(--fs-xs); }
  .subnav a:first-child { margin-left: calc(var(--gutter) - var(--s4)); }
  .subnav a:last-child { margin-right: var(--s8); }
  section[id] { scroll-margin-top: calc(var(--header-h) + 60px); }

  .dos-col { grid-template-columns: 1fr; }
  .dos-col.invertido > :first-child { order: 0; }
  .sedes-grid { grid-template-columns: 1fr; max-width: 34rem; }
  .cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s7); }
  .cifra:nth-child(odd) { padding-left: 0; border-left: 0; }
  .proceso { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s6); }
  .proceso li::before { display: none; }
  .tarjetas, .tarjetas-3 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .hito { grid-template-columns: 1fr; gap: var(--s3); }
}

@media (max-width: 1080px) {
  .footer-col a, .footer-sedes .enlace { display: inline-flex; align-items: center; min-height: 40px; }
  .footer-sedes address a { display: inline-flex; align-items: center; min-height: 36px; }
  .lista a { display: inline-flex; align-items: center; min-height: 40px; }
  .enlace { min-height: 40px; }
}

@media (max-width: 720px) {
  .especialidades-grid { grid-template-columns: 1fr 1fr; gap: var(--s2); }
  .especialidad { min-height: 200px; padding: var(--s5) var(--s3); }
  .icon-especialidad { width: 5rem; height: 5rem; stroke-width: 1.25; }
  .equipo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
  .lista, .lista[data-columns="2"], .lista[data-columns="3"] { --cols: 1; }
  .tarjetas-4 { grid-template-columns: 1fr; }
  .cifras { grid-template-columns: 1fr; row-gap: 0; padding-block: var(--s6); }
  .cifra, .cifra:nth-child(odd) { padding: var(--s5) 0; border-left: 0; border-top: 1px solid var(--linea); }
  .cifra:first-child { padding-top: 0; border-top: 0; }
  .proceso { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .hero-nota { position: static; margin-top: var(--s5); display: inline-block; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  body.motion-ready [data-reveal] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  body.motion-ready [data-reveal="wipe"]::after { display: none; }
  .hero [data-split] .palabra > span { transform: none !important; }
  body.motion-ready .hero .hero-sub, body.motion-ready .hero .hero-actions, body.motion-ready .hero .hero-nota { opacity: 1 !important; transform: none !important; }
  .hero-media img { animation: none !important; }
  .linea-tiempo::after { transform: scaleY(1) !important; }
  .paralaje { transform: none !important; }
  .wa, .wa-panel, .wa-opciones li { transition: none !important; }
}
