/* ==========================================================================
   Dr. José Cotrina · Landing
   Brand: navy from the logo, light clinical blues, teal accent from scrubs.
   ========================================================================== */

:root {
  /* Brand primitives */
  --navy-950: #0a1424;
  --navy-900: #0f1c31;
  --navy-800: #14243d;   /* logo navy */
  --navy-700: #22385a;
  --blue-100: #e6eef9;
  --blue-50:  #f1f6fc;
  --teal-600: #0b7f7a;
  --teal-500: #12a19a;
  --teal-100: #d9f2f0;
  --amber:    #f2b630;

  /* Semantic tokens */
  --color-bg: #ffffff;
  --color-surface: var(--blue-50);
  --color-surface-2: var(--blue-100);
  --color-card: #ffffff;
  --color-text: #13223a;
  --color-text-muted: #4a5b73;
  --color-border: #dbe5f1;
  --color-primary: var(--navy-800);
  --color-primary-hover: var(--navy-700);
  --color-on-primary: #ffffff;
  --color-accent: var(--teal-600);
  --color-accent-soft: var(--teal-100);
  --color-error: #b42318;
  --color-success: #067647;
  --color-focus: #2e7cf6;

  /* Type */
  --font-display: "Roboto Slab", Georgia, serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Spacing (8pt) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* Shape & elevation */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --shadow-sm: 0 1px 2px rgb(15 28 49 / .06), 0 1px 3px rgb(15 28 49 / .08);
  --shadow-md: 0 8px 24px -8px rgb(15 28 49 / .16);
  --shadow-lg: 0 24px 48px -16px rgb(15 28 49 / .22);

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --header-h: 76px;

  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { margin: 0; color: var(--navy-900); text-wrap: balance; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; line-height: 1.15; }
h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.125rem; line-height: 1.35; }
p { margin: 0; }
a { color: inherit; }
em { font-style: italic; }

:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
@media (min-width: 768px) { .container { width: min(1200px, 100% - 64px); } }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 1000;
  background: var(--navy-800); color: #fff; padding: 12px 18px; border-radius: var(--r-sm);
  text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 18px; height: 18px; }
.ic-star { width: 16px; height: 16px; fill: var(--amber); stroke: var(--amber); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border: 1.5px solid transparent; border-radius: 999px;
  font: 700 .975rem/1 var(--font-body);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  touch-action: manipulation;
  transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.btn-sm { min-height: 42px; padding: 0 20px; font-size: .925rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); box-shadow: 0 6px 16px -6px rgb(20 36 61 / .5); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:active { background: var(--navy-950); }
.btn-ghost { background: #fff; color: var(--navy-800); border-color: var(--color-border); }
.btn-ghost:hover { border-color: var(--navy-800); }
.btn-ghost .ic { transition: transform .2s var(--ease-out); }
.btn-ghost:hover .ic { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgb(255 255 255 / .9);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--color-border); box-shadow: 0 4px 20px -12px rgb(15 28 49 / .18); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mono { height: 46px; width: auto; }
/* Wordmark «Dr. Jose Cotrina» in the logo's typeface (Montserrat Bold) */
.brand-name {
  font-family: 'Montserrat', var(--font-body); font-weight: 700; color: #223659;
  font-size: 1.32rem; line-height: 1; letter-spacing: -.005em; white-space: nowrap;
}
.brand-name--light { color: #fff; }

.main-nav ul { display: flex; gap: 4px; }
.main-nav a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--color-text-muted);
  border-radius: 999px; transition: color .2s, background-color .2s;
}
.main-nav a:not(.btn):hover { color: var(--navy-900); background: var(--color-surface); }
.main-nav a.is-active { color: var(--navy-900); background: var(--color-surface-2); }
.nav-cta-mobile { display: none; }

.header-actions { display: flex; align-items: center; gap: var(--s-2); }
.nav-toggle {
  display: none; width: 48px; height: 48px; align-items: center; justify-content: center;
  border: 1px solid var(--color-border); border-radius: 999px; background: #fff; color: var(--navy-800); cursor: pointer;
}

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: #fff; border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-md);
    padding: var(--s-4) 16px var(--s-5);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s var(--ease-out), transform .2s var(--ease-out), visibility 0s .2s;
  }
  .main-nav.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav a:not(.btn) { width: 100%; font-size: 1.05rem; padding: 0 16px; min-height: 52px; border-radius: var(--r-sm); }
  .nav-cta-mobile { display: flex; width: 100%; margin-top: var(--s-3); }
}
@media (max-width: 560px) {
  .header-cta { display: none; }
  .brand-name { font-size: 1.08rem; }
  .brand-mono { height: 38px; }
  /* Inner pages: the back button keeps only its arrow so the wordmark fits */
  .btn-back { padding: 0; width: 42px; }
  .btn-back .btn-label { display: none; }
}

/* ---------- Shared section ---------- */
.section { padding-block: var(--s-8); }
@media (min-width: 900px) { .section { padding-block: var(--s-9); } }
.section--tint { background: var(--color-surface); }

