/* ════════════════════════════════════════════════════════════════════
   SV-MOBILE.CSS — Sonrisa Viva, mobile-first single source of truth
   Filosofía:
   - Mobile (320-768px): este CSS define el LOOK por defecto, sin medias.
   - Desktop (≥769px): añade refinos con `@media (min-width: 769px)`.
   - CERO inline styles dependencies. CERO parches con !important.
   ════════════════════════════════════════════════════════════════════ */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body {
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--sv-fg);
  background: var(--sv-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

/* THEME OVERRIDES EXPLÍCITOS — ganan a styles.css legacy en cascade */
:root[data-theme="dark"] body,
:root:not([data-theme="light"]) body {
  background: #07080F;
  color: #F0F1F5;
}
:root[data-theme="light"] body {
  background: #FFFFFF;
  color: #0E1220;
}
img, video, picture, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; font-size: 16px; }

/* === DESIGN TOKENS === */
:root {
  /* Spacing scale */
  --sv-s1: 4px;  --sv-s2: 8px;  --sv-s3: 12px; --sv-s4: 16px;
  --sv-s5: 24px; --sv-s6: 32px; --sv-s7: 48px; --sv-s8: 64px; --sv-s9: 96px;
  /* Radius */
  --sv-r-sm: 8px; --sv-r-md: 12px; --sv-r-lg: 16px; --sv-r-pill: 999px;
  /* Type scale */
  --sv-t-xs: clamp(11px, 2.8vw, 12px);
  --sv-t-sm: clamp(13px, 3.4vw, 14px);
  --sv-t-base: clamp(15px, 4vw, 16px);
  --sv-t-md: clamp(17px, 4.6vw, 18px);
  --sv-t-lg: clamp(20px, 5.5vw, 22px);
  --sv-t-xl: clamp(24px, 7vw, 28px);
  --sv-t-2xl: clamp(28px, 8vw, 36px);
  --sv-t-3xl: clamp(32px, 9vw, 44px);
  /* Colors — dark default */
  --sv-bg: #07080F;
  --sv-bg-2: #0D0F1B;
  --sv-fg: #F0F1F5;
  --sv-fg-dim: #B8BDD0;
  --sv-fg-muted: #8B92A8;
  --sv-accent: #1B4B3A;
  --sv-gold: #C9A86C;
  --sv-gold-2: #B8965A;
  --sv-teal: #1FCFC6;
  --sv-red: #EF4444;
  --sv-line: rgba(255,255,255,.10);
  --sv-line-2: rgba(255,255,255,.06);
  --sv-card: rgba(255,255,255,.04);
  --sv-shadow: 0 2px 12px rgba(0,0,0,.2);
  /* Fonts */
  --sv-serif: 'Fraunces', Georgia, serif;
  --sv-sans: 'Geist', system-ui, sans-serif;
}
:root[data-theme="light"] {
  --sv-bg: #FFFFFF;
  --sv-bg-2: #FAF7F2;
  --sv-fg: #0E1220;
  --sv-fg-dim: #44495C;
  --sv-fg-muted: #6E7388;
  --sv-line: rgba(14,18,32,.08);
  --sv-line-2: rgba(14,18,32,.04);
  --sv-card: #FFFFFF;
  --sv-shadow: 0 2px 8px rgba(14,18,32,.04);
}

/* === LAYOUT BASE === */
.sv-container { padding: 0 var(--sv-s4); max-width: 100%; margin: 0 auto; }
.sv-section { padding: var(--sv-s7) 0; }
.sv-section--tight { padding: var(--sv-s6) 0; }

/* === TYPOGRAPHY HELPERS === */
.sv-overline {
  font-size: var(--sv-t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sv-gold);
  font-weight: 600;
}
h1, .sv-h1 { font-family: var(--sv-serif); font-size: var(--sv-t-3xl); font-weight: 300; line-height: 1.1; letter-spacing: -0.02em; }
h2, .sv-h2 { font-family: var(--sv-serif); font-size: var(--sv-t-2xl); font-weight: 300; line-height: 1.15; letter-spacing: -0.015em; }
h3, .sv-h3 { font-family: var(--sv-serif); font-size: var(--sv-t-xl); font-weight: 400; line-height: 1.2; }
em { font-style: italic; color: var(--sv-gold); }
.sv-lead { font-size: var(--sv-t-md); color: var(--sv-fg-dim); line-height: 1.55; }
.sv-text { font-size: var(--sv-t-base); color: var(--sv-fg-dim); line-height: 1.6; }

