@import url('tokens.css?v=f4c8ed79');

/* ============================================================
   Base — DS "Marín"
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select { font: inherit; color: inherit; }

body {
  background: var(--parchment);
  color: var(--near-black);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--rojo);
  color: var(--ivory);
}

.contenedor {
  width: var(--container);
  margin-inline: auto;
}

section { padding: clamp(72px, 11vh, 140px) 0; }

.label {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--olive);
}

.label--suave { color: var(--stone); } /* solo decorativo */

.num-sec {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--rojo);
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--t-h2);
  line-height: 1.08;
  letter-spacing: -.005em;
  margin-top: 14px;
}
h2 em { font-style: italic; }
h2 .caps {
  font-family: var(--sans);
  font-weight: 600;
  text-transform: uppercase;
}

.intro-sec {
  margin-top: 18px;
  color: var(--olive);
  max-width: 58ch;
}
.intro-sec strong { color: var(--near-black); font-weight: 500; }

hr.filete { border: 0; border-top: 1px solid var(--b-warm); }

.oculto { display: none; }

/* ============================================================
   Botones
   ============================================================ */

.btn {
  display: inline-block;
  font-weight: 500;
  font-size: var(--t-btn);
  letter-spacing: 1.28px;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  padding: 15px 30px;
  border-radius: var(--r-btn);
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
  transition: background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.btn--rojo { background: var(--rojo); color: var(--ivory); }
.btn--rojo:hover { background: var(--rojo-deep); }
.btn--sand { background: var(--warm-sand); color: #4D4C48; }
.btn--sand:hover { box-shadow: 0 0 0 1px var(--ring); }
.btn--ghost { background: transparent; color: var(--ivory); border: 1px solid var(--ivory); }
.btn--ghost:hover { background: var(--ivory); color: var(--near-black); }
.btn:focus-visible { outline: 2px solid var(--near-black); outline-offset: 3px; }
.btn--ghost:focus-visible { outline-color: var(--ivory); }

/* ============================================================
   Barra
   ============================================================ */

.barra {
  padding: 20px 0;
  border-bottom: 1px solid var(--b-cream);
  background: var(--parchment);
}
.barra .contenedor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.marca {
  display: block;
  color: var(--near-black);
  text-decoration: none;
}
.marca__logo {
  display: block;
  height: 30px;
  width: auto;
}
.barra .label { display: none; }
@media (min-width: 820px) { .barra .label { display: block; } }

/* ============================================================
   1 · Hero
   ============================================================ */

.hero { padding: 10vh 0 11vh; }
.hero .contenedor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 52px;
  align-items: end;
}
@media (min-width: 960px) { .hero .contenedor { grid-template-columns: 7fr 5fr; } }
.hero__meta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.hero__meta span:not(:last-child)::after {
  content: "·";
  margin-left: 14px;
  color: var(--stone);
}
h1 {
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.01em;
  font-size: clamp(2.7rem, 7.5vw, 5.6rem);
}
h1 .it { font-family: var(--serif); font-style: italic; display: block; }
h1 .caps { font-family: var(--sans); font-weight: 600; text-transform: uppercase; display: block; }
h1 .caps i { font-style: normal; color: var(--rojo); }
.hero__nota { margin-top: 32px; font-size: 1.2rem; color: var(--olive); max-width: 46ch; }
.hero__nota strong { color: var(--near-black); font-weight: 500; }
.hero__nota .ast { color: var(--rojo); font-weight: 600; }
.hero__acciones { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero__visual {
  position: relative;
  aspect-ratio: 4/5;
  background: var(--warm-sand);
  border: 1px solid var(--b-cream);
  border-radius: var(--r-media);
  overflow: hidden;
}
.hero__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  filter: grayscale(100%) contrast(1.03);
}
.badge {
  margin-top: 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: var(--ivory);
  border: 1px solid var(--b-cream);
  border-radius: var(--r-card);
  padding: 15px 20px;
}
.badge__icono { color: var(--rojo); font-size: .9rem; }

/* ============================================================
   2 · Autoridad
   ============================================================ */

.autoridad__card {
  background: var(--ivory);
  border: 1px solid var(--b-cream);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  padding: clamp(30px, 5vw, 68px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
}
@media (min-width: 960px) {
  .autoridad__card { grid-template-columns: 5fr 7fr; gap: 7%; align-items: start; }
}
.retrato-marco {
  background: var(--warm-sand);
  border-radius: var(--r-media);
  overflow: hidden;
  border: 1px solid var(--b-cream);
}
.retrato-marco img { width: 100%; aspect-ratio: 4/5; object-fit: cover; filter: grayscale(100%) contrast(1.03); }
.autoridad p.cuerpo { margin-top: 22px; color: var(--olive); max-width: 58ch; }
.autoridad p.cuerpo strong { color: var(--near-black); font-weight: 500; }
.cita {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--b-warm);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.4;
}
.cita .firma { display: block; margin-top: 12px; font-family: var(--sans); font-style: normal; }
.publicaciones { margin-top: 38px; list-style: none; }
.publicaciones li {
  border-top: 1px solid var(--b-warm);
  padding: 14px 2px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.publicaciones li:last-child { border-bottom: 1px solid var(--b-warm); }
.publicaciones a {
  color: var(--near-black);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease);
}
.publicaciones a:hover { color: var(--rojo-deep); }
.publicaciones li.oculto { display: none; }

/* ============================================================
   3 · Proceso
   ============================================================ */

.pasos {
  margin-top: 52px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 880px) { .pasos { grid-template-columns: 1fr 1fr 1fr; } }
.paso-card {
  background: var(--ivory);
  border: 1px solid var(--b-cream);
  border-radius: var(--r-card);
  padding: 32px 30px 36px;
}
.paso-card .numero {
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.4rem;
  color: var(--rojo);
  line-height: 1;
}
.paso-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.55rem;
  line-height: 1.15;
  margin-top: 16px;
}
.paso-card p { margin-top: 12px; color: var(--olive); font-size: .98rem; }
.proceso-foto {
  margin-top: 20px;
  border-radius: var(--r-media);
  overflow: hidden;
  border: 1px solid var(--b-cream);
}
.proceso-foto img { width: 100%; aspect-ratio: 16/7; object-fit: cover; object-position: 50% 22%; }

