/* ============================================================
   Clínica Dental Medent — Dr. Costa · Castelldefels
   Sistema de diseño propio: cálido, editorial, con autoridad
   clínica real (39 años, 5 especialistas) — nunca frío ni azul
   clínico de plantilla.
   ============================================================ */

:root {
  --mk-primario: #FF6210;
  --mk-secundario: #b04003;
  --mk-fondo: #FEF1E4;
  --mk-texto: #23201d;

  --c-primary: #FF6210;
  --c-primary-dark: #b04003;
  --c-ink: #23201d;
  --c-ink-soft: #4a433d;
  --c-cream: #FEF1E4;
  --c-cream-soft: #FFF8F1;
  --c-white: #ffffff;
  --c-line: rgba(35, 32, 29, .12);
  --c-line-onink: rgba(254, 241, 228, .16);

  --font-display: "Montserrat", "Segoe UI", sans-serif;
  --font-body: "Open Sans", "Segoe UI", sans-serif;

  --wrap: min(72rem, 92vw);
  --radius: 22px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

body {
  margin: 0;
  background: var(--c-cream);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { width: var(--wrap); margin-inline: auto; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-display); font-weight: 700; font-size: .8rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--c-primary-dark);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--c-primary); border-radius: 2px; }
.on-ink .eyebrow { color: var(--c-primary); }
.on-ink .eyebrow::before { background: var(--c-primary); }

.btn {
  display: inline-flex; align-items: center; gap: .6em; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  padding: 1em 1.7em; border-radius: 999px; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; transition: transform .35s var(--ease), background .3s, color .3s, border-color .3s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: 0 14px 30px -12px rgba(255, 98, 16, .55); }
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-ghost { border-color: currentColor; background: transparent; }
.btn-ghost:hover { background: var(--c-ink); color: var(--c-cream); border-color: var(--c-ink); }
.on-ink .btn-ghost { border-color: var(--c-line-onink); }
.on-ink .btn-ghost:hover { background: var(--c-cream); color: var(--c-ink); border-color: var(--c-cream); }

.section { padding: clamp(4rem, 9vw, 8rem) 0; position: relative; }
.section-soft { background: var(--c-cream-soft); }
.section-ink { background: var(--c-ink); color: var(--c-cream); }
.head { max-width: 46rem; margin-bottom: clamp(2.2rem, 5vw, 3.6rem); }
.head h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin-top: .5rem; }
.head p { margin-top: 1rem; font-size: 1.08rem; color: var(--c-ink-soft); }
.on-ink .head p { color: color-mix(in srgb, var(--c-cream) 78%, transparent); }

/* ---------------------------------------------------------------
   MOTIVO DE MARCA: el arco de la sonrisa, vectorizado del logo real
   --------------------------------------------------------------- */
.marca-arco { display: block; }
.marca-arco path { fill: currentColor; }
.arco-draw { stroke: currentColor; stroke-width: 26; fill: none; stroke-linecap: round; }