/* === NAV === */
.sv-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--sv-bg);
  border-bottom: 1px solid var(--sv-line);
  height: 56px;
}
.sv-nav__inner { display: flex; align-items: center; gap: var(--sv-s2); height: 56px; padding: 0 var(--sv-s4); }
.sv-nav__logo { flex: 1; min-width: 0; }
.sv-nav__brand { font-family: var(--sv-serif); font-size: 17px; font-weight: 500; }
.sv-nav__btn {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--sv-fg);
}
.sv-nav__btn--theme { background: var(--sv-card); border: 1px solid var(--sv-line); }
.sv-nav__btn--burger { background: transparent; }
.sv-nav__btn--burger span {
  width: 22px; height: 2px;
  background: currentColor;
  display: block; margin: 3px 0;
  transition: transform .2s ease;
}

/* === HERO === */
.sv-hero { padding: var(--sv-s5) 0 var(--sv-s7); }
.sv-hero__visual {
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  border-radius: var(--sv-r-lg);
  background: var(--sv-bg-2);
  margin-bottom: var(--sv-s5);
}
.sv-hero__visual img, .sv-hero__visual picture {
  width: 100%; height: 100%; object-fit: cover;
}
.sv-hero__pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--sv-t-sm);
  padding: 6px 12px;
  border-radius: var(--sv-r-pill);
  background: var(--sv-card);
  border: 1px solid var(--sv-line);
  margin-bottom: var(--sv-s4);
}
.sv-hero__pill::before {
  content: ''; width: 6px; height: 6px;
  background: var(--sv-teal); border-radius: 50%;
}
.sv-hero h1 { margin-bottom: var(--sv-s4); }
.sv-hero__desc { margin-bottom: var(--sv-s5); color: var(--sv-fg-dim); font-size: var(--sv-t-base); line-height: 1.55; }
.sv-hero__cta { display: flex; flex-direction: column; gap: var(--sv-s3); }
.sv-hero__rating {
  margin-top: var(--sv-s5);
  display: flex; flex-direction: column; gap: 6px;
  font-size: var(--sv-t-sm);
  color: var(--sv-fg-muted);
}
.sv-hero__stars { color: var(--sv-gold); letter-spacing: 2px; }

/* === BUTTONS === */
.sv-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--sv-r-pill);
  font-family: var(--sv-sans);
  font-size: var(--sv-t-base);
  font-weight: 500;
  min-height: 52px;
  width: 100%;
  text-align: center;
  white-space: normal;
  line-height: 1.2;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sv-btn:active { transform: scale(.98); }
.sv-btn--primary { background: var(--sv-gold); color: #07080F; box-shadow: 0 4px 20px rgba(201,168,108,.25); }
.sv-btn--primary:hover { background: var(--sv-gold-2); }
.sv-btn--ghost { background: transparent; border: 1.5px solid var(--sv-line); color: var(--sv-fg); }
.sv-btn--ghost:hover { background: var(--sv-card); }
.sv-btn--call { color: var(--sv-fg); border: 1.5px solid var(--sv-line); background: transparent; }

/* === QUICK ACCESS === */
.sv-quick { padding: 0 0 var(--sv-s5); }
.sv-quick__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sv-quick__btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  min-height: 96px;
  padding: var(--sv-s4) var(--sv-s2);
  border-radius: var(--sv-r-md);
  border: 1px solid var(--sv-line);
  background: var(--sv-card);
  text-align: center;
}
.sv-quick__btn:active { transform: scale(.97); }
.sv-quick__ico {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--sv-line);
}
.sv-quick__label { font-size: var(--sv-t-sm); font-weight: 600; }
.sv-quick__sub { font-size: var(--sv-t-xs); opacity: .7; }
.sv-quick__btn--urgent { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.25); color: var(--sv-red); }
.sv-quick__btn--urgent .sv-quick__ico { background: rgba(239,68,68,.18); }
.sv-quick__btn--primary { background: var(--sv-gold); border-color: var(--sv-gold); color: #07080F; }
.sv-quick__btn--primary .sv-quick__ico { background: rgba(7,8,15,.12); }
.sv-quick__btn--primary .sv-quick__sub { color: rgba(7,8,15,.65); }
.sv-quick__btn--wa { background: rgba(37,211,102,.08); border-color: rgba(37,211,102,.25); color: #25D366; }
.sv-quick__btn--wa .sv-quick__ico { background: rgba(37,211,102,.18); }

/* === SECTIONS GENERIC === */
.sv-section__head { margin-bottom: var(--sv-s6); }
.sv-section__overline { margin-bottom: var(--sv-s3); }
.sv-section__title { margin-bottom: var(--sv-s4); }
.sv-section__lead { color: var(--sv-fg-dim); font-size: var(--sv-t-base); line-height: 1.6; }

/* === TRUST BADGES (logos prensa) === */
.sv-trust { padding: var(--sv-s6) 0; }
.sv-trust__label {
  text-align: center;
  font-size: var(--sv-t-xs); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sv-fg-muted);
  margin-bottom: var(--sv-s4);
}
.sv-trust__grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--sv-s4) var(--sv-s5);
  text-align: center;
}
.sv-trust__logo {
  font-family: var(--sv-serif);
  font-size: var(--sv-t-md); font-weight: 400;
  color: var(--sv-fg-dim);
}
.sv-trust__logo em { color: var(--sv-fg-dim); font-style: italic; }