/* ============================================================
   4 · Casos (cinematográfica)
   ============================================================ */

.casos { background: var(--near-black); color: var(--ivory); }
.casos .label { color: var(--silver); }
.casos h2 { color: var(--ivory); }
.casos .intro-sec { color: var(--silver); }
.casos .intro-sec strong { color: var(--ivory); }
.comparador {
  margin-top: 52px;
  position: relative;
  aspect-ratio: 3/2;
  background: var(--dark-surface);
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
/* Marca de agua de casos: lista para cuando lleguen los casos reales (RB-102 paso 6).
   Aún NO se aplica — los paneles del comparador siguen siendo placeholder. */
.caso__watermark {
  position: absolute;
  right: 3%;
  bottom: 4%;
  width: 22%;
  max-width: 120px;
  opacity: .55;
  pointer-events: none;
  z-index: 2;
}
/* Prueba social (pacientes reales): construida OCULTA hasta tener consentimientos firmados.
   Tratamiento uniforme B&N, sin selfies crudos a color. Ver comentario en index.html. */
.ps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 38px;
}
@media (min-width: 720px) {
  .ps-grid { grid-template-columns: repeat(3, 1fr); }
}
.ps-card {
  aspect-ratio: 1/1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--b-cream);
  background: linear-gradient(155deg, var(--warm-sand), var(--b-cream));
}
.ps-card__foto {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.03);
}