/* ---------------------------------------------------------------
   CABECERA
   --------------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem clamp(1.2rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--c-cream) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color .4s, background .4s, padding .4s;
}
.site-header.is-scrolled { border-color: var(--c-line); padding-block: .55rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand span { display: none; }

.main-nav { display: flex; align-items: center; gap: 2.1rem; }
.main-nav a {
  text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: .92rem;
  color: var(--c-ink); position: relative; padding: .2rem 0;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -3px; height: 2px; background: var(--c-primary);
  transition: right .35s var(--ease);
}
.main-nav a:hover::after { right: 0; }

.header-contact { display: flex; align-items: center; gap: .6rem; }
.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--c-ink); color: var(--c-cream); text-decoration: none; flex-shrink: 0;
  transition: transform .3s var(--ease), background .3s;
}
.icon-btn:hover { transform: translateY(-2px) scale(1.05); background: var(--c-primary); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.whatsapp { background: #2ba84a; }
.tel-link {
  display: inline-flex; flex-direction: column; line-height: 1.15; text-decoration: none;
}
.tel-link small { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c-ink-soft); font-weight: 600; }
.tel-link strong { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }

.nav-toggle { display: none; }

/* ---------------------------------------------------------------
   HERO
   --------------------------------------------------------------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  padding-top: 6rem; overflow: hidden; color: #fff;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgba(20, 16, 12, .92) 0%, rgba(20, 16, 12, .55) 46%, rgba(20, 16, 12, .32) 100%),
    linear-gradient(100deg, rgba(20, 16, 12, .55) 0%, transparent 60%);
}
.hero-inner { position: relative; z-index: 2; width: var(--wrap); margin-inline: auto; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero-eyebrow { color: var(--c-primary); }
.hero-eyebrow::before { background: var(--c-primary); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); margin-top: .7rem; max-width: 16ch; text-shadow: 0 4px 24px rgba(0, 0, 0, .35); }
.hero-arc { width: min(340px, 46vw); color: var(--c-primary); margin: 1.1rem 0 1.4rem -6px; opacity: 1; clip-path: inset(0 100% 0 0); animation: arcReveal 1.15s var(--ease) 2.5s forwards; }
.hero-arc svg { display: block; width: 100%; height: auto; }
@keyframes arcReveal { to { clip-path: inset(0 0% 0 0); } }
@media (prefers-reduced-motion: reduce) { .hero-arc { clip-path: none; animation: none; } }
.hero p.lead { max-width: 42ch; font-size: 1.15rem; color: #f4e9dd; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }
.hero-inner.mk-hero > *:nth-child(5) { animation-delay: 2.7s; }
.hero-inner.mk-hero > *:nth-child(6) { animation-delay: 2.85s; }
.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(1.6rem, 4vw, 3.2rem); margin-top: 3rem; padding-top: 1.8rem; border-top: 1px solid rgba(255, 255, 255, .2); }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem); color: var(--c-primary); }
.stat span { font-size: .85rem; color: #ecdfd0; }

/* ---------------------------------------------------------------
   FRANJA DIFERENCIADORES
   --------------------------------------------------------------- */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip li {
  padding: 2.2rem clamp(1.2rem, 3vw, 2rem); border-left: 1px solid var(--c-line-onink);
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.4;
}
.strip li:first-child { border-left: none; }

/* ---------------------------------------------------------------
   TRATAMIENTOS
   --------------------------------------------------------------- */
.tratamientos-destacados { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.4rem, 3vw, 2.4rem); margin-bottom: clamp(1.4rem, 3vw, 2.4rem); }
.tr-feature {
  position: relative; border-radius: var(--radius); overflow: hidden; min-height: 420px;
  display: flex; align-items: flex-end; color: #fff; text-decoration: none;
}
.tr-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.tr-feature:hover img { transform: scale(1.06); }
.tr-feature::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20, 16, 12, .92), rgba(20, 16, 12, .1) 62%); }
.tr-feature-body { position: relative; z-index: 1; padding: 2rem; }
.tr-feature-body h3 { font-size: 1.5rem; }
.tr-feature-body p { margin-top: .55rem; color: #ecdfd0; max-width: 32ch; }
.tr-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.tr-chips span { font-size: .76rem; font-weight: 700; letter-spacing: .02em; padding: .4em .9em; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); }

.tratamientos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 2.4vw, 1.6rem); }
.tr-card {
  background: var(--c-white); border-radius: 18px; overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: 0 1px 0 var(--c-line);
}
.tr-card figure { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; }
.tr-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.tr-card:hover img { transform: scale(1.08); }
.tr-card-body { padding: 1.2rem 1.3rem 1.5rem; }
.tr-card-body h4 { font-size: 1.05rem; }
.tr-card-body p { margin-top: .4rem; font-size: .92rem; color: var(--c-ink-soft); }