.section-head { margin-bottom: var(--s-7); }
.section-head h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
.section-head p { color: var(--color-text-muted); font-size: 1.05rem; max-width: 60ch; }
.section-head.center { text-align: center; }
.section-head.center h2 { max-width: 22ch; margin-inline: auto; }
.section-head.center p { margin: var(--s-4) auto 0; }
.section-head.split { display: grid; gap: var(--s-4); }
@media (min-width: 900px) {
  .section-head.split { grid-template-columns: 1.1fr 1fr; align-items: end; gap: var(--s-8); }
  .section-head.split h2 { max-width: 20ch; }
}
.section-head:not(.split):not(.center) h2 + p { margin-top: var(--s-4); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-accent); margin-bottom: var(--s-3);
}
.eyebrow--center { display: flex; justify-content: center; }
.eyebrow--light { color: #8fe0da; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); box-shadow: 0 0 0 4px rgb(18 161 154 / .18); }

.tag {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px;
  border: 1px solid var(--color-border); border-radius: 999px; background: #fff;
  font-size: .85rem; font-weight: 600; color: var(--color-text-muted);
}

/* ---------- Floating cards ---------- */
.float-card {
  position: absolute; display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  padding: 12px 14px;
}
.float-card strong { display: block; font-size: .925rem; color: var(--navy-900); line-height: 1.25; }
.float-card small { display: block; font-size: .8rem; color: var(--color-text-muted); }
.float-card > img { width: 40px; height: auto; padding: 6px; background: var(--color-surface); border-radius: 50%; box-sizing: content-box; }
.float-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--color-accent-soft); color: var(--teal-600); }
.chip-link {
  margin-left: 6px; display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--navy-800); border-radius: 999px; font-size: .8rem; font-weight: 700;
  text-decoration: none; color: var(--navy-800); transition: background-color .2s, color .2s;
}
.chip-link:hover { background: var(--navy-800); color: #fff; }

/* ---------- Hero ---------- */
.hero { padding-top: var(--s-4); }
.hero-panel {
  position: relative; overflow: hidden;
  display: grid; gap: var(--s-6);
  padding: var(--s-6) var(--s-5) 0;
  border-radius: var(--r-xl);
  background:
    radial-gradient(900px 500px at 85% 10%, rgb(203 223 247 / .9), transparent 60%),
    radial-gradient(600px 400px at 0% 100%, rgb(217 242 240 / .7), transparent 60%),
    linear-gradient(180deg, #f3f7fd, #eaf1fa);
}
.hero-copy { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.6rem); max-width: 15ch; }
.lead { margin-top: var(--s-4); font-size: 1.1rem; color: var(--color-text-muted); max-width: 46ch; }
.lead-sm { margin-top: var(--s-4); font-size: 1.05rem; color: var(--color-text-muted); max-width: 52ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

.rating-pill {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: var(--s-6); padding: 8px 14px 8px 10px; min-height: 44px;
  background: rgb(255 255 255 / .75); border: 1px solid var(--color-border); border-radius: 999px;
  text-decoration: none; font-size: .9rem; color: var(--color-text-muted);
  transition: border-color .2s;
}
.rating-pill:hover { border-color: var(--navy-800); }
.rating-pill strong { color: var(--navy-900); }
.stars { display: inline-flex; gap: 2px; }

.hero-stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: var(--s-5) var(--s-6); margin: var(--s-6) 0 0; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats dt { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); color: var(--navy-900); line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-stats dd { margin: 4px 0 0; font-size: .875rem; color: var(--color-text-muted); max-width: 14ch; line-height: 1.35; }

.hero-media { position: relative; margin-inline: calc(var(--s-5) * -1); }
.hero-media > video {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3.4; object-fit: cover; object-position: 80% 30%;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: #e3ecf8;
}
.float-card--top { top: 16px; left: 16px; }

/* Scroll-driven video affordances */
.scroll-cue {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 10px; border-radius: 999px;
  background: rgb(15 28 49 / .72); color: #fff; font-size: .8rem; font-weight: 700;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.scroll-cue.is-hidden { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.scroll-cue-mouse { position: relative; width: 16px; height: 24px; border: 2px solid rgb(255 255 255 / .9); border-radius: 10px; }
.scroll-cue-mouse::after {
  content: ""; position: absolute; left: 50%; top: 4px; width: 3px; height: 6px; margin-left: -1.5px;
  border-radius: 2px; background: #fff; animation: cue-wheel 1.4s var(--ease-out) infinite;
}
@keyframes cue-wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(7px); opacity: 0; } 100% { opacity: 0; } }
.video-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; z-index: 2; background: rgb(255 255 255 / .35); }
.video-progress span { display: block; height: 100%; background: var(--teal-500); transform-origin: left; transform: scaleX(0); }
.hero:not(.is-scrub) .scroll-cue, .hero:not(.is-scrub) .video-progress { display: none; }

/* Plays the greeting with audio on demand (sound needs a user gesture) */
.sound-btn {
  position: absolute; top: 16px; left: 16px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px 0 14px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--navy-800); box-shadow: var(--shadow-md);
  font: 700 .875rem/1 var(--font-body);
  touch-action: manipulation;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.sound-btn:hover { background: var(--navy-800); color: #fff; }
.sound-btn[aria-pressed="true"] { background: var(--navy-800); color: #fff; }
.hero.is-playing .scroll-cue { opacity: 0; pointer-events: none; }
.float-card--bottom { right: 16px; bottom: 16px; }

@media (max-width: 560px) {
  .hero-panel { padding-inline: 20px; }
  .hero-media { margin-inline: -20px; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
  .hero-stats dt { font-size: 1.3rem; }
  .hero-stats dd { font-size: .8rem; }
  .rating-pill { font-size: .85rem; gap: 8px; }
  .float-card--top { display: none; }
  .float-card--bottom { left: 16px; right: 16px; }
  .float-card--bottom .chip-link { margin-left: auto; }
}

@media (min-width: 1000px) {
  .hero-panel { grid-template-columns: 1.05fr 1fr; align-items: stretch; padding: 0 0 0 var(--s-8); gap: var(--s-6); min-height: 640px; }
  .hero-copy { align-self: center; padding-block: var(--s-8); }
  .hero-media { margin: 0; }
  .hero-media > video { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; border-radius: 0; object-position: 78% 30%; }
  .scroll-cue { top: 24px; right: 24px; }
  .sound-btn { top: 24px; left: 32px; }

  /* Pin the hero while the scroll track plays the video */
  .hero.is-scrub { height: calc(100vh - var(--header-h) + 110vh); padding-top: 0; }
  .hero.is-scrub .hero-sticky { position: sticky; top: var(--header-h); padding-top: var(--s-4); }
  .hero.is-scrub .hero-panel { height: calc(100vh - var(--header-h) - 32px); min-height: 600px; }
  .hero.is-scrub .hero-copy { padding-block: var(--s-6); }
  .hero-media::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 120px; z-index: 1; pointer-events: none;
    background: linear-gradient(90deg, #eef4fb, rgb(238 244 251 / 0));
  }
  .float-card--top { top: auto; bottom: 120px; left: -24px; z-index: 2; }
  .float-card--bottom { right: 32px; bottom: 32px; }
}

/* ---------- Trust strip ---------- */
.trust { padding-block: var(--s-6) 0; }
.trust-inner { display: grid; gap: var(--s-4); padding-bottom: var(--s-6); border-bottom: 1px solid var(--color-border); }
.trust-title { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.trust-list { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); }
.trust-list li { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy-700); font-size: .95rem; }
.trust-list .ic { color: var(--teal-600); width: 20px; height: 20px; }
@media (min-width: 1000px) { .trust-inner { justify-items: center; } .trust-list { justify-content: center; gap: var(--s-3) var(--s-7); } }

/* ---------- About ---------- */
.about-grid { display: grid; gap: var(--s-5); }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1fr 1.1fr; gap: var(--s-5); } }
.about-photo { position: relative; margin: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--color-surface-2); }
.about-photo > img { width: 100%; height: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; object-position: 50% 22%; }
.float-card--caption { left: 16px; bottom: 16px; right: auto; }
.about-card {
  display: flex; flex-direction: column; gap: var(--s-4); justify-content: center;
  padding: var(--s-6) var(--s-5); border-radius: var(--r-lg); background: var(--color-surface);
}
@media (min-width: 900px) { .about-card { padding: var(--s-7); } }
.about-card .tag { align-self: flex-start; }
.about-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; }
.about-card p { color: var(--color-text-muted); max-width: 62ch; }
.cred-list { display: grid; gap: var(--s-3); margin-top: var(--s-2); }
.cred-list li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: #fff; border-radius: var(--r-md); font-size: .95rem; color: var(--color-text-muted); }
.cred-list strong { color: var(--navy-900); }
.cred-list .ic { color: var(--teal-600); margin-top: 1px; }