.comparador .lado { position: absolute; inset: 0; }
.comparador .lado--despues { clip-path: inset(0 0 0 50%); }
.comparador .lado picture { position: absolute; inset: 0; display: block; }
.comparador .lado img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}
.comparador__divisor {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--ivory);
  pointer-events: none;
}
.comparador__manija {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ivory);
  color: var(--near-black);
  display: grid;
  place-items: center;
  font-size: .8rem;
  cursor: ew-resize;
  pointer-events: none;
}
.comparador__tags {
  position: absolute;
  bottom: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.comparador:focus-visible { outline: 2px solid var(--ivory); outline-offset: 3px; }
.casos__pie {
  margin-top: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* ============================================================
   5 · Tecnología
   ============================================================ */

.tec .contenedor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}
@media (min-width: 960px) { .tec .contenedor { grid-template-columns: 6fr 6fr; gap: 7%; } }
.tec-foto {
  border-radius: var(--r-media);
  overflow: hidden;
  border: 1px solid var(--b-cream);
}
.tec-foto img { width: 100%; aspect-ratio: 4/4.4; object-fit: cover; object-position: 50% 18%; }
.tec-lista { margin-top: 32px; list-style: none; }
.tec-lista li {
  border-top: 1px solid var(--b-warm);
  padding: 16px 2px;
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.tec-lista li:last-child { border-bottom: 1px solid var(--b-warm); }
.tec-lista .k {
  font-family: var(--serif);
  font-style: italic;
  color: var(--rojo);
  flex-shrink: 0;
  width: 26px;
}
.tec-lista p { color: var(--olive); font-size: .98rem; }
.tec-lista strong { color: var(--near-black); font-weight: 500; }

/* ============================================================
   6 · FAQ
   ============================================================ */

.faq-lista { margin-top: 44px; max-width: 820px; }
.faq-item { border-top: 1px solid var(--b-warm); }
.faq-item:last-child { border-bottom: 1px solid var(--b-warm); }
.faq-preg {
  width: 100%;
  background: none;
  border: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  text-align: left;
  padding: 22px 40px 22px 2px;
  cursor: pointer;
  position: relative;
  color: var(--near-black);
  line-height: 1.3;
}
.faq-preg::after {
  content: "+";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans);
  font-size: 1.4rem;
  color: var(--olive);
  transition: transform .3s var(--ease);
}
.faq-item.abierto .faq-preg::after { content: "×"; color: var(--rojo); }
.faq-resp { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.faq-resp p { padding: 0 2px 24px; color: var(--olive); max-width: 64ch; }
.faq-resp strong { color: var(--near-black); font-weight: 500; }
.faq-preg:focus-visible { outline: 2px solid var(--near-black); outline-offset: -2px; }

/* ============================================================
   7 · Contacto / Footer
   ============================================================ */

.contacto { background: var(--near-black); color: var(--ivory); }
.contacto .label { color: var(--silver); }
.contacto h2 { color: var(--ivory); }
.contacto .contenedor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
}
@media (min-width: 960px) { .contacto .contenedor { grid-template-columns: 6fr 5fr; gap: 9%; } }
.contacto__datos {
  margin-top: 34px;
  display: grid;
  gap: 14px;
  color: var(--silver);
  font-size: .98rem;
}
.contacto__datos strong { color: var(--ivory); font-weight: 500; }
/* Mapa: lazy-iframe cargado por IntersectionObserver (no carga en el load inicial).
   El iframe de Google Maps es el único tercero aceptado y solo entra on-scroll. */
.mapa {
  position: relative;
  margin-top: 30px;
  aspect-ratio: 16/7;
  border-radius: var(--r-card);
  overflow: hidden;
  border: 1px solid var(--dark-surface);
}
.mapa__lienzo { position: absolute; inset: 0; }
.mapa__lienzo iframe { width: 100%; height: 100%; border: 0; display: block; }
.mapa__prev {
  position: absolute;
  inset: 0;
  background: var(--dark-surface);
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
}
.mapa__pin { color: var(--ivory); display: grid; place-items: center; opacity: .85; }
.mapa__prev .direccion {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ivory);
}
.mapa__ruta {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 10px 18px;
  font-size: .82rem;
}
.mapa:focus-within { outline: 2px solid var(--ivory); outline-offset: 3px; }
.form { display: grid; gap: 26px; align-content: start; }
.campo label {
  display: block;
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--silver);
  margin-bottom: 9px;
}
.campo input, .campo textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--dark-surface);
  border-radius: 0;
  padding: 10px 2px 12px;
  font-family: var(--sans);
  font-size: 1.05rem;
  color: var(--ivory);
}
.campo input::placeholder, .campo textarea::placeholder { color: #6b6963; }
.campo input:focus, .campo textarea:focus { outline: 0; border-bottom: 2px solid var(--ivory); }
.form .btn { justify-self: start; }
.form__exito {
  display: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ivory);
}
.form__error {
  display: none;
  font-size: .95rem;
  color: var(--silver);
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.pie-final {
  background: var(--near-black);
  border-top: 1px solid var(--dark-surface);
  padding: 26px 0;
}
.pie-final .contenedor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px 24px;
  flex-wrap: wrap;
}
.pie-final .label { color: var(--silver); }
.pie-final .pie-link { color: var(--silver); text-decoration: underline; text-underline-offset: 2px; }
.pie-final .pie-link:hover { color: var(--ivory); }
.pie-final .pie-link:focus-visible { outline: 2px solid var(--ivory); outline-offset: 2px; }
.pie-logo {
  display: block;
  height: 24px;
  width: auto;
  flex-shrink: 0;
}

/* ============================================================
   WhatsApp flotante (tras 60% de scroll, solo mobile)
   ============================================================ */

.wsp-flotante {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  background: var(--near-black);
  color: var(--ivory);
  border-radius: 50%;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 1.3rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
  box-shadow: rgba(0,0,0,.15) 0 4px 18px;
}
.wsp-flotante.visible { opacity: 1; pointer-events: auto; }
.wsp-flotante:focus-visible { outline: 2px solid var(--near-black); outline-offset: 3px; }
@media (min-width: 960px) { .wsp-flotante { display: none; } }

/* ============================================================
   Reveal
   ============================================================ */

.rev {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-med) var(--ease),
              transform var(--dur-med) var(--ease);
}
.rev.visto { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rev { opacity: 1; transform: none; transition: none; }
  .faq-resp { transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