.sedacion-callout {
  margin-top: clamp(1.4rem, 3vw, 2.4rem); display: flex; align-items: center; gap: 1.4rem;
  background: var(--c-cream-soft); border: 1px dashed var(--c-primary-dark); border-radius: 18px;
  padding: 1.6rem 1.8rem;
}
.sedacion-callout .ico { flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%; background: var(--c-primary); color: #fff; display: grid; place-items: center; }
.sedacion-callout .ico svg { width: 26px; height: 26px; }
.sedacion-callout h4 { font-size: 1.05rem; }
.sedacion-callout p { margin-top: .3rem; color: var(--c-ink-soft); font-size: .95rem; }

/* ---------------------------------------------------------------
   ANTES / DESPUÉS — comparador arrastrable (pieza central)
   --------------------------------------------------------------- */
.comparadores { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.2rem, 2.6vw, 2rem); }
.comparador { text-align: center; }
.comparador h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin-bottom: .9rem; color: var(--c-cream); }
.ba-slider {
  position: relative; aspect-ratio: 5 / 3; border-radius: 16px; overflow: hidden; cursor: ew-resize;
  user-select: none; touch-action: pan-y; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5);
}
.ba-slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-slider .ba-after { z-index: 1; }
.ba-slider .ba-before-wrap { position: absolute; inset: 0; z-index: 2; overflow: hidden; width: var(--ba-pos, 50%); }
.ba-slider .ba-before-wrap img { width: var(--ba-w); max-width: none; }
.ba-tag { position: absolute; top: 10px; z-index: 3; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(20, 16, 12, .68); color: #fff; padding: .35em .8em; border-radius: 999px; }
.ba-tag.antes { left: 10px; }
.ba-tag.despues { right: 10px; }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: var(--ba-pos, 50%); z-index: 4; width: 3px; background: #fff;
  transform: translateX(-50%); pointer-events: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,0) ;
}
.ba-handle::after {
  content: "⇔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%; background: var(--c-primary); color: #fff;
  display: grid; place-items: center; font-size: 1.1rem; box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
}

/* ---------------------------------------------------------------
   EQUIPO
   --------------------------------------------------------------- */
.doctor { display: grid; grid-template-columns: .62fr 1fr; gap: clamp(1.6rem, 4vw, 3.6rem); align-items: center; padding-block: clamp(2rem, 4vw, 3.2rem); border-top: 1px solid var(--c-line); }
.doctor:first-of-type { border-top: none; }
.doctor:nth-of-type(even) { grid-template-columns: 1fr .62fr; }
.doctor:nth-of-type(even) .doctor-photo { order: 2; }
.doctor-photo { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1; }
.doctor-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.02); transition: filter .6s var(--ease), transform .6s var(--ease); }
.doctor-photo:hover img { filter: grayscale(0); transform: scale(1.04); }
.doctor-role { color: var(--c-primary-dark); font-family: var(--font-display); font-weight: 700; font-size: .92rem; margin-top: .3rem; }
.doctor h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-top: .9rem; }
.doctor-cred { margin-top: 1.1rem; display: grid; gap: .5rem; }
.doctor-cred li { position: relative; padding-left: 1.3em; font-size: .93rem; color: var(--c-ink-soft); }
.doctor-cred li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--c-primary); }

/* ---------------------------------------------------------------
   HISTORIA
   --------------------------------------------------------------- */
.historia { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.historia-arco-bg { position: absolute; top: -4vw; right: -6vw; width: 44vw; color: var(--c-primary); opacity: .1; pointer-events: none; z-index: 0; }
.historia-text { position: relative; z-index: 1; }
.quote { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.25rem, 2.4vw, 1.7rem); line-height: 1.35; color: var(--c-ink); }
.quote::before { content: "\201C"; color: var(--c-primary); }
.quote::after { content: "\201D"; color: var(--c-primary); }
.historia-text p.body-text { margin-top: 1.4rem; color: var(--c-ink-soft); font-size: 1.02rem; }
.puntos-fuertes { margin-top: 1.8rem; display: grid; gap: .9rem; }
.puntos-fuertes li { font-size: .96rem; }
.puntos-fuertes b { font-family: var(--font-display); color: var(--c-primary-dark); }
.historia-photo { position: relative; z-index: 1; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5; }
.historia-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------
   INSTALACIONES — galería horizontal
   --------------------------------------------------------------- */