/* === SERVICES CARDS === */
.sv-services { padding: var(--sv-s7) 0; }
.sv-services__grid { display: flex; flex-direction: column; gap: var(--sv-s4); }
.sv-card {
  background: var(--sv-bg-2);
  border-radius: var(--sv-r-lg);
  overflow: hidden;
  border: 1px solid var(--sv-line);
  display: flex; flex-direction: column;
}
.sv-card__img {
  width: 100%; aspect-ratio: 3/2;
  overflow: hidden;
  background: var(--sv-card);
}
.sv-card__img img { width: 100%; height: 100%; object-fit: cover; }
.sv-card__body { padding: var(--sv-s5); }
.sv-card__num { font-size: var(--sv-t-xs); color: var(--sv-gold); font-style: italic; margin-bottom: var(--sv-s2); }
.sv-card__title { margin-bottom: var(--sv-s3); }
.sv-card__desc { color: var(--sv-fg-dim); font-size: var(--sv-t-sm); line-height: 1.6; margin-bottom: var(--sv-s4); }
.sv-card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sv-s3); padding-top: var(--sv-s3); border-top: 1px solid var(--sv-line); }
.sv-card__price { display: flex; flex-direction: column; gap: 2px; }
.sv-card__price-lbl { font-size: var(--sv-t-xs); color: var(--sv-fg-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.sv-card__price-num { font-family: var(--sv-serif); font-size: var(--sv-t-xl); color: var(--sv-gold); font-style: italic; }
.sv-card__link { color: var(--sv-fg); font-size: var(--sv-t-sm); padding: 8px 4px; }

/* === STAT BLOCK === */
.sv-stats { padding: var(--sv-s6) 0; }
.sv-stat { padding: var(--sv-s5); border: 1px solid var(--sv-line); border-radius: var(--sv-r-lg); text-align: center; margin-bottom: var(--sv-s4); background: var(--sv-card); }
.sv-stat__num { font-family: var(--sv-serif); font-size: var(--sv-t-3xl); color: var(--sv-gold); margin-bottom: var(--sv-s2); }
.sv-stat__lbl { font-size: var(--sv-t-sm); color: var(--sv-fg-dim); }

/* === TEAM CARDS === */
.sv-team { padding: var(--sv-s7) 0; }
.sv-team__grid { display: flex; flex-direction: column; gap: var(--sv-s5); }
.sv-doctor {
  background: var(--sv-bg-2);
  border-radius: var(--sv-r-lg);
  overflow: hidden;
  border: 1px solid var(--sv-line);
}
.sv-doctor__img { width: 100%; aspect-ratio: 1/1; overflow: hidden; }
.sv-doctor__img img { width: 100%; height: 100%; object-fit: cover; }
.sv-doctor__body { padding: var(--sv-s5); }
.sv-doctor__name { margin-bottom: 6px; }
.sv-doctor__role { font-size: var(--sv-t-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--sv-gold); margin-bottom: var(--sv-s3); }
.sv-doctor__bio { color: var(--sv-fg-dim); font-size: var(--sv-t-sm); line-height: 1.6; margin-bottom: var(--sv-s4); }
.sv-doctor__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sv-doctor__tag { font-size: 11px; padding: 4px 10px; background: var(--sv-card); border: 1px solid var(--sv-line); border-radius: var(--sv-r-pill); color: var(--sv-fg-muted); }

/* === REVIEWS === */
.sv-reviews { padding: var(--sv-s7) 0; }
.sv-review {
  padding: var(--sv-s5);
  border: 1px solid var(--sv-line);
  border-radius: var(--sv-r-lg);
  background: var(--sv-card);
  margin-bottom: var(--sv-s4);
}
.sv-review__stars { color: var(--sv-gold); margin-bottom: var(--sv-s3); letter-spacing: 2px; }
.sv-review__text { font-size: var(--sv-t-base); line-height: 1.55; color: var(--sv-fg); margin-bottom: var(--sv-s3); }
.sv-review__author { font-size: var(--sv-t-sm); color: var(--sv-fg-muted); }

/* === FAQ === */
.sv-faq { padding: var(--sv-s7) 0; }
.sv-faq__item { border-bottom: 1px solid var(--sv-line); padding: var(--sv-s4) 0; }
.sv-faq__q {
  font-family: var(--sv-serif);
  font-size: var(--sv-t-md);
  line-height: 1.3;
  padding: var(--sv-s2) 0;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: var(--sv-s3);
}
.sv-faq__a { color: var(--sv-fg-dim); font-size: var(--sv-t-sm); line-height: 1.6; padding-top: var(--sv-s3); }

/* === CTA FINAL === */
.sv-cta-final {
  padding: var(--sv-s7) var(--sv-s4);
  background: var(--sv-bg-2);
  border-radius: var(--sv-r-lg);
  text-align: center;
  margin: var(--sv-s7) var(--sv-s4);
}
.sv-cta-final h2 { margin-bottom: var(--sv-s4); }
.sv-cta-final p { color: var(--sv-fg-dim); margin-bottom: var(--sv-s5); }

/* === FOOTER === */
.sv-footer { padding: var(--sv-s7) 0 calc(var(--sv-s8) + env(safe-area-inset-bottom)); border-top: 1px solid var(--sv-line); }
.sv-footer__col { margin-bottom: var(--sv-s5); }
.sv-footer__head { font-size: var(--sv-t-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--sv-fg-muted); margin-bottom: var(--sv-s3); }
.sv-footer__list { list-style: none; }
.sv-footer__list a { display: block; padding: 8px 0; font-size: var(--sv-t-base); color: var(--sv-fg-dim); }
.sv-footer__list a:hover { color: var(--sv-fg); }
.sv-footer__bottom { padding-top: var(--sv-s4); border-top: 1px solid var(--sv-line); font-size: var(--sv-t-xs); color: var(--sv-fg-muted); }

/* === STICKY MOBILE CTA BAR === */
#mobile-cta-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 90;
  display: flex; gap: var(--sv-s2);
  padding: var(--sv-s3) var(--sv-s3) calc(var(--sv-s3) + env(safe-area-inset-bottom));
  background: var(--sv-bg);
  border-top: 1px solid var(--sv-line);
}
#mobile-cta-bar > a, #mobile-cta-bar > button {
  flex: 1; min-height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--sv-r-pill);
  font-size: var(--sv-t-sm); font-weight: 500;
  padding: 12px;
}
#mobile-cta-bar > a:first-child { background: var(--sv-card); color: var(--sv-fg); border: 1px solid var(--sv-line); }
#mobile-cta-bar > button { flex: 2; background: var(--sv-gold); color: #07080F; }