/* ---------- Services ---------- */
.card-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.svc-card {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-5); background: #fff; border: 1px solid var(--color-border); border-radius: var(--r-lg);
  transition: border-color .25s var(--ease-out), box-shadow .25s var(--ease-out), transform .25s var(--ease-out);
}
.svc-card:hover { border-color: #bcd0e8; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.svc-card p { color: var(--color-text-muted); font-size: .95rem; }
.svc-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--color-surface); color: var(--navy-800); margin-bottom: var(--s-2); }
.svc-card--featured { background: var(--navy-800); border-color: var(--navy-800); }
.svc-card--featured h3 { color: #fff; }
.svc-card--featured p { color: #c9d6e8; }
.svc-card--featured .svc-icon { background: rgb(255 255 255 / .1); color: #8fe0da; }

/* ---------- Focus: detección precoz ---------- */
.focus-grid { display: grid; gap: var(--s-7); }
@media (min-width: 1000px) { .focus-grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); align-items: center; } }
.focus-copy h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); max-width: 20ch; }
.focus-list { display: grid; gap: var(--s-5); margin-top: var(--s-6); }
.focus-list li { display: flex; gap: var(--s-4); }
.focus-list p { color: var(--color-text-muted); margin-top: 4px; font-size: .975rem; }
.focus-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: var(--color-accent-soft); color: var(--teal-600); }

.focus-media { position: relative; border-radius: var(--r-xl); overflow: hidden; background: linear-gradient(180deg, #e3ecf8, #f3f7fd); }
.focus-media img { width: 100%; aspect-ratio: 4 / 4.6; object-fit: cover; object-position: 50% 20%; }
.stat-card {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4);
  padding: var(--s-4) var(--s-5); background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-lg);
}
.stat-card > div { display: flex; gap: 12px; align-items: center; }
.stat-card > div + div { border-left: 1px solid var(--color-border); padding-left: var(--s-4); }
.stat-card .ic { color: var(--teal-600); width: 28px; height: 28px; }
.stat-card strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; line-height: 1.1; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.stat-card span { display: block; font-size: .8rem; color: var(--color-text-muted); line-height: 1.3; }
@media (max-width: 480px) {
  .stat-card { grid-template-columns: 1fr; }
  .stat-card > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--color-border); padding-top: var(--s-3); }
  .stat-card > div > .ic { display: none; }
}

