/* ============================================================
   Dr. Joel Gambín — Traumatología y artroscopia deportiva
   Sistema de diseño v4 — paleta "piedra y mar" elegida por Joel
   Pale Mist #C0C8CA · Deep Harbor #2B4851 · píldoras oscuras · Lato
   ============================================================ */

:root {
  --bg: #FFFFFF;
  --bg-soft: #E9EDEE;
  --head: #2B4851;
  --ink: #26333A;
  --muted: #5D6B71;
  --line: #D8DEE0;
  --sky: #6E929F;
  --teal: #3E6F7E;
  --panel: #223B44;
  --on-panel: #C6D2D6;
  --btn: #1C2E35;
  --wa: #1FAF5F;
  --r-card: 20px;
  --shadow: 0 10px 30px rgba(43, 72, 81, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Lato", "Segoe UI", system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.16; text-wrap: balance; margin: 0; font-weight: 700; color: var(--head); }
h1 { font-size: clamp(34px, 5.2vw, 52px); }
h2 { font-size: clamp(27px, 3.6vw, 38px); }
h3 { font-size: 19px; }
p { margin: 0 0 16px; max-width: 64ch; }
a { color: var(--head); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }
strong { font-weight: 700; }
ul { padding-left: 20px; }
li { margin: 6px 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 740px; }

.eyebrow {
  font-size: 17px;
  font-weight: 700;
  color: var(--sky);
  margin: 0 0 14px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; line-height: 1.1; }
.brand .mark { width: 40px; height: 40px; display: block; }
.brand .btext { display: flex; flex-direction: column; }
.brand .name { font-weight: 800; font-size: 19px; color: var(--head); }
.brand .tagline { font-size: 9.5px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--teal); margin-top: 3px; }
@media (max-width: 420px) { .brand .tagline { display: none; } }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--teal); }
.nav .lang { font-size: 12.5px; font-weight: 800; color: var(--head); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 13px; }
.nav .lang:hover { color: var(--teal); border-color: var(--sky); }
.nav .nav-app { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 800; color: var(--head); border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 14px; white-space: nowrap; }
.nav .nav-app svg { width: 15px; height: 15px; display: block; }
.nav .nav-app:hover { color: var(--teal); border-color: var(--sky); }
.nav-toggle { display: none; background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 700; cursor: pointer; color: var(--head); font-family: inherit; }
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 10px 24px 18px;
    gap: 2px;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 2px; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: none; }
  .nav .lang { text-align: center; margin-top: 10px; }
  .nav .nav-app { justify-content: center; margin-top: 12px; padding: 11px 14px; border-bottom: 1.5px solid var(--line); }
}

/* ---------- Botones (píldoras negras, como la referencia) ---------- */
.btn {
  display: inline-block;
  background: var(--btn);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 30px;
  border-radius: 999px;
  border: 1.5px solid var(--btn);
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:hover { opacity: 0.88; color: #fff; transform: translateY(-1px); }
.btn.ghost { background: #fff; color: var(--head); border-color: var(--head); }
.btn.ghost:hover { color: var(--teal); border-color: var(--teal); opacity: 1; }
.btn.on-dark { border-color: var(--btn); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--bg-soft) 0%, #F5F7F7 70%, #FFFFFF 100%);
  padding: 76px 0 56px;
}
.hero-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 56px; align-items: center; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } }
.hero .lead { font-size: 18.5px; color: var(--ink); max-width: 50ch; margin: 18px 0 28px; }
.hero .lead .places { color: var(--muted); }
.cred-line { margin: 30px 0 0; padding-top: 18px; border-top: 1px solid rgba(43, 72, 81, 0.14); font-size: 12.5px; letter-spacing: 0.04em; color: var(--muted); max-width: none; }

