/* =========================================================
   Dr. Yamil Eid — estilos del sitio
   Orden: variables · base · intro · header · hero · secciones
   · footer · animaciones · tablet · móvil · movimiento reducido
   ========================================================= */

/* Tipografías propias (licencia OFL, ver public/fonts). DM Sans es variable: un archivo para 400–700. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/public/fonts/dm-sans-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/public/fonts/playfair-display-500-latin.woff2') format('woff2');
}

:root {
  --black: #090909;
  --panel: #111110;
  --white: #f4f0e8;
  --muted: #aaa69d;
  --gold: #c6a66b;
  --line: rgba(198, 166, 107, .26);
  --sans: 'DM Sans', Arial, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --gutter: clamp(24px, 7vw, 112px);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
::selection { background: rgba(198, 166, 107, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

/* Enlace de salto para teclado y lectores de pantalla: visible solo al recibir foco */
.skip-link {
  position: fixed;
  z-index: 1001;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  background: var(--gold);
  color: #17130c;
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform .2s;
}
.skip-link:focus { transform: none; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.04em; }
h1 { font-size: clamp(72px, 9vw, 132px); line-height: .88; margin: 0 0 28px; }
h1 em, h2 em { font-weight: 500; color: var(--gold); font-style: normal; }

.section-pad { padding-left: var(--gutter); padding-right: var(--gutter); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow > span { display: inline-block; width: 24px; height: 1px; background: var(--gold); }

/* Botones y enlaces */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 52px;
  padding: 15px 19px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .015em;
  transition: transform .25s, background .25s, border-color .25s;
}
.button:hover { transform: translateY(-2px); }
.button-gold { background: var(--gold); color: #17130c; }
.button-gold:hover { background: #d6bb87; }
.button-outline { border: 1px solid var(--line); color: var(--white); min-width: 194px; }
.button-outline:hover { border-color: var(--gold); }

.text-link {
  position: relative;
  display: flex;
  width: max-content;
  gap: 18px;
  align-items: center;
  margin-top: 25px;
  font-size: 13px;
  color: #d6d1c7;
  transition: color .2s;
}
/* Subrayado dorado que se dibuja al pasar el cursor */
.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
}
.text-link:hover::after { transform: scaleX(1); }
.main-nav > a:hover, .text-link:hover { color: var(--gold); }

/* Iconos SVG */
.icon-arrow {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s ease;
}
.nav-cta .icon-arrow,
.text-link .icon-arrow,
.card-link .icon-arrow,
.button-outline .icon-arrow { color: var(--gold); }
/* La flecha avanza ligeramente en hover */
.button:hover .icon-arrow,
.nav-cta:hover .icon-arrow,
.text-link:hover .icon-arrow,
.procedure-card:hover .card-link .icon-arrow { transform: translate(2px, -2px); }
.text-link:hover .icon-arrow-down { transform: translateY(3px); }

/* Barra de progreso de lectura (se anima con transform, sin recalcular el layout) */
.reading-progress { position: fixed; z-index: 1000; inset: 0 0 auto; height: 2px; pointer-events: none; }
.reading-progress span {
  display: block;
  height: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .08s linear;
}

/* ---------- Intro (solo primera visita, ver script en <head>) ---------- */

.intro {
  position: fixed;
  z-index: 999;
  inset: 0;
  display: none;
  place-items: center;
  align-content: center;
  gap: 24px;
  background: #050505;
  animation: introOut .2s ease .65s forwards;
}
.show-intro .intro { display: grid; }
.intro img { width: min(62vw, 580px); height: auto; object-fit: contain; animation: logoIn .4s ease both; }
.intro-track { width: min(54vw, 420px); height: 2px; background: #28241b; overflow: hidden; }
.intro-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #72552d, var(--gold), #f1d99d);
  transform: scaleX(0);
  transform-origin: left;
  animation: progressIn .65s cubic-bezier(.25, .7, .2, 1) forwards;
}
@keyframes logoIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes progressIn { to { transform: scaleX(1); } }
@keyframes introOut { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 82px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(9, 9, 9, .92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
/* Marca de texto en el dorado del sitio (el logo dorado se reserva para la intro) */
.brand-mark { font: 500 25px/1 var(--serif); letter-spacing: .01em; color: var(--gold); transition: color .2s; }
.brand:hover .brand-mark { color: #d6bb87; }
.main-nav { display: flex; align-items: center; gap: 38px; }
.main-nav > a:not(.nav-cta) { font-size: 13px; color: #d3d0c9; transition: color .2s; }
.nav-cta { border: 1px solid var(--line); padding: 10px 16px; font-size: 12px; letter-spacing: .03em; }
.menu-toggle { display: none; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  height: 780px;
  min-height: min(850px, 100svh);
  max-height: 950px;
  overflow: hidden;
  background: var(--black);
}
.hero-image { position: absolute; inset: 0 0 0 26%; opacity: .86; }
/* Equivale al antiguo background-size:auto 92% / background-position:72% center */
.hero-image img {
  position: absolute;
  top: 50%;
  left: 72%;
  width: auto;
  height: 92%;
  max-width: none;
  transform: translate(-72%, -50%);
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #090909 0%, rgba(9, 9, 9, .97) 19%, rgba(9, 9, 9, .7) 43%, rgba(9, 9, 9, .06) 75%),
    linear-gradient(0deg, #090909 0%, transparent 26%, rgba(0, 0, 0, .15) 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 780px; padding: 88px var(--gutter) 30px; }
.hero-subtitle { margin-bottom: 32px; font-size: 17px; font-weight: 500; line-height: 1.65; color: #d2cec6; }

/* ---------- Presentación ---------- */

.intro-note {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10%;
  align-items: start;
  padding-top: 142px;
  padding-bottom: 155px;
}
.intro-note .eyebrow { grid-column: 1 / -1; }
.intro-statement { margin: 0; font: 500 clamp(32px, 4.4vw, 58px)/1.2 var(--serif); letter-spacing: -.025em; }
.intro-statement span { color: var(--gold); }
.intro-copy { align-self: end; max-width: 420px; margin: 10px 0 0; font-size: 16px; line-height: 1.7; color: var(--muted); }

/* Credenciales: matrícula y sociedades */
.credentials {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 96px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.credentials li { padding: 28px 28px 0 0; }
.credentials li + li { padding-left: 28px; border-left: 1px solid rgba(255, 255, 255, .08); }
.credentials small {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.credentials strong { font: 500 28px/1.2 var(--serif); font-variant-numeric: lining-nums; letter-spacing: .02em; color: var(--white); }

/* ---------- Procedimientos ---------- */

.procedures { padding-top: 100px; padding-bottom: 132px; background: var(--panel); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 75px; }
.section-heading h2, .clinic h2, .hours h2, .contact h2 { margin: 0; font-size: clamp(44px, 5.4vw, 70px); line-height: 1.05; }
.section-heading > p { max-width: 380px; margin-bottom: 5px; font-size: 15px; color: var(--muted); }

.procedure-category { margin-top: 36px; }
.category-heading {
  display: flex;
  gap: 18px;
  align-items: baseline;
  margin: 0;
  padding: 19px 0 22px;
  border-top: 1px solid var(--line);
  font: 500 22px var(--serif);
}
.category-heading span { font: 600 11px var(--sans); letter-spacing: .12em; color: var(--gold); }
.procedure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .09);
}
.procedure-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 26px 27px 22px;
  background: var(--panel);
  transition: background .25s;
}
/* Línea dorada superior que se dibuja en hover */
.procedure-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s ease;
}
.procedure-card:hover { background: #1b1a17; }
.procedure-card:hover::before { transform: scaleX(1); }
.card-number { font-size: 11px; letter-spacing: .14em; color: var(--gold); }
.procedure-card h4 { margin: 22px 0 11px; font: 500 21px/1.3 var(--serif); }
.procedure-card p { max-width: 340px; margin: 0 0 28px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.card-link {
  align-self: flex-start;
  margin-top: auto;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #dfd5c0;
}
/* Toda la tarjeta es clicable a través del enlace */
.card-link::after { content: ""; position: absolute; inset: 0; }

/* ---------- Resultados (antes y después) ---------- */

.results { padding-top: 120px; padding-bottom: 20px; }
.results-panel {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 10%;
  align-items: end;
  padding: 64px clamp(28px, 5vw, 72px);
  border: 1px solid var(--line);
  background: radial-gradient(circle at 85% 0%, rgba(198, 166, 107, .09), transparent 55%);
}
.results h2 { margin: 0; font-size: clamp(44px, 5.4vw, 70px); line-height: 1.05; }
.results-copy p { max-width: 460px; margin-bottom: 30px; font-size: 16px; line-height: 1.7; color: var(--muted); }

/* ---------- Consultorio ---------- */

.clinic {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 9%;
  align-items: center;
  padding-top: 140px;
  padding-bottom: 145px;
}
.clinic h2 { margin-bottom: 24px; }
.clinic-description { max-width: 420px; margin-bottom: 30px; font-size: 16px; line-height: 1.7; color: var(--muted); }
.clinic-detail {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 12px;
  padding: 19px 0 22px;
  border-top: 1px solid var(--line);
}
.detail-mark svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.clinic-detail strong { display: block; font: 500 17px/1.4 var(--serif); }
.clinic-detail small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

.map-frame {
  position: relative;
  height: 100%;
  min-height: 410px;
  overflow: hidden;
  background: #171715;
  border: 1px solid rgba(198, 166, 107, .22);
}
.map-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 410px;
  border: 0;
  filter: grayscale(1) invert(.9) contrast(.82) brightness(.72);
}
/* Mapa en reposo: evoca un plano sin cargar Google Maps */
.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 46%, rgba(198, 166, 107, .14), transparent 58%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 44px),
    #141413;
  transition: background-color .25s;
}
.map-placeholder:focus-visible { outline-offset: -4px; }
.map-pin {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(9, 9, 9, .6);
  transition: border-color .25s, transform .25s;
}
.map-pin svg { width: 24px; height: 24px; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.map-placeholder strong { font: 500 20px/1.3 var(--serif); color: var(--white); }
.map-placeholder small { font-size: 12px; color: var(--muted); }
.map-placeholder:hover .map-pin { border-color: var(--gold); transform: translateY(-3px); }
.map-placeholder:hover strong { color: var(--gold); }

.map-caption {
  position: absolute;
  bottom: 14px;
  left: 14px;
  padding: 8px 11px;
  background: rgba(9, 9, 9, .86);
  font-size: 11px;
  letter-spacing: .08em;
  color: #ded8cc;
}

/* ---------- Horarios ---------- */

.hours {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 12%;
  align-items: start;
  padding-top: 110px;
  padding-bottom: 124px;
  background: var(--panel);
}
.hours h2 { margin-bottom: 18px; }
.hours-title > p:not(.eyebrow) { font-size: 15px; color: var(--muted); }
.hours-title .text-link { margin-top: 26px; }
/* Dos bloques: consultas con el doctor y atención en recepción */
.hours-groups { display: grid; gap: 52px; }
.hours-group-title { margin: 0 0 6px; font: 500 23px/1.3 var(--serif); color: var(--white); }
.hours-group-note { max-width: 460px; margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.hours-list { margin: 0; }
.hours-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  font-size: 15px;
  transition: color .2s;
}
.hours-list > div:first-child { border-top: 1px solid rgba(255, 255, 255, .12); }
.hours-list dt { color: var(--muted); }
.hours-list dd { margin: 0; font-weight: 500; letter-spacing: .04em; color: #f1ede5; }
/* Día actual (lo marca app.js) */
.hours-list .is-today dt, .hours-list .is-today dd { color: var(--gold); }
.hours-list .is-today dt::after {
  content: "Hoy";
  margin-left: 12px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* ---------- Preguntas frecuentes ---------- */

.faq {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 12%;
  align-items: start;
  padding-top: 120px;
  padding-bottom: 130px;
}
.faq h2 { margin: 0 0 18px; font-size: clamp(44px, 5.4vw, 70px); line-height: 1.05; }
.faq-title > p:not(.eyebrow) { font-size: 15px; color: var(--muted); }
.faq-title .text-link { margin-top: 26px; }
.faq-list details { border-bottom: 1px solid rgba(255, 255, 255, .12); }
.faq-list details:first-child { border-top: 1px solid rgba(255, 255, 255, .12); }
.faq-list summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  font: 500 20px/1.35 var(--serif);
  cursor: pointer;
  list-style: none;
  transition: color .2s;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover, .faq-list details[open] summary { color: var(--gold); }
/* Signo + que se convierte en − al abrir */
.faq-list summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(var(--gold), var(--gold)) center / 14px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) center / 1px 14px no-repeat;
  transition: background-size .25s ease;
}
.faq-list details[open] summary::after { background-size: 14px 1px, 1px 0; }
.faq-list details p { max-width: 560px; margin: -6px 0 24px; font-size: 15px; line-height: 1.75; color: var(--muted); }

/* ---------- Contacto ---------- */

.contact {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 510px;
  padding-top: 100px;
  padding-bottom: 105px;
  overflow: hidden;
  text-align: center;
  background-image:
    linear-gradient(180deg, rgba(5, 5, 5, .22), rgba(5, 5, 5, .38)),
    url('/public/images/hospital-contacto-1600.webp');
  background-size: cover;
  background-position: center 48%;
}
.contact-content { position: relative; z-index: 1; }
.contact .eyebrow { justify-content: center; }
.contact h2 { margin-bottom: 19px; font-size: clamp(48px, 6.2vw, 80px); }
.contact-content > p:not(.eyebrow) { margin-bottom: 28px; font-size: 16px; color: var(--muted); }
.contact-content .button { min-width: 244px; }

/* ---------- Footer ---------- */

.site-footer { padding: 54px var(--gutter) 20px; background: #050505; border-top: 1px solid rgba(255, 255, 255, .08); }
.footer-main { display: grid; grid-template-columns: 1.5fr .7fr .8fr 1fr; gap: 35px; padding-bottom: 45px; }
.footer-brand .brand-mark { font-size: 30px; }
.footer-brand > p { margin: 15px 0 0; font-size: 13px; color: var(--muted); }
.footer-brand > p + p { margin-top: 4px; }
.footer-links, .footer-location {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.footer-links strong, .footer-location strong {
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #eee7d9;
}
.footer-links a:hover { color: var(--gold); }
.footer-location span { max-width: 190px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .09);
  font-size: 12px;
  color: #807c74;
}
.footer-bottom p { margin: 0; text-align: right; }
.footer-bottom a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .2); transition: color .2s; }
.footer-bottom a:hover { color: var(--gold); }

/* ---------- Página legal (privacidad.html) ---------- */

.legal-header .text-link { margin-top: 0; }
.legal { max-width: calc(780px + 2 * var(--gutter)); padding-top: 170px; padding-bottom: 120px; }
.legal h1 { margin: 0 0 14px; font-size: clamp(44px, 6vw, 72px); line-height: 1.05; }
.legal-updated { margin-bottom: 56px; font-size: 13px; color: var(--muted); }
.legal h2 { margin: 52px 0 14px; font-size: 26px; line-height: 1.25; letter-spacing: -.01em; }
/* :where() deja estas reglas sin especificidad extra, para que .eyebrow y .legal-updated conserven su estilo */
:where(.legal) p, :where(.legal) li { font-size: 16px; line-height: 1.75; color: #cfcac1; }
.legal ul { margin: 0 0 16px; padding-left: 20px; }
.legal li { margin-bottom: 8px; }
.legal li::marker { color: var(--gold); }
.legal strong { color: var(--white); font-weight: 600; }
.legal a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(198, 166, 107, .4); }
.legal a:hover { text-decoration-color: var(--gold); }

.floating-whatsapp {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
  transition: transform .2s, background .2s, opacity .25s, visibility 0s;
}
.floating-whatsapp:hover { transform: translateY(-3px); background: #d9bd88; }
/* Se oculta mientras la sección de contacto (con su propio botón) está en pantalla */
.floating-whatsapp.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(.85);
  transition: transform .25s, opacity .25s, visibility 0s .25s;
}
.floating-whatsapp svg { width: 24px; height: 24px; fill: currentColor; }

/* ---------- Animación de aparición (solo con JavaScript activo) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease var(--card-delay, 0ms), transform .7s ease var(--card-delay, 0ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
/* Las tarjetas conservan su hover inmediato (sin el retraso escalonado de la aparición) */
.js .procedure-card.reveal {
  transition: opacity .7s ease var(--card-delay, 0ms), transform .7s ease var(--card-delay, 0ms), background .25s ease;
}

/* ---------- Menú desplegable (≤ 960px) ---------- */

@media (max-width: 960px) {
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--white);
  }
  .menu-toggle i { width: 17px; height: 1px; background: var(--white); transition: transform .2s; }
  .menu-toggle[aria-expanded=true] i:first-child { transform: translateY(3px) rotate(45deg); }
  .menu-toggle[aria-expanded=true] i:last-child { transform: translateY(-3px) rotate(-45deg); }
  /* Cerrado: visibility:hidden saca los enlaces del orden de tabulación */
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    padding: 0 var(--gutter);
    overflow: hidden;
    visibility: hidden;
    background: rgba(9, 9, 9, .97);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transition: max-height .3s, padding .3s, visibility 0s .3s;
  }
  .main-nav.is-open {
    max-height: 360px;
    padding-top: 10px;
    padding-bottom: 20px;
    visibility: visible;
    border-bottom: 1px solid var(--line);
    transition: max-height .3s, padding .3s;
  }
  .main-nav > a:not(.nav-cta) { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); font-size: 14px; }
  .nav-cta { margin-top: 12px; text-align: center; }
}

/* ---------- Tablet (≤ 900px) ---------- */

@media (max-width: 900px) {
  .hero { height: 720px; min-height: 680px; }
  .hero-image { left: 14%; }
  .hero-image img { height: 88%; left: 68%; transform: translate(-68%, -50%); }
  .hero-shade {
    background:
      linear-gradient(90deg, #090909 0%, rgba(9, 9, 9, .9) 25%, rgba(9, 9, 9, .5) 60%, rgba(9, 9, 9, .15) 100%),
      linear-gradient(0deg, #090909 0%, transparent 25%);
  }

  .procedure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .clinic { grid-template-columns: .9fr 1.1fr; gap: 5%; }
  .map-frame, .map-frame iframe { min-height: 370px; }

  .footer-main { grid-template-columns: 1.2fr .8fr .8fr; }
  .footer-location { grid-column: 2 / -1; }
}

/* ---------- Móvil (≤ 640px) ---------- */

@media (max-width: 640px) {
  :root { --gutter: 24px; }
  html { scroll-padding-top: 70px; }

  /* Header */
  .site-header { height: 68px; }
  .brand-mark { font-size: 22px; }

  /* Hero */
  /* La altura sigue a la pantalla para que el botón de WhatsApp quede visible sin hacer scroll */
  .hero { height: 760px; height: 100svh; min-height: 600px; max-height: 860px; align-items: flex-end; }
  .hero-image { inset: 0; opacity: .82; }
  .hero-image img { height: 82%; left: 78%; top: 4%; transform: translate(-78%, -4%); }
  .hero-shade {
    background:
      linear-gradient(0deg, #090909 4%, rgba(9, 9, 9, .98) 20%, rgba(9, 9, 9, .5) 56%, rgba(9, 9, 9, .05) 90%),
      linear-gradient(90deg, rgba(9, 9, 9, .3), transparent);
  }
  .hero-content { padding: 0 24px 74px; }
  .hero h1 { font-size: clamp(65px, 19vw, 100px); margin-bottom: 18px; }
  .hero-subtitle { margin-bottom: 23px; font-size: 15px; line-height: 1.55; }

  /* Elementos comunes */
  .eyebrow { margin-bottom: 16px; font-size: 11px; letter-spacing: .15em; }
  .button { min-height: 50px; padding: 13px 15px; gap: 20px; font-size: 13px; }
  .text-link { margin-top: 20px; font-size: 12px; }

  /* Presentación */
  .intro-note { display: block; padding-top: 90px; padding-bottom: 95px; }
  .intro-statement { margin-bottom: 21px; font-size: 35px; }
  .intro-copy { font-size: 16px; }
  .credentials { grid-template-columns: 1fr; margin-top: 56px; }
  .credentials li, .credentials li + li { padding: 20px 0; border-left: 0; }
  .credentials li + li { border-top: 1px solid rgba(255, 255, 255, .08); }
  .credentials strong { font-size: 24px; }

  /* Resultados */
  .results { padding-top: 80px; padding-bottom: 0; }
  .results-panel { grid-template-columns: 1fr; gap: 24px; padding: 40px 24px; }
  .results h2 { font-size: clamp(38px, 12.5vw, 49px); }
  .results-copy .button { width: 100%; }

  /* Procedimientos */
  .procedures { padding-top: 80px; padding-bottom: 84px; }
  .section-heading { display: block; margin-bottom: 42px; }
  .section-heading h2, .clinic h2, .hours h2 { font-size: clamp(38px, 12.5vw, 49px); }
  .section-heading > p { max-width: 380px; margin-top: 15px; font-size: 15px; }
  .procedure-category { margin-top: 24px; }
  .category-heading { padding: 16px 0; font-size: 20px; }
  .procedure-grid { grid-template-columns: 1fr; }
  .procedure-card { min-height: 0; padding: 23px 23px 19px; }
  .procedure-card h4 { margin-top: 17px; font-size: 20px; }
  .procedure-card p { margin-bottom: 22px; font-size: 15px; }

  /* Consultorio y horarios */
  .clinic { grid-template-columns: 1fr; gap: 36px; padding-top: 90px; padding-bottom: 90px; }
  .clinic-description { font-size: 16px; }
  .map-frame, .map-frame iframe { min-height: 310px; }
  .hours { grid-template-columns: 1fr; gap: 35px; padding-top: 84px; padding-bottom: 85px; }
  .hours-list > div { font-size: 15px; }

  /* Preguntas frecuentes */
  .faq { grid-template-columns: 1fr; gap: 35px; padding-top: 84px; padding-bottom: 90px; }
  .faq h2 { font-size: clamp(38px, 12.5vw, 49px); }
  .faq-list summary { padding: 18px 0; font-size: 18px; }

  /* Contacto */
  .contact {
    min-height: 450px;
    padding-top: 85px;
    padding-bottom: 85px;
    background-image:
      linear-gradient(180deg, rgba(5, 5, 5, .22), rgba(5, 5, 5, .38)),
      url('/public/images/hospital-contacto-800.webp');
  }
  .contact h2 { font-size: clamp(42px, 14vw, 58px); }

  /* Footer */
  .site-footer { padding-top: 40px; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 30px 18px; padding-bottom: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-location { grid-column: auto; }
  .footer-bottom { display: block; font-size: 12px; }
  .footer-bottom p { max-width: 340px; margin-top: 8px; text-align: left; }
  .legal { padding-top: 120px; padding-bottom: 80px; }
  .legal h2 { margin-top: 40px; font-size: 22px; }
  .floating-whatsapp { right: 17px; bottom: 17px; width: 48px; height: 48px; }
  .floating-whatsapp svg { width: 22px; height: 22px; }
}

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .intro { display: none; }
}