/* ---------- Conditions ---------- */
.cond-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.cond { display: flex; gap: 14px; align-items: flex-start; padding: var(--s-5) 20px; background: #fff; border-radius: var(--r-md); border: 1px solid var(--color-border); }
.cond .ic { color: var(--teal-600); margin-top: 2px; }
.cond h3 { font-size: 1.025rem; }
.cond p { color: var(--color-text-muted); font-size: .925rem; margin-top: 2px; }

/* ---------- Reviews ---------- */
.reviews { display: grid; gap: var(--s-5); }
@media (min-width: 900px) { .reviews { grid-template-columns: 380px 1fr; gap: var(--s-7); align-items: center; } }
.reviews-score {
  padding: var(--s-6); border-radius: var(--r-xl); color: #fff;
  background:
    radial-gradient(400px 260px at 100% 0%, rgb(18 161 154 / .35), transparent 70%),
    var(--navy-800);
}
.score { display: flex; align-items: baseline; gap: 4px; margin-top: var(--s-2); }
.score strong { font-family: var(--font-display); font-size: 4.5rem; line-height: 1; font-weight: 600; }
.score span { font-size: 1.25rem; color: #b8c7dc; }
.stars--lg .ic-star { width: 22px; height: 22px; }
.score-meta { margin-top: var(--s-3); color: #c9d6e8; font-size: .95rem; }
.score-badge { display: flex; align-items: center; gap: 8px; margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid rgb(255 255 255 / .14); font-weight: 700; font-size: .925rem; }
.score-badge .ic { color: var(--amber); }
.reviews-body h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
.themes { display: grid; gap: var(--s-4); margin: var(--s-6) 0; }
@media (min-width: 700px) { .themes { grid-template-columns: repeat(3, 1fr); } }
.themes li { display: flex; flex-direction: column; gap: 8px; padding: var(--s-5); border-radius: var(--r-md); background: var(--color-surface); }
.themes .ic { color: var(--teal-600); }
.themes p { color: var(--color-text-muted); font-size: .925rem; }

/* ---------- Locations ---------- */
.loc-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.loc-card { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); background: #fff; border-radius: var(--r-lg); border: 1px solid var(--color-border); }
.loc-city { align-self: flex-start; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-600); background: var(--color-accent-soft); padding: 4px 10px; border-radius: 999px; }
.loc-addr { display: flex; gap: 8px; color: var(--color-text-muted); font-size: .95rem; flex: 1; }
.loc-addr .ic { margin-top: 3px; color: var(--navy-700); }
.loc-card--online { background: var(--navy-800); border-color: var(--navy-800); }
.loc-card--online h3 { color: #fff; }
.loc-card--online .loc-addr { color: #c9d6e8; }
.loc-card--online .loc-addr .ic { color: #8fe0da; }
.loc-card--online .loc-city { background: rgb(255 255 255 / .1); color: #8fe0da; }
.loc-card--online .text-link { color: #fff; }
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--navy-800); text-decoration: none; align-self: flex-start; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.loc-notes { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3) var(--s-6); margin-top: var(--s-6); color: var(--color-text-muted); font-size: .95rem; }
.loc-notes li { display: flex; align-items: center; gap: 8px; }
.loc-notes .ic { color: var(--teal-600); }

/* ---------- Booking ---------- */
.booking { display: grid; border-radius: var(--r-xl); overflow: hidden; background: var(--color-surface); }
@media (min-width: 1000px) { .booking { grid-template-columns: 1fr 1.25fr; } }
.booking-aside { position: relative; min-height: 360px; background: var(--navy-800); color: #fff; overflow: hidden; }
.booking-aside img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.booking-aside::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(15 28 49 / .05) 25%, rgb(15 28 49 / .92) 75%); }
.booking-aside-copy { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; padding: var(--s-6) var(--s-5); gap: var(--s-3); }
@media (min-width: 1000px) { .booking-aside-copy { padding: var(--s-7); } .booking-aside { min-height: 0; } }
@media (max-width: 999px) { .booking-aside { min-height: 440px; } }
.booking-aside h2 { color: #fff; font-size: clamp(1.75rem, 1.2rem + 2vw, 2.4rem); }
.booking-aside p { color: #d6e0ee; }
.booking-aside ul { display: grid; gap: 6px; margin-top: var(--s-2); }
.booking-aside li { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; }
.booking-aside li .ic { color: #8fe0da; }

.booking-form { display: grid; gap: var(--s-4); padding: var(--s-6) var(--s-5); }
@media (min-width: 700px) { .booking-form { padding: var(--s-7); } }
.form-row { display: grid; gap: var(--s-4); }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; align-content: start; }
.field label { font-weight: 700; font-size: .925rem; color: var(--navy-900); }
.req { color: var(--color-error); }
.opt { font-weight: 500; color: var(--color-text-muted); }
.field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 16px;
  font: 500 1rem/1.4 var(--font-body); color: var(--color-text);
  background: #fff; border: 1.5px solid var(--color-border); border-radius: var(--r-sm);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b5c7dd; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--color-focus); box-shadow: 0 0 0 4px rgb(46 124 246 / .18); }
.field [aria-invalid="true"] { border-color: var(--color-error) !important; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 44px; cursor: pointer; }
.select-wrap .ic { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--color-text-muted); }
.field-help { font-size: .85rem; color: var(--color-text-muted); }
.field-error { font-size: .85rem; font-weight: 600; color: var(--color-error); }
.field-error:empty { display: none; }
.field--check { grid-template-columns: auto 1fr; column-gap: 12px; align-items: start; }
.field--check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--navy-800); cursor: pointer; }
.field--check label { font-weight: 500; font-size: .9rem; color: var(--color-text-muted); cursor: pointer; }
.field--check label a { color: var(--navy-800); font-weight: 700; }
.field--check .field-error { grid-column: 2; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-error-summary { padding: var(--s-4); border-radius: var(--r-sm); background: #fef3f2; border: 1px solid #fecdca; color: var(--color-error); font-size: .925rem; }
.form-error-summary ul { list-style: disc; padding-left: 20px; margin-top: 6px; }
.form-error-summary a { color: inherit; font-weight: 700; }

.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgb(255 255 255 / .35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .85; }
.btn[aria-busy="true"] .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-status { font-weight: 600; font-size: .95rem; }
.form-status:empty { display: none; }
.form-status.is-success { color: var(--color-success); padding: var(--s-4); background: #ecfdf3; border: 1px solid #abefc6; border-radius: var(--r-sm); }
.form-status.is-error { color: var(--color-error); }

/* ---------- FAQ ---------- */
.faq-wrap { display: grid; gap: var(--s-5); }
@media (min-width: 1000px) { .faq-wrap { grid-template-columns: 1fr 1.6fr; gap: var(--s-8); align-items: start; } .faq-wrap .section-head { position: sticky; top: calc(var(--header-h) + 32px); } }
.faq-wrap .section-head a { color: var(--navy-800); font-weight: 700; }
.faq-list { display: grid; gap: var(--s-3); }
.faq { background: #fff; border: 1px solid var(--color-border); border-radius: var(--r-md); transition: border-color .2s; }
.faq[open] { border-color: #b5c7dd; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 60px; padding: 16px 20px; cursor: pointer; list-style: none;
  font-weight: 700; color: var(--navy-900);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--color-text-muted); transition: transform .25s var(--ease-out); }
.faq[open] summary .ic { transform: rotate(180deg); }
.faq p { padding: 0 20px 20px; color: var(--color-text-muted); max-width: 70ch; }

/* Mini conversation inside an FAQ answer (payment help) */
.faq-chat { display: flex; flex-direction: column; gap: 10px; padding: 0 20px 20px; }
.faq .chat-bubble, .faq .chat-bubble p { padding: 0; margin: 0; max-width: none; }
.chat-bubble { max-width: min(85%, 560px) !important; padding: 12px 16px !important; border-radius: 18px; font-size: .95rem; line-height: 1.55; }
.chat-bubble--patient { align-self: flex-end; background: var(--navy-800); color: #fff !important; border-bottom-right-radius: 6px; }
.chat-bubble--doctor { align-self: flex-start; display: grid; gap: 12px; justify-items: start; background: var(--color-surface); color: var(--color-text-muted); border-bottom-left-radius: 6px; }
.chat-bubble--doctor .btn { min-height: 44px; }

.pay-return-retry { margin-top: 10px; }
.pay-return-actions { margin-top: 10px; }
.pay-return-countdown { font-size: .85rem !important; font-weight: 600; color: var(--teal-600) !important; }
.pay-return-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #b8c7dc; padding-top: var(--s-8); }
.footer-grid { display: grid; gap: var(--s-7); padding-bottom: var(--s-7); }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.2fr 3fr; gap: var(--s-8); } }
.footer-cols { display: grid; gap: var(--s-6); }
@media (min-width: 700px) { .footer-cols { grid-template-columns: 1fr 1.2fr 1.3fr; } }
.footer-notice { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid rgb(255 255 255 / .1); }
.footer-notice-title { font-family: var(--font-body); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; }
.footer-notice p { margin-top: 6px; max-width: 78ch; font-size: .825rem; line-height: 1.65; color: #98a9c2; }
.footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: var(--s-4); }
.footer-logo img:first-child { height: 52px; width: auto; }
.footer-logo .brand-name { font-size: 1.45rem; }
.footer-brand p { max-width: 36ch; font-size: .95rem; }
.footer-title { font-family: var(--font-body); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; margin-bottom: var(--s-3); }
.footer-links { display: grid; gap: 4px; font-size: .95rem; }
.footer-links li { min-height: 32px; display: flex; align-items: center; }
.footer-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; text-decoration: none; transition: color .2s; overflow-wrap: anywhere; }
.footer-links a:hover { color: #fff; }
.social { display: flex; gap: var(--s-2); margin-top: var(--s-5); }
.social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .16); color: #fff; transition: background-color .2s, border-color .2s; }
.social a:hover { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .3); }
.social .ic { width: 20px; height: 20px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); padding-block: var(--s-5) calc(var(--s-5) + 76px); border-top: 1px solid rgb(255 255 255 / .1); font-size: .85rem; }
@media (min-width: 768px) { .footer-bottom { padding-bottom: var(--s-5); } }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); }
.footer-bottom a { text-decoration: none; display: inline-flex; min-height: 32px; align-items: center; }
.footer-bottom a:hover { color: #fff; }

/* ---------- Mobile booking bar ---------- */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgb(255 255 255 / .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border);
  transform: translateY(110%); transition: transform .3s var(--ease-out);
}
.mobile-bar.is-visible { transform: none; }
@media (min-width: 768px) { .mobile-bar { display: none; } }