.portrait {
  background: linear-gradient(170deg, #DFE5E6 0%, #C0C8CA 100%);
  border-radius: 24px;
  aspect-ratio: 3 / 3.3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #56676D;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 20px;
  box-shadow: var(--shadow);
}

/* ---------- Tarjetas dúo (blanca + panel oscuro) ---------- */
.duo { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 24px; margin-top: 44px; }
@media (max-width: 820px) { .duo { grid-template-columns: 1fr; } }
.duo-white, .duo-dark { border-radius: var(--r-card); padding: 32px 34px; box-shadow: var(--shadow); }
.duo-white { background: #fff; }
.duo-dark { background: var(--panel); color: var(--on-panel); display: flex; flex-direction: column; }
.duo-dark .bw-frame { flex: 1; }
.duo-dark .bw-frame iframe, .duo-dark .bw-frame > div { display: block; margin: 0 auto; max-width: 100%; }
.duo-dark h3, .duo-white h3 { font-size: 22px; margin-bottom: 12px; }
.duo-dark h3 { color: #fff; }
.duo-dark p { color: var(--on-panel); font-size: 15.5px; }
.duo-white .go { font-weight: 700; text-decoration: none; }
.duo-white .go:hover { color: var(--teal); }
.duo-dark .bw-frame { background: #fff; border-radius: 14px; padding: 8px; margin-top: 18px; }
.duo-dark .bw-frame .zl-url { color: var(--head); font-weight: 700; }
.duo-dark .bw-note { color: var(--on-panel); }
.duo-dark .bw-note a { color: #fff; }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: 8px 0 8px 34px; position: relative; font-weight: 600; color: var(--ink); }
.check-list li a { color: inherit; text-decoration: none; border-bottom: 1.5px solid rgba(43, 72, 81, 0.22); transition: color 0.15s ease, border-color 0.15s ease; }
.check-list li a:hover { color: var(--teal); border-bottom-color: var(--teal); }
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--teal);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Secciones ---------- */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-soft); }
.section-head { margin-bottom: 38px; }
.section-head p { color: var(--muted); font-size: 17px; }

/* ---------- Fila editorial (eyebrow+título | párrafo | botón) ---------- */
.split-row { display: grid; grid-template-columns: 1.1fr 1.2fr auto; gap: 40px; align-items: center; margin-bottom: 46px; }
@media (max-width: 900px) { .split-row { grid-template-columns: 1fr; gap: 18px; } }
.split-row p { margin: 0; color: var(--ink); }

/* ---------- Tarjetas de servicio con "foto" ---------- */
.service-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.service-card {
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.service-card:hover { transform: translateY(-4px); }
.service-card .thumb {
  height: 200px;
  background: linear-gradient(160deg, #DCE2E3 0%, #AEBEC4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4A5F68;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.service-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.service-card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.service-card h3 { font-size: 19px; }
.service-card p { font-size: 14.5px; color: var(--muted); margin: 0; }
.service-card .btn { align-self: flex-start; margin-top: auto; padding: 11px 22px; font-size: 13.5px; }
.service-cards.carousel { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 6px 2px 18px; margin: -6px -2px -18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.service-cards.carousel::-webkit-scrollbar { display: none; }
.service-cards.carousel .service-card { flex: 0 0 calc((100% - 66px) / 4); scroll-snap-align: start; }
@media (max-width: 1100px) { .service-cards.carousel .service-card { flex-basis: calc((100% - 44px) / 3); } }
@media (max-width: 800px) { .service-cards.carousel .service-card { flex-basis: calc((100% - 22px) / 2); } }
@media (max-width: 520px) { .service-cards.carousel .service-card { flex-basis: 82%; } }
.section-head.has-nav { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.car-nav { display: flex; gap: 10px; }
.car-nav button { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; color: var(--head); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: border-color 0.15s ease, color 0.15s ease; }
.car-nav button svg { width: 18px; height: 18px; display: block; }
.car-nav button:hover { border-color: var(--sky); color: var(--teal); }
.car-nav button:disabled { opacity: 0.35; cursor: default; }
.car-nav button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- ¿Por qué elegir? ---------- */
.why-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
@media (max-width: 860px) { .why-grid { grid-template-columns: 1fr; gap: 34px; } }
.check-card {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 22px 26px;
  margin: 24px 0 28px;
}
.check-card .check-list li { border-bottom: 1px solid rgba(43, 72, 81, 0.08); }
.check-card .check-list li:last-child { border-bottom: none; }
.check-card .check-list li::before { background: #fff; }

/* ---------- Opiniones ---------- */
.review-band { text-align: center; }
.review-card {
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  max-width: 520px;
  margin: 0 auto;
  padding: 38px 34px;
}
.review-band .stars, .review-card .stars { color: var(--head); font-size: 24px; letter-spacing: 7px; }
.review-band .score, .review-card .score { font-size: 44px; font-weight: 800; color: var(--head); margin: 8px 0 2px; }
.review-band .src, .review-card .src { color: var(--muted); font-size: 15px; margin-bottom: 22px; }
.review-line { text-align: center; font-size: 15.5px; }
.review-line .stars { letter-spacing: 5px; margin-right: 10px; color: var(--head); }

/* ---------- Banda de sedes (panel oscuro con pines) ---------- */
.sede-band {
  background: var(--panel);
  border-radius: 26px;
  padding: 46px 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 34px;
  text-align: center;
  color: var(--on-panel);
  box-shadow: var(--shadow);
}
.sede-band .pin { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--sky); }
.sede-band h3 { color: #fff; font-size: 19px; margin-bottom: 6px; }
.sede-band p { color: var(--on-panel); font-size: 14.5px; margin: 0 auto; }
.sede-band a { color: #fff; font-weight: 700; text-decoration: none; font-size: 16px; }
.sede-band a:hover { color: var(--sky); }
.sede-band > div { display: flex; flex-direction: column; align-items: center; }
.sede-band .lines { margin-top: 8px; }
.sede-band .lines a { font-size: 15px; }
.sede-band .lines .sep { color: var(--on-panel); font-weight: 400; padding: 0 3px; }
.sede-band .map { width: 100%; margin-top: auto; padding-top: 18px; }
.sede-band .map iframe { width: 100%; height: 190px; border: 0; display: block; border-radius: 14px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28); }

/* ---------- Tarjetas genéricas (interiores, sedes de contacto) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.card {
  background: #fff;
  border: none;
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 26px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease;
}
a.card:hover { transform: translateY(-4px); }
.card h3 { font-size: 18px; }
.card p { font-size: 14.5px; color: var(--muted); margin: 0; }
.card .more { margin-top: 8px; font-weight: 700; font-size: 14px; color: var(--head); }
a.card:hover h3, a.card:hover .more { color: var(--teal); }

.sede .city { font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); font-weight: 700; }
.sede address { font-style: normal; font-size: 14.5px; color: var(--muted); }
.sede .tel { font-weight: 800; color: var(--head); text-decoration: none; font-size: 16px; }
.sede .tel:hover { color: var(--teal); }

/* ---------- Sobre mí ---------- */
.split { display: grid; grid-template-columns: 300px 1fr; gap: 52px; align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.creds { list-style: none; padding: 0; margin: 18px 0 0; }
.creds li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.creds li:last-child { border-bottom: none; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 18px 0; border-bottom: 1px solid var(--line); max-width: 66ch; }
.timeline li:last-child { border-bottom: none; }
.timeline .when { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sky); font-weight: 700; }
.timeline h3 { font-size: 17px; margin: 5px 0 4px; }
.timeline p { font-size: 15px; color: var(--muted); margin: 0; }
.timeline p + p { margin-top: 9px; }
.nobr { white-space: nowrap; }

/* ---------- FAQ ---------- */
.faq { max-width: 740px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 16px; color: var(--head); padding: 17px 30px 17px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 15px; font-size: 20px; color: var(--sky); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p, .faq details ul { padding: 0 0 18px; margin: 0; color: var(--muted); font-size: 15.5px; }
.faq details ul { padding-left: 22px; }

/* ---------- Páginas interiores ---------- */
.page-hero { background: linear-gradient(180deg, var(--bg-soft) 0%, #F5F7F7 100%); padding: 64px 0 44px; }
.page-hero h1 { max-width: 26ch; font-size: clamp(30px, 4.4vw, 44px); }
.page-hero .lead { color: var(--muted); font-size: 17.5px; max-width: 58ch; margin: 16px 0 0; }
.page-hero .hero-cols { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.page-hero .hero-fig { background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); padding: 14px 16px 8px; }
.page-hero .hero-fig svg { width: 100%; height: auto; display: block; }
.page-hero .hero-img { width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 360px; object-fit: cover; border-radius: var(--r-card); box-shadow: var(--shadow); display: block; }
.page-hero .hero-shot { margin: 0; }
.page-hero .hero-shot figcaption { font-size: 13px; line-height: 1.45; color: var(--muted); margin-top: 10px; }
@media (max-width: 880px) { .page-hero .hero-cols { grid-template-columns: 1fr; gap: 22px; } .page-hero .hero-img { max-height: 240px; } }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--teal); }
.article { padding: 56px 0 30px; }
.article h2 { font-size: 25px; margin: 44px 0 14px; }
.article h2:first-child { margin-top: 0; }
.article h3 { margin: 26px 0 8px; }
.article ul { max-width: 66ch; }
.phase { display: grid; grid-template-columns: 140px 1fr; gap: 14px; border-bottom: 1px solid var(--line); padding: 14px 0; max-width: 700px; }
.phase .t { font-weight: 800; font-size: 12.5px; color: var(--teal); letter-spacing: 0.06em; text-transform: uppercase; padding-top: 2px; }
.phase p { margin: 0; font-size: 15px; color: var(--muted); }
@media (max-width: 560px) { .phase { grid-template-columns: 1fr; gap: 3px; } }
.notice {
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 680px;
  margin: 34px 0;
}
.notice a { color: var(--muted); }

/* ---------- Vídeo ---------- */
.video-link { display: block; max-width: 480px; text-decoration: none; margin: 10px 0 0; }
.video-link .thumb { position: relative; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); }
.video-link .thumb::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  background: rgba(43, 72, 81, 0.25);
  transition: background 0.15s ease;
}
.video-link:hover .thumb::after { background: rgba(43, 72, 81, 0.45); }
.video-link .cap { font-size: 13px; color: var(--muted); margin-top: 9px; }
.video { position: relative; max-width: 640px; aspect-ratio: 16 / 9; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); background: #223B44; margin: 14px 0 0; }
.video .video-load { display: block; width: 100%; height: 100%; }
.video img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video .play { position: absolute; left: 50%; top: 50%; width: 66px; height: 66px; margin: -33px 0 0 -33px; border-radius: 50%; background: rgba(43, 72, 81, 0.88); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); transition: background 0.15s ease; }
.video .play::after { content: ""; position: absolute; left: 27px; top: 21px; border-left: 20px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.video .video-load:hover .play { background: var(--teal); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-cap { font-size: 13px; color: var(--muted); margin: 9px 0 0; max-width: 640px; }

/* ---------- CTA ---------- */
.cta-band { background: var(--bg-soft); text-align: center; padding: 76px 0; }
.cta-band h2 { color: var(--head); }
.cta-band p { color: var(--muted); margin: 14px auto 28px; max-width: 52ch; }
.cta-band .btn-row { justify-content: center; }
.cta-band .tel-line { margin-top: 20px; font-size: 14.5px; color: var(--muted); }
.cta-band .tel-line a { color: var(--head); font-weight: 800; text-decoration: none; }
.cta-band .tel-line a:hover { color: var(--teal); }

/* ---------- Footer (panel oscuro) ---------- */
.site-footer { background: var(--panel); color: var(--on-panel); padding: 52px 0 116px; font-size: 14px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 34px; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 12px; }
.site-footer a { color: var(--on-panel); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 7px 0; }
.site-footer p { color: var(--on-panel); }
.site-footer .legal-line { border-top: 1px solid rgba(255, 255, 255, 0.16); margin-top: 32px; padding-top: 20px; font-size: 12.5px; }

/* ---------- Barra móvil ---------- */
.mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  gap: 8px;
  box-shadow: 0 -8px 24px rgba(43, 72, 81, 0.10);
}
.mobile-cta a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  font-size: 13.5px;
  padding: 12px 6px;
  border-radius: 999px;
}
.mobile-cta .call { border: 1.5px solid var(--head); color: var(--head); }
.mobile-cta .wa { background: var(--wa); color: #fff; }
.mobile-cta .book { background: var(--btn); color: #fff; }
@media (max-width: 760px) {
  .mobile-cta { display: flex; }
  body { padding-bottom: 68px; }
}

/* ---------- Fotos ---------- */
.portrait.has-photo { padding: 0; overflow: hidden; aspect-ratio: auto; }
.portrait.has-photo img { width: 100%; height: auto; display: block; }

.photo-fader {
  position: relative;
  aspect-ratio: 3 / 2;
  max-width: 640px;
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 10px 0 0;
}
.photo-fader img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: photofade 10s infinite;
}
.photo-fader img:nth-child(2) { animation-delay: 5s; }
@keyframes photofade {
  0% { opacity: 0; }
  8% { opacity: 1; }
  50% { opacity: 1; }
  58% { opacity: 0; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-fader img { animation: none; }
  .photo-fader img:first-child { opacity: 1; }
}
.photo-cap { font-size: 13px; color: var(--muted); margin-top: 9px; }

/* ---------- Artículos clínicos: comparativas y esquemas ---------- */
.tablewrap { overflow-x: auto; background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); margin: 18px 0 8px; }
table.compare { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 660px; }
.compare th { text-align: left; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 14px 16px; border-bottom: 2px solid var(--line); }
.compare td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.compare tr:last-child td { border-bottom: none; }
.compare td:first-child { font-weight: 700; color: var(--head); white-space: nowrap; }
.compare .best { color: var(--teal); font-weight: 700; }

.graft-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 20px; margin: 20px 0 6px; }
.graft-card { background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); padding: 22px 22px 20px; }
.graft-card.hl { outline: 2.5px solid var(--teal); }
.graft-card .g-tag { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: var(--teal); border-radius: 999px; padding: 3px 11px; margin-bottom: 10px; }
.graft-card h3 { font-size: 17px; margin-bottom: 3px; }
.graft-card .g-sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.g-pros, .g-cons { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.g-pros li { padding: 3px 0 3px 21px; position: relative; color: var(--ink); margin: 0; }
.g-pros li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 800; }
.g-cons { margin-top: 7px; }
.g-cons li { padding: 3px 0 3px 21px; position: relative; color: var(--muted); margin: 0; }
.g-cons li::before { content: "–"; position: absolute; left: 2px; font-weight: 700; }

.evidence { background: var(--panel); color: var(--on-panel); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 28px 30px; margin: 28px 0; max-width: 720px; }
.evidence h3 { color: #fff; margin-bottom: 10px; font-size: 20px; }
.evidence p { color: var(--on-panel); font-size: 15px; max-width: none; }
.evidence p:last-child { margin-bottom: 0; }
.stat-row { display: flex; gap: 40px; flex-wrap: wrap; margin: 18px 0 14px; }
.stat .num { display: block; font-size: 36px; font-weight: 800; color: #fff; line-height: 1.1; }
.stat .lbl { font-size: 13px; color: var(--on-panel); }

.diagram { background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); padding: 22px; margin: 20px 0; max-width: 540px; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram .cap { font-size: 13px; color: var(--muted); margin: 12px 0 0; text-align: center; }
.diagram.photo img { width: 100%; height: auto; display: block; border-radius: 12px; }
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 20px 0; }
.ba-grid figure { margin: 0; background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); padding: 12px 12px 10px; }
.ba-grid img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; background: #000; }
.ba-grid figcaption { font-size: 13px; line-height: 1.45; color: var(--muted); margin-top: 10px; }
.ba-grid figcaption b { color: var(--head); }
@media (max-width: 600px) { .ba-grid { grid-template-columns: 1fr; } }

.refs { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 38px; max-width: 700px; }
.refs ol { padding-left: 18px; margin: 6px 0 0; }
.refs li { margin: 4px 0; }
.refs a { color: var(--muted); }

/* ---------- Relacionados / lista antigua ---------- */
.related { background: var(--bg-soft); padding: 56px 0 76px; }
.t-list { border-top: 1px solid var(--line); }
.t-row { display: grid; grid-template-columns: minmax(220px, 0.9fr) 1.4fr auto; gap: 10px 28px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.t-row h3 { font-size: 18px; }
.t-row p { margin: 0; font-size: 14.5px; color: var(--muted); }
.t-row .arrow { font-size: 18px; color: var(--sky); transition: transform 0.15s ease; }
.t-row:hover .arrow { transform: translateX(4px); }
.t-row:hover h3 { color: var(--teal); }
@media (max-width: 680px) { .t-row { grid-template-columns: 1fr auto; } .t-row p { grid-column: 1 / -1; } }

/* ---------- Reserva online (widget Doctoralia, carga diferida vía site.js) ---------- */
.booking { background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); padding: 30px 32px 26px; margin: 0 0 40px; max-width: 660px; }
.booking h2 { margin-top: 0; }
.booking > p { max-width: none; }
.bw-frame { margin-top: 20px; display: flex; justify-content: center; align-items: center; min-height: 140px; }
.bw-frame iframe { max-width: 100%; border: 0; }
.bw-note { font-size: 12.5px; color: var(--muted); margin: 16px 0 0; }
.booking-band { text-align: center; }
.booking-band .booking { margin: 0 auto; text-align: left; }
.booking-band .bw-frame { margin-top: 0; }

/* ---------- Hero fotográfico a sangre completa ---------- */
.hero-photo { position: relative; overflow: hidden; background: #0F1E27; display: flex; align-items: center; min-height: clamp(480px, 72vh, 720px); }
.hero-photo .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 30%; }
.hero-photo .scrim { position: absolute; inset: 0; background: linear-gradient(92deg, rgba(9, 20, 26, 0.88) 0%, rgba(9, 20, 26, 0.6) 40%, rgba(9, 20, 26, 0.16) 70%, rgba(9, 20, 26, 0.05) 100%), linear-gradient(180deg, rgba(9, 20, 26, 0.35) 0%, rgba(9, 20, 26, 0) 30%, rgba(9, 20, 26, 0.45) 100%); }
.hero-photo .inner { position: relative; z-index: 1; width: 100%; padding-top: 90px; padding-bottom: 150px; }
.hero-photo h1 { color: #fff; max-width: 15ch; font-size: clamp(36px, 5.2vw, 56px); text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35); }
.hero-photo .lead { color: #DCE6EB; font-size: clamp(17px, 1.8vw, 20px); max-width: 46ch; margin: 18px 0 0; }
.hero-photo .cred-row { display: flex; align-items: center; gap: 28px; row-gap: 16px; flex-wrap: wrap; margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.22); }
.hero-photo .cred-row .plogo { line-height: 0; opacity: 0.85; transition: opacity 0.15s ease; }
.hero-photo .cred-row .plogo:hover { opacity: 1; }
.hero-photo .cred-row .plogo img { filter: brightness(0) invert(1); width: auto; }
.hero-photo .cred-row .plogo .l-salar { height: 32px; }
.hero-photo .cred-row .plogo .l-trauma { height: 22px; }
.hero-photo .cred-row .plogo .l-elche { height: 36px; }
.hero-photo .cred-row .cred-text { font-size: 12.5px; letter-spacing: 0.04em; color: #A9C0C9; }
.hero-cards .duo { margin-top: -92px; position: relative; z-index: 2; }
@media (max-width: 820px) {
  .hero-photo { min-height: 64vh; }
  .hero-photo .bg { object-position: 74% 26%; }
  .hero-photo .scrim { background: linear-gradient(180deg, rgba(9, 20, 26, 0.62) 0%, rgba(9, 20, 26, 0.3) 45%, rgba(9, 20, 26, 0.66) 100%); }
  .hero-photo .inner { padding-top: 64px; padding-bottom: 118px; }
  .hero-cards .duo { margin-top: -70px; }
}

/* ---------- Línea de valoración (por qué elegir) ---------- */
.rating-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 24px 0 26px; padding-top: 22px; border-top: 1px solid var(--line); font-weight: 700; color: var(--head); font-size: 16.5px; }
.rating-line .stars { color: #E9C46A; letter-spacing: 3px; }
.rating-line .sep { color: var(--muted); font-weight: 400; }
.rating-line a { font-weight: 600; color: var(--muted); }
.rating-line a:hover { color: var(--teal); }
.section-head h2 { font-size: clamp(25px, 2.8vw, 32px); }

/* ---------- Transiciones sutiles al hacer scroll (solo con JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal-group > * { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1); }
.js .reveal-group.in > * { opacity: 1; transform: none; }
.js .reveal-group.in > :nth-child(2) { transition-delay: 0.09s; }
.js .reveal-group.in > :nth-child(3) { transition-delay: 0.18s; }
.js .reveal-group.in > :nth-child(4) { transition-delay: 0.27s; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal-group > * { opacity: 1; transform: none; transition: none; }
}

/* ---------- Marca en el pie (icono + nombre) ---------- */
.site-footer .fbrand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; margin: 0 0 16px; line-height: 1.1; }
.site-footer .fbrand:hover { text-decoration: none; }
.site-footer .fbrand img { width: 46px; height: 46px; display: block; box-sizing: border-box; padding: 7px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); }
.site-footer .fbrand .fbtext { display: flex; flex-direction: column; }
.site-footer .fbrand .fname { color: #fff; font-weight: 800; font-size: 17px; }
.site-footer .fbrand:hover .fname { text-decoration: underline; }
.site-footer .fbrand .ftag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: #9DB9C2; margin-top: 4px; }
.site-footer .fbrand + .legal-line { margin-top: 22px; }

/* ---------- Selector de idioma (details/summary: funciona también sin JS) ---------- */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; padding: 6px 10px 6px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.08em; color: var(--head); background: #fff; line-height: 1; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::marker { content: ""; }
.lang-menu summary img { width: 21px; height: 15px; border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); }
.lang-menu summary .chev { width: 11px; height: 11px; color: var(--muted); transition: transform 0.15s ease; }
.lang-menu summary:hover, .lang-menu[open] summary { border-color: var(--sky); }
.lang-menu[open] summary .chev { transform: rotate(180deg); }
.lang-menu ul { list-style: none; margin: 0; padding: 8px; position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.lang-menu li { margin: 0; }
.nav .lang-menu a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: none; }
.nav .lang-menu a:hover { background: var(--bg-soft); color: var(--head); }
.nav .lang-menu a.on { background: var(--bg-soft); color: var(--head); }
.nav .lang-menu a.on::after { content: "✓"; margin-left: auto; color: var(--teal); font-size: 12px; }
.nav .lang-menu a img { width: 21px; height: 15px; border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); }
@media (max-width: 880px) {
  .nav .lang-menu { margin-top: 14px; }
  .nav .lang-menu ul { position: static; width: auto; box-shadow: none; margin-top: 10px; }
}
.site-footer .lang-list { column-count: 2; column-gap: 20px; }
.site-footer .lang-list li { break-inside: avoid; }

/* Respaldo para páginas antiguas aún en caché que conservan la fila de banderas */
.langs { display: flex; align-items: center; gap: 7px; }
.langs img { width: 21px; height: 15px; border-radius: 3.5px; display: block; }

/* Titular del hero en pantallas estrechas: los idiomas con palabras largas (sueco, alemán) no deben desbordar */
@media (max-width: 480px) {
  .hero-photo h1 { overflow-wrap: anywhere; }
}

/* ---------- Mapas con carga al pulsar (sin cookies de Google hasta entonces) ---------- */
.sede-band .map .map-load { display: flex; align-items: center; justify-content: center; gap: 9px; height: 190px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); border: 1px dashed rgba(255, 255, 255, 0.3); color: #fff; font-weight: 700; font-size: 14.5px; text-decoration: none; transition: background 0.15s ease, border-color 0.15s ease; }
.sede-band .map .map-load:hover { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.55); color: #fff; }

/* ---------- Aviso de cookies (solo para la etiqueta de Google Ads) ---------- */
.cookie-bar { position: fixed; left: 18px; bottom: 18px; z-index: 60; width: min(400px, calc(100% - 36px)); background: #fff; color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--teal); border-radius: 14px; box-shadow: 0 16px 44px rgba(43, 72, 81, 0.2); padding: 18px 20px 16px; font-size: 13.5px; line-height: 1.55; }
.cookie-bar .cb-title { margin: 0 0 6px; font-size: 15px; font-weight: 800; color: var(--head); }
.cookie-bar p { margin: 0; color: var(--muted); }
.cookie-bar p a { color: var(--teal); font-weight: 700; }
.cookie-bar .cb-actions { display: flex; gap: 10px; margin-top: 14px; }
.cookie-bar button { flex: 1; font: inherit; font-weight: 700; font-size: 13.5px; border-radius: 10px; padding: 11px 14px; cursor: pointer; }
.cookie-bar .cb-accept { background: var(--btn); color: #fff; border: 1.5px solid var(--btn); }
.cookie-bar .cb-accept:hover { background: var(--head); border-color: var(--head); }
.cookie-bar .cb-reject { background: #fff; color: var(--head); border: 1.5px solid var(--line); }
.cookie-bar .cb-reject:hover { border-color: var(--sky); }
.cookie-bar button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (max-width: 880px) { .cookie-bar { left: 10px; right: 10px; width: auto; bottom: 82px; padding: 16px 16px 14px; } }
.site-footer .cookie-settings { text-decoration: underline; }

/* ---------- Páginas de ciudad: mapa en artículo y enlaces en las sedes ---------- */
.sede-band .more { margin-top: 8px; font-size: 13.5px; }
.sede-band .more a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); text-underline-offset: 3px; }
.sede-band .more a:hover { text-decoration-color: #fff; }
.article .map { margin: 26px 0 0; }
.article .map iframe { width: 100%; height: 340px; border: 0; display: block; border-radius: 16px; box-shadow: var(--shadow); }
.article .map .map-load { display: flex; align-items: center; justify-content: center; gap: 9px; height: 220px; border-radius: 16px; background: var(--bg-soft); border: 1px dashed var(--line); color: var(--head); font-weight: 700; font-size: 14.5px; text-decoration: none; transition: background 0.15s ease, border-color 0.15s ease; }
.article .map .map-load:hover { background: #fff; border-color: var(--sky); }
.article .service-cards { margin-top: 18px; }
.article .btn-row { margin-top: 22px; }