.galeria-scroll { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; scroll-snap-type: x proximity; padding-inline: calc((100% - var(--wrap)) / 2); }
.galeria-scroll::-webkit-scrollbar { height: 6px; }
.galeria-scroll::-webkit-scrollbar-thumb { background: var(--c-line); border-radius: 4px; }
.galeria-item { flex: 0 0 auto; width: min(340px, 74vw); scroll-snap-align: start; border-radius: 16px; overflow: hidden; position: relative; aspect-ratio: 4/3; }
.galeria-item img { width: 100%; height: 100%; object-fit: cover; }
.galeria-item span { position: absolute; left: 12px; bottom: 12px; z-index: 1; font-family: var(--font-display); font-weight: 600; font-size: .82rem; color: #fff; background: rgba(20, 16, 12, .55); padding: .3em .8em; border-radius: 999px; }

/* ---------------------------------------------------------------
   MUTUAS — marquee
   --------------------------------------------------------------- */
.mutuas-track img { height: 40px; width: auto; object-fit: contain; opacity: .8; filter: grayscale(1); transition: opacity .3s, filter .3s; }
.mutuas-track img:hover { opacity: 1; filter: none; }
.mutuas-track > * { display: flex; align-items: center; }

/* ---------------------------------------------------------------
   CIERRE / FOOTER — estático, no animado
   --------------------------------------------------------------- */
.footer-cta { text-align: center; padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.footer-cta h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); max-width: 20ch; margin-inline: auto; }
.footer-cta p { margin-top: .8rem; color: #ecdfd0; }
.footer-cta .hero-ctas { justify-content: center; margin-top: 2rem; }

.footer-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: 2.4rem; padding-block: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--c-line-onink); }
.footer-brand img { height: 34px; }
.footer-brand p { margin-top: 1rem; color: #ecdfd0; font-size: .92rem; max-width: 26ch; }
.footer-col h5 { font-family: var(--font-display); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c-primary); margin-bottom: 1rem; }
.footer-col li, .footer-col p, .footer-col a { font-size: .93rem; color: #ecdfd0; line-height: 1.7; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { color: var(--c-primary); }
.footer-map { border-radius: 14px; overflow: hidden; margin-top: 1rem; filter: grayscale(.3) contrast(1.05); }
.footer-map iframe { width: 100%; height: 160px; border: 0; display: block; }
.footer-bottom { border-top: 1px solid var(--c-line-onink); padding-block: 1.4rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .8rem; color: #b7ab9d; }
.footer-bottom a { text-decoration: none; color: #b7ab9d; }
.footer-bottom a:hover { color: var(--c-cream); }

/* ---------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------- */
@media (max-width: 980px) {
  .main-nav { display: none; }
  .nav-toggle {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid var(--c-line); background: transparent; cursor: pointer;
  }
  .nav-toggle svg { width: 20px; height: 20px; }
  .main-nav.is-open {
    display: flex; position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--c-cream); padding: .5rem 1.4rem 1.4rem; border-bottom: 1px solid var(--c-line);
    box-shadow: 0 20px 40px -20px rgba(0,0,0,.2);
  }
  .main-nav.is-open a { padding: .9rem 0; border-bottom: 1px solid var(--c-line); }
  .tel-link small { display: none; }

  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip li:nth-child(3) { border-left: none; }
  .strip li:nth-child(3), .strip li:nth-child(4) { border-top: 1px solid var(--c-line-onink); }

  .tratamientos-destacados { grid-template-columns: 1fr; }
  .tratamientos-grid { grid-template-columns: repeat(2, 1fr); }

  .comparadores { grid-template-columns: 1fr; max-width: 26rem; margin-inline: auto; }

  .doctor, .doctor:nth-of-type(even) { grid-template-columns: 1fr; }
  .doctor-photo, .doctor:nth-of-type(even) .doctor-photo { order: 0; max-width: 280px; margin-inline: auto; }

  .historia { grid-template-columns: 1fr; }
  .historia-photo { order: -1; max-width: 24rem; margin-inline: auto; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .hero { align-items: center; }
  .hero-inner { padding-top: 5.5rem; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-stats { gap: 1.6rem; }
  .strip { grid-template-columns: 1fr; }
  .strip li { border-left: none !important; border-top: 1px solid var(--c-line-onink); }
  .strip li:first-child { border-top: none; }
  .tratamientos-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .sedacion-callout { flex-direction: column; text-align: center; }
}