/* ---------- Booking CTA + Tally pop-up ---------- */
.booking-cta { display: flex; flex-direction: column; justify-content: center; gap: var(--s-4); padding: var(--s-6) var(--s-5); }
@media (min-width: 700px) { .booking-cta { padding: var(--s-7); } }
.booking-cta-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--navy-800); box-shadow: var(--shadow-sm); }
.booking-cta h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
.booking-cta > p { color: var(--color-text-muted); max-width: 52ch; }
.booking-cta-list { display: grid; gap: 10px; }
.booking-cta-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--color-text); font-weight: 600; font-size: .95rem; }
.booking-cta-list .ic { color: var(--teal-600); margin-top: 3px; }
.booking-cta .btn { margin-top: var(--s-2); min-height: 54px; font-size: 1.05rem; }
.booking-cta-note { font-size: .85rem; color: var(--color-text-muted); }
.booking-cta-note a { color: var(--navy-800); font-weight: 700; overflow-wrap: anywhere; }

html.has-modal { overflow: hidden; }
.booking-dialog {
  width: min(720px, 100% - 24px); height: min(88vh, 860px); max-height: none; padding: 0;
  border: 0; border-radius: var(--r-lg); background: #fff; color: var(--color-text);
  box-shadow: 0 30px 80px -20px rgb(10 20 36 / .55); overflow: hidden;
}
.booking-dialog[open] { display: flex; flex-direction: column; animation: cc-pop .25s var(--ease-out); }
.booking-dialog::backdrop { background: rgb(10 20 36 / .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.booking-dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: 16px 20px 16px 24px; border-bottom: 1px solid var(--color-border); background: var(--color-surface);
}
.booking-dialog-head .eyebrow { margin-bottom: 2px; }
.booking-dialog-head h2 { font-size: 1.35rem; }
.booking-dialog-close {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none; cursor: pointer;
  border: 1px solid var(--color-border); border-radius: 14px; background: #fff; color: var(--navy-800);
  transition: border-color .2s, background-color .2s;
}
.booking-dialog-close:hover { border-color: var(--navy-800); }
.booking-dialog-body { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px 20px 24px; -webkit-overflow-scrolling: touch; }
.booking-dialog-body iframe { display: block; width: 100%; border: 0; }
.booking-dialog-loading { position: absolute; top: 32px; left: 0; right: 0; text-align: center; color: var(--color-text-muted); font-weight: 600; }
/* Step progress (2 steps) */
.booking-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 24px 0; background: var(--color-surface); }
.booking-steps span { height: 4px; border-radius: 4px 4px 0 0; background: var(--color-border); transition: background-color .3s var(--ease-out); }
.booking-steps span:nth-child(1),
.booking-dialog[data-step="calendar"] .booking-steps span:nth-child(2),
.booking-dialog[data-step="payment"] .booking-steps span { background: var(--teal-500); }