/* === SPACE for sticky bar at bottom of body === */
body { padding-bottom: 72px; }

/* === DESKTOP REFINEMENTS === */
@media (min-width: 769px) {
  .sv-container { padding: 0 var(--sv-s7); max-width: 1200px; }
  .sv-section { padding: var(--sv-s9) 0; }
  body { padding-bottom: 0; }
  #mobile-cta-bar { display: none; }
  /* Hero side-by-side desktop */
  .sv-hero__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sv-s8);
    align-items: center;
  }
  .sv-hero__visual { aspect-ratio: 4/5; max-height: 600px; margin: 0; }
  .sv-hero__cta { flex-direction: row; }
  .sv-hero__cta .sv-btn { width: auto; flex: 0 1 auto; }
  /* Quick access 4 cols */
  .sv-quick__grid { grid-template-columns: repeat(4, 1fr); gap: var(--sv-s4); }
  /* Trust grid 6 cols */
  .sv-trust__grid { grid-template-columns: repeat(6, 1fr); }
  /* Services 3 cols */
  .sv-services__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sv-s5); }
  /* Team 3 cols */
  .sv-team__grid { display: grid; grid-template-columns: repeat(3, 1fr); }
  /* Reviews horizontal */
  .sv-reviews__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sv-s5); }
  .sv-review { margin-bottom: 0; }
}