/* Step 3 · payment */
.booking-pay { max-width: 760px; margin-inline: auto; padding: var(--s-5) var(--s-2) var(--s-6); }
.booking-pay-intro { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); text-align: center; }
.booking-pay-intro h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); }
.booking-pay-intro > p { color: var(--color-text-muted); max-width: 56ch; }
.booking-pay-icon { width: 64px; height: 64px; }
.booking-pay-icon .ic { width: 30px; height: 30px; stroke-width: 2; }
.booking-pay-price { display: inline-flex; align-items: baseline; gap: 12px; padding: 10px 18px; border-radius: 999px; background: var(--color-surface); }
.booking-pay-price span { font-size: .9rem; color: var(--color-text-muted); }
.booking-pay-price strong { font-family: var(--font-display); font-size: 1.35rem; color: var(--navy-900); }
.booking-pay-hint { margin-top: var(--s-5); text-align: center; font-size: .9rem; font-weight: 600; color: var(--teal-600); }
.booking-pay-options { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
@media (min-width: 640px) { .booking-pay-options { grid-template-columns: 1fr 1fr; } }
.pay-option { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); border: 1.5px solid var(--color-border); border-radius: var(--r-md); background: #fff; }
.pay-option.is-recommended { border-color: var(--teal-500); box-shadow: 0 0 0 4px rgb(18 161 154 / .1); }
.pay-option-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.pay-option h4 { margin: 0; font-size: 1.05rem; color: var(--navy-900); }
.pay-option p { flex: 1; font-size: .9rem; color: var(--color-text-muted); }
.pay-option:not(.is-recommended) .btn { background: #fff; color: var(--navy-800); border-color: var(--navy-800); box-shadow: none; }
.pay-option:not(.is-recommended) .btn:hover { background: var(--color-surface); }
.pay-badge { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--teal-600); background: var(--teal-100); padding: 4px 10px; border-radius: 999px; }
.pay-region { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 2px; }
.pay-trust { display: grid; gap: 6px; }
.pay-trust li { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--navy-700); }
.pay-trust .ic { color: var(--teal-600); }
.pay-option .btn .ic { width: 18px; height: 18px; }
.pay-error { font-size: .85rem; font-weight: 600; color: var(--color-error); }
.pay-error a { color: inherit; }
/* Bold link: no return to the site, so the patient confirms on WhatsApp */
.pay-followup { display: grid; gap: 8px; padding: var(--s-4); border-radius: var(--r-md); background: var(--teal-100); text-align: center; animation: cc-pop .3s var(--ease-out); }
.pay-followup[hidden] { display: none; }
.pay-followup strong { color: var(--navy-900); }
.pay-followup p { font-size: .875rem; color: var(--navy-800); }
.pay-option .pay-followup .btn-whatsapp { background: #157f4a; color: #fff; border-color: #157f4a; box-shadow: none; }
.pay-option .pay-followup .btn-whatsapp:hover { background: #106a3d; }
.pay-followup-retry { font-size: .8rem; font-weight: 700; color: var(--navy-800); }
.pay-secure-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: var(--s-4); font-size: .8rem; color: var(--color-text-muted); text-align: center; }
.pay-secure-note .ic { color: var(--teal-600); flex: none; }
.pay-secure-note a { color: var(--navy-800); font-weight: 700; }
.loc-notes a { color: var(--navy-800); font-weight: 700; }

/* Notice after returning from Mercado Pago (?pago=…) */
.pay-return {
  position: fixed; top: calc(var(--header-h) + 12px); left: 50%; z-index: 250; transform: translateX(-50%);
  display: flex; align-items: flex-start; gap: var(--s-3); width: min(560px, 100% - 24px);
  padding: 16px 16px 16px 20px; border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-lg);
  border-left: 5px solid var(--teal-500); animation: cc-pop .3s var(--ease-out);
}
.pay-return--pendiente { border-left-color: var(--amber); }
.pay-return--error { border-left-color: var(--color-error); }
.pay-return > div { flex: 1; }
.pay-return strong { display: block; color: var(--navy-900); }
.pay-return p { margin-top: 2px; font-size: .9rem; color: var(--color-text-muted); }
.pay-return button { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 10px; background: var(--color-surface); color: var(--navy-800); cursor: pointer; }

.booking-pay-notes { display: grid; gap: 10px; margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--color-border); }
.booking-pay-notes li { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; color: var(--color-text-muted); }
.booking-pay-notes .ic { color: var(--teal-600); margin-top: 2px; }
.booking-pay-notes a { color: var(--navy-800); font-weight: 700; }

.booking-view[hidden] { display: none !important; }

/* Success message between Tally and Cal.com */
.booking-success { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); min-height: 100%; padding: var(--s-7) var(--s-4); text-align: center; }
.booking-success-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--teal-100); color: var(--teal-600); animation: success-pop .45s var(--ease-out); }
.booking-success-icon .ic { width: 38px; height: 38px; stroke-width: 2.5; }
.booking-success h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
.booking-success p { color: var(--color-text-muted); max-width: 42ch; }
.booking-success-loading { display: inline-flex; align-items: center; gap: 10px; margin-top: var(--s-2); font-weight: 700; color: var(--navy-800) !important; }
.spinner--navy { display: inline-block; border-color: rgb(20 36 61 / .2); border-top-color: var(--navy-800); }
@keyframes success-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }

/* Cal.com agenda */
.booking-dialog[data-step="calendar"] { width: min(1060px, 100% - 24px); }
.booking-cal { width: 100%; min-height: 560px; }
.booking-cal-fallback { margin-top: var(--s-3); text-align: center; font-size: .85rem; color: var(--color-text-muted); }
.booking-cal-fallback a { color: var(--navy-800); font-weight: 700; }

@media (max-width: 639px) {
  .booking-steps { padding: 0 16px; }
  .booking-dialog[data-step="calendar"] { width: 100vw; }
  .booking-dialog { inset: 0; width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; border-radius: 0; margin: 0; }
  .booking-dialog-body { padding: 8px 12px 24px; }
}

/* ---------- Cookie consent (built by cookies.js) ---------- */
.cc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 28px; border-radius: 999px; border: 1.5px solid transparent;
  font: 700 1rem/1 var(--font-body); white-space: nowrap; cursor: pointer; touch-action: manipulation;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out);
}
.cc-btn-primary { background: #fff; color: var(--navy-900); }
.cc-btn-primary:hover { background: var(--teal-100); }
.cc-btn-outline { background: transparent; color: #fff; border-color: rgb(255 255 255 / .55); }
.cc-btn-outline:hover { border-color: #fff; background: rgb(255 255 255 / .08); }
.cookie-bar :focus-visible, .cookie-dialog :focus-visible { outline-color: #8fe0da; }

/* First layer: full-width bar */
.cookie-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 300;
  display: grid; gap: var(--s-4);
  padding: 20px; border-radius: var(--r-lg);
  /* 50% navy: the page shows through. The backdrop is dimmed (not hidden)
     so white text keeps AA contrast even over light sections. */
  background: rgb(10 20 36 / .5); color: #fff;
  border: 1px solid rgb(255 255 255 / .14); box-shadow: 0 24px 60px -12px rgb(0 0 0 / .45);
  backdrop-filter: blur(3px) brightness(.55); -webkit-backdrop-filter: blur(3px) brightness(.55);
  opacity: 0; transform: translateY(16px);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.cookie-bar.is-visible { opacity: 1; transform: none; }
.cookie-bar-title { color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.cookie-bar-text p { margin-top: 6px; font-size: .9rem; line-height: 1.55; color: #e3eaf4; }
.cookie-bar-text a { color: #8fe0da; font-weight: 700; }
.cookie-bar-actions { display: flex; gap: var(--s-3); }
.cookie-bar-actions .cc-btn { flex: 1 1 0; }
@media (min-width: 900px) {
  .cookie-bar { left: 24px; right: 24px; bottom: 24px; grid-template-columns: 1fr auto; align-items: center; gap: var(--s-7); padding: 28px 40px; border-radius: var(--r-xl); }
  .cookie-bar-text p { font-size: .975rem; max-width: 95ch; }
  .cookie-bar-actions .cc-btn { flex: 0 0 auto; min-width: 150px; }
}

/* Second layer: settings dialog */
.cookie-dialog {
  width: min(600px, 100% - 24px); max-height: min(86vh, 760px); padding: 0;
  border: 1px solid rgb(255 255 255 / .12); border-radius: var(--r-lg);
  background: var(--navy-950); color: #fff; box-shadow: 0 30px 80px -20px rgb(0 0 0 / .6);
  overflow: hidden;
}
.cookie-dialog[open] { display: flex; flex-direction: column; animation: cc-pop .25s var(--ease-out); }
.cookie-dialog::backdrop { background: rgb(10 20 36 / .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes cc-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.cookie-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: 20px 24px; border-bottom: 1px solid rgb(255 255 255 / .1); }
.cookie-dialog-head h2 { color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.cookie-dialog-close {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none;
  border: 1px solid rgb(255 255 255 / .3); border-radius: 14px; background: transparent; color: #fff; cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.cookie-dialog-close:hover { background: rgb(255 255 255 / .08); border-color: #fff; }
.cookie-dialog svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cookie-dialog-body { padding: 20px 24px; overflow-y: auto; overscroll-behavior: contain; }
.cookie-dialog-body h3 { color: #fff; font-size: 1.05rem; }
.cookie-dialog-body > p { margin-top: 6px; color: #c9d6e8; font-size: .95rem; }
.cookie-dialog-body a { color: #8fe0da; font-weight: 700; }
.cookie-cats { display: grid; gap: var(--s-3); margin-top: var(--s-5); }
.cookie-cat { border: 1px solid rgb(255 255 255 / .16); border-radius: var(--r-md); overflow: hidden; }
.cookie-cat-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 8px 16px 8px 8px; }
.cookie-cat-toggle {
  display: flex; align-items: center; gap: 12px; flex: 1; min-height: 48px; padding: 0 8px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: #fff; text-align: left; cursor: pointer;
  font: 700 1rem/1.3 var(--font-body);
}
.cookie-cat-chevron { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: rgb(255 255 255 / .08); }
.cookie-cat-chevron svg { width: 18px; height: 18px; transition: transform .25s var(--ease-out); }
.cookie-cat-toggle[aria-expanded="true"] .cookie-cat-chevron svg { transform: rotate(180deg); }
.cookie-cat-desc { padding: 14px 20px 16px; border-top: 1px solid rgb(255 255 255 / .12); }
.cookie-cat-desc p { color: #c9d6e8; font-size: .925rem; }
.cookie-dialog-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); padding: 16px 24px 20px; border-top: 1px solid rgb(255 255 255 / .1); }
.cookie-dialog-foot .cc-btn { flex: 1 1 180px; }
@media (min-width: 640px) { .cookie-dialog-foot .cc-btn { flex: 0 0 auto; } }

/* Switch: native checkbox (role=switch) under a custom track */
.cc-switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.cc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.cc-switch-track { position: relative; display: block; width: 60px; height: 34px; border-radius: 999px; background: rgb(255 255 255 / .14); transition: background-color .2s var(--ease-out); }
.cc-switch-thumb {
  position: absolute; top: 3px; left: 3px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: #6b7a90; color: #fff; transition: transform .2s var(--ease-out), background-color .2s var(--ease-out);
}
.cc-switch-thumb svg { position: absolute; width: 16px; height: 16px; }
.cc-switch .cc-on { opacity: 0; }
.cc-switch input:checked + .cc-switch-track { background: var(--teal-500); }
.cc-switch input:checked + .cc-switch-track .cc-switch-thumb { transform: translateX(26px); background: #fff; color: var(--teal-600); }
.cc-switch input:checked + .cc-switch-track .cc-on { opacity: 1; }
.cc-switch input:checked + .cc-switch-track .cc-off { opacity: 0; }
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch input:disabled + .cc-switch-track { background: #cdd6e2; }
.cc-switch input:disabled + .cc-switch-track .cc-switch-thumb { background: #8794a8; color: #fff; }
.cc-switch input:focus-visible + .cc-switch-track { outline: 3px solid #8fe0da; outline-offset: 3px; }

.link-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; display: inline-flex; min-height: 32px; align-items: center; }
.link-button:hover { color: #fff; }

/* ---------- Legal page ---------- */
.legal-hero { padding-block: var(--s-7) var(--s-6); background: var(--color-surface); }
.legal-hero h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
.legal-hero p { margin-top: var(--s-3); color: var(--color-text-muted); }
.legal-layout { display: grid; gap: var(--s-6); padding-block: var(--s-7) var(--s-8); }
.legal-layout > * { min-width: 0; } /* the wide cookie table scrolls inside its box on phones */
@media (min-width: 1000px) { .legal-layout { grid-template-columns: 240px 1fr; gap: var(--s-8); align-items: start; } }
.legal-toc { display: none; }
@media (min-width: 1000px) {
  .legal-toc { display: block; position: sticky; top: calc(var(--header-h) + 24px); }
  .legal-toc p { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--s-3); }
  .legal-toc a { display: block; padding: 6px 0; font-size: .925rem; font-weight: 600; color: var(--color-text-muted); text-decoration: none; }
  .legal-toc a:hover { color: var(--navy-900); }
}
.legal-content { max-width: 72ch; }
.legal-content section { padding-top: var(--s-6); scroll-margin-top: calc(var(--header-h) + 16px); }
.legal-content section:first-child { padding-top: 0; }
.legal-content h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); margin-bottom: var(--s-3); }
.legal-content h3 { margin: var(--s-4) 0 var(--s-2); }
.legal-content p, .legal-content li { color: var(--color-text-muted); }
.legal-content p + p { margin-top: var(--s-3); }
.legal-content ul { list-style: disc; padding-left: 22px; margin-top: var(--s-3); display: grid; gap: 6px; }
.legal-content a { color: var(--navy-800); font-weight: 700; overflow-wrap: anywhere; }
.legal-content strong { color: var(--navy-900); }
.legal-card { margin-top: var(--s-3); padding: var(--s-5); border-radius: var(--r-md); background: var(--color-surface); }
.legal-card dl { display: grid; gap: 10px; margin: 0; }
.legal-card div { display: grid; gap: 2px; }
@media (min-width: 640px) { .legal-card div { grid-template-columns: 200px 1fr; gap: var(--s-4); } }
.legal-card dt { font-weight: 700; color: var(--navy-900); }
.legal-card dd { margin: 0; color: var(--color-text-muted); }
.todo { background: #fff4d6; color: #7a5300; padding: 0 4px; border-radius: 4px; font-weight: 700; }
.table-wrap { margin-top: var(--s-4); overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--r-md); }
.legal-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: .9rem; }
.legal-table th, .legal-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--color-border); }
.legal-table th { background: var(--color-surface); color: var(--navy-900); font-weight: 700; }
.legal-table td { color: var(--color-text-muted); }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table code { font-size: .85rem; color: var(--navy-800); }
.legal-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-4); }
/* Links inside legal text are navy; keep primary buttons readable. */
.legal-content .legal-actions .btn-primary { color: #fff; font-weight: 600; }
.legal-content .legal-actions .btn-primary:hover,
.legal-content .legal-actions .btn-primary:focus-visible { background: #fff; color: var(--navy-900); border-color: var(--navy-800); font-weight: 800; }
.legal-footer { padding-top: 0; }
.legal-footer .footer-bottom { padding-bottom: var(--s-5); border-top: 0; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; }

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

/* ---------- Sobre el doctor (/sobre-el-doctor) ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.bio-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(360px, 62vh, 620px);
  display: flex; align-items: flex-end;
  background: var(--navy-950);
}
.bio-hero-img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 75% 30%;
}
.bio-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgb(10 20 36 / .88) 0%, rgb(10 20 36 / .6) 45%, rgb(10 20 36 / .25) 100%),
    linear-gradient(0deg, rgb(10 20 36 / .55), transparent 55%);
}
.bio-hero-inner { padding-block: var(--s-8); }
.bio-hero h1 {
  color: #fff; font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.5rem); max-width: 14ch;
}

.bio-story-inner { max-width: 860px; }
.bio-story-inner > p { font-size: 1.125rem; line-height: 1.75; color: var(--color-text); }
.bio-story-inner > p + p { margin-top: var(--s-6); }

.bio-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4);
  margin: var(--s-7) 0 var(--s-6);
}
@media (min-width: 760px) { .bio-stats { grid-template-columns: repeat(4, 1fr); } }
.bio-stats div {
  display: flex; flex-direction: column; gap: 4px;
  padding: var(--s-5); border: 1px solid var(--color-border); border-radius: var(--r-md); background: var(--color-surface);
}
.bio-stats dt { font: 700 clamp(1.5rem, 1.2rem + 1vw, 2rem)/1.1 var(--font-display); color: var(--navy-800); }
.bio-stats dd { margin: 0; color: var(--color-text-muted); font-size: .925rem; line-height: 1.35; }

.society-list { border-top: 1px solid var(--navy-900); }
.society {
  display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: var(--s-2) var(--s-5);
  padding-block: var(--s-5); border-bottom: 1px solid var(--navy-900);
}
@media (min-width: 760px) {
  .society { grid-template-columns: 200px 1fr 270px; gap: var(--s-6); }
}
.society-logo {
  grid-row: span 2;
  display: grid; place-items: center; height: 72px; padding: 10px;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--r-sm);
}
@media (min-width: 760px) { .society-logo { grid-row: auto; height: 112px; padding: 12px 16px; } }
.society-logo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.society-name { font: 500 clamp(1.1rem, .95rem + .8vw, 1.6rem)/1.25 var(--font-body); color: var(--navy-900); }
.society-since { color: var(--color-text-muted); font-size: .95rem; }

.newsletter-card {
  position: relative; overflow: hidden;
  display: grid; gap: var(--s-6);
  background: var(--amber); border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-5) 0;
}
@media (min-width: 860px) {
  .newsletter-card { grid-template-columns: 1.4fr 1fr; align-items: center; padding: var(--s-7) 0 0 var(--s-7); overflow: visible; margin-top: var(--s-7); }
}
.newsletter-copy { padding-bottom: var(--s-6); }
@media (min-width: 860px) { .newsletter-copy { padding-bottom: var(--s-7); } }
.newsletter-copy h2 { color: #fff; font-family: var(--font-body); font-weight: 800; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1.2; max-width: 24ch; text-shadow: 0 1px 2px rgb(10 20 36 / .18); }
.newsletter-sub { margin-top: var(--s-5); color: #fff; font-weight: 800; font-size: 1.1rem; line-height: 1.35; text-shadow: 0 1px 2px rgb(10 20 36 / .18); }
.newsletter-btn { margin-top: var(--s-6); white-space: normal; text-align: center; }
.newsletter-photo {
  justify-self: center; align-self: end;
  width: min(320px, 80%); aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 15%;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
@media (min-width: 860px) {
  .newsletter-photo { width: min(340px, 85%); margin-top: calc(-1 * var(--s-8)); box-shadow: var(--shadow-lg); }
}
.about-more { margin-top: var(--s-6); }

/* ---------- Cinta de logos de sociedades (portada) ---------- */
.logo-ribbon { padding-block: var(--s-7); border-block: 1px solid var(--color-border); background: #fff; }
.logo-ribbon-title { text-align: center; font-weight: 700; color: var(--color-text-muted); margin-bottom: var(--s-5); }
.logo-ribbon-title a { color: var(--color-accent); }
.logo-ribbon-viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.logo-ribbon-track { display: flex; width: max-content; animation: logo-ribbon 42s linear infinite; }
.logo-ribbon-viewport:hover .logo-ribbon-track { animation-play-state: paused; }
.logo-ribbon-list { display: flex; align-items: center; gap: clamp(40px, 6vw, 88px); padding-right: clamp(40px, 6vw, 88px); }
.logo-ribbon-list img { height: clamp(48px, 4vw + 28px, 72px); width: auto; max-width: 220px; object-fit: contain; }
@keyframes logo-ribbon { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .logo-ribbon-track { animation: none; width: auto; }
  .logo-ribbon-list { flex-wrap: wrap; justify-content: center; padding: 0 16px; }
  .logo-ribbon-list[aria-hidden="true"] { display: none; }
  .logo-ribbon-viewport { -webkit-mask-image: none; mask-image: none; }
}
