/* Salvia · demo de clínica de medicina estética. Sin dependencias externas. */

@font-face { font-family: "Instrument Sans"; src: url("../assets/fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../assets/fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #fbfbf8;
  --surface: #ffffff;
  --tint: #f1f2ea;
  --ink: #1e241d;
  --muted: #5d6458;
  --line: #e2e4da;
  --olive: #3e4a36;
  --olive-dark: #2c3626;
  --olive-soft: #dfe4d3;
  --orange: #d98e2b;
  --orange-ink: #8a5310;
  --radius: 22px;
  --shadow: 0 14px 40px rgba(30, 36, 29, 0.08);
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

body { margin: 0; font-family: var(--sans); font-size: 1rem; line-height: 1.6; color: var(--ink); background: var(--bg); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
body.chat-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.05; margin: 0 0 0.5em; letter-spacing: -0.03em; font-weight: 600; }
h1 { font-size: clamp(2.6rem, 7vw, 4.8rem); }
h1 em, h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: var(--olive); }
h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.015em; }
h4 { font-size: 1.12rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { top: 12px; }
.container { width: min(1160px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); }
figure { margin: 0; }

.demo-ribbon { background: var(--ink); color: #eef0e8; font-size: 0.8rem; text-align: center; padding: 7px 16px; line-height: 1.4; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px; border-radius: 14px; border: 1.5px solid transparent; font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s, transform .1s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 0.95rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--olive); color: #fff; }
.btn-primary:hover { background: var(--olive-dark); }
.btn-line { background: transparent; color: var(--olive); border-color: var(--olive); }
.btn-line:hover { background: var(--olive); color: #fff; }
/* Degradado de Instagram con contraste suficiente para texto blanco */
.btn-ig { background: linear-gradient(90deg, #8a2bb8 0%, #c1306f 55%, #c44a1e 100%); color: #fff; }
.btn-ig:hover { filter: brightness(0.92); }
.btn-light { background: #fbfbf8; color: var(--olive-dark); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Cabecera */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(251, 251, 248, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; position: relative; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--olive); }
.logo-mark { width: 30px; height: 30px; }
.logo-text { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.04em; color: var(--ink); }
.nav-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); font: 600 0.95rem var(--sans); color: var(--ink); cursor: pointer; }
.nav-toggle-bars { width: 16px; height: 10px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; position: relative; }
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px solid currentColor; }
.main-nav { display: none; }
.main-nav.is-open { display: grid; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; margin-top: 8px; }
.main-nav a { text-decoration: none; font-weight: 500; color: var(--muted); padding: 12px 14px; border-radius: 10px; }
.main-nav a:hover { color: var(--ink); background: var(--tint); }
.header-cta { display: none; }

/* Portada */
.hero { padding: 28px 0 56px; }
.hero-grid { display: grid; gap: 30px; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--olive); background: var(--olive-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.kicker-light { background: rgba(255,255,255,.14); color: #eef0e8; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 32em; }
.hero-ctas { display: flex; flex-direction: column; gap: 12px; margin: 26px 0 26px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: grid; gap: 2px; }
.facts strong { font-size: 1.15rem; letter-spacing: -0.02em; }
.facts span { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.hero-media { position: relative; }
.hero-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-chip { position: absolute; left: 14px; bottom: 14px; background: var(--surface); padding: 10px 14px; border-radius: 14px; box-shadow: var(--shadow); font-size: 0.85rem; display: flex; gap: 8px; align-items: baseline; }
.hero-chip span { color: var(--muted); }

/* Secciones */
.section { padding: 64px 0; scroll-margin-top: 70px; }
.section-tint { background: var(--tint); }
.section-olive { background: var(--olive); color: #eef0e8; }
.section-olive h2 { color: #fff; }
.section-head { max-width: 640px; margin-bottom: 30px; }
.section-lead { color: var(--muted); }

/* Carta */
.menu { border-top: 1.5px solid var(--ink); }
.menu-group { font-size: 0.8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--orange-ink); margin: 28px 0 4px; }
.menu-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: center; }
.menu-info p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.menu-info h4 { margin-bottom: 4px; }
.menu-price { margin: 0; font-weight: 700; font-size: 1.1rem; white-space: nowrap; text-align: right; }
.menu-price span { display: block; font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.menu-price.is-consult { font-size: 0.9rem; font-weight: 600; white-space: normal; max-width: 9em; }
.menu-row .btn { grid-column: 1 / -1; justify-self: start; }

/* Doctor */
.doctor { display: grid; gap: 30px; align-items: center; }
.doctor-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.doctor-copy p { color: #dfe3d6; }
.doctor-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.doctor-list li { padding-left: 26px; position: relative; }
.doctor-list li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); }
.fine { font-size: 0.82rem; color: var(--muted); }
.fine-light { color: #c9cfbf !important; }
.center { text-align: center; }

/* Primera visita */
.visit { display: grid; gap: 30px; align-items: center; }
.timeline { list-style: none; margin: 0; padding: 0; counter-reset: paso; display: grid; gap: 14px; }
.timeline li { counter-increment: paso; display: grid; grid-template-columns: 44px 1fr; gap: 2px 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.timeline li::before { content: counter(paso); grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--olive-soft); color: var(--olive-dark); font-weight: 700; }
.timeline span { color: var(--muted); font-size: 0.95rem; }
.visit-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }

/* Reseñas de ejemplo */
.reviews { display: grid; gap: 14px; }
.reviews-score { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.reviews-score strong { font-size: 2.2rem; letter-spacing: -0.03em; }
.stars { color: var(--orange); letter-spacing: 2px; }
.review { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin: 0; }
.review p { margin: 0 0 8px; }
.review footer { font-size: 0.85rem; color: var(--muted); }
.example-tag { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: #fdf3c4; color: #5b4a12; padding: 3px 8px; border-radius: 6px; }

/* Reserva */
.booking { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); max-width: 780px; }
.booking-step { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.step-label { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 0 0 12px; }
.step-label span { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--olive-soft); color: var(--olive-dark); font-size: 0.85rem; }
select, input[type="text"], input[type="tel"] { width: 100%; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: 500 1rem var(--sans); color: var(--ink); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 23px, calc(100% - 16px) 23px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; text-overflow: ellipsis; }
input:focus, select:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(62, 74, 54, .2); }
input[aria-invalid="true"] { border-color: #b3261e; }
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.day { flex: none; scroll-snap-align: start; width: 66px; min-height: 76px; display: grid; place-content: center; gap: 2px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font-family: var(--sans); color: var(--ink); }
.day .d-w { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.day .d-n { font-size: 1.35rem; font-weight: 700; }
.day .d-m { font-size: 0.72rem; color: var(--muted); }
.day[aria-checked="true"] { background: var(--olive); border-color: var(--olive); color: #fff; }
.day[aria-checked="true"] .d-w, .day[aria-checked="true"] .d-m { color: #dfe4d3; }
.day:disabled { opacity: .4; cursor: not-allowed; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.slot { min-height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: 600 0.98rem var(--sans); color: var(--ink); cursor: pointer; }
.slot[aria-checked="true"] { background: var(--orange); border-color: var(--orange); color: #2b1a04; }
.slot:disabled { background: transparent; color: #a9ad9f; text-decoration: line-through; cursor: not-allowed; }
.hint { grid-column: 1 / -1; color: var(--muted); margin: 0; font-size: 0.95rem; }
.fields { display: grid; gap: 14px; margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.health { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 0 0 16px; }
.health legend { padding: 0 6px; font-weight: 600; font-size: 0.95rem; line-height: 1.45; }
.yn { display: flex; gap: 10px; margin-top: 10px; }
.yn label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; }
.yn label:has(input:checked) { border-color: var(--olive); background: var(--olive-soft); }
.yn input, .check input { accent-color: var(--olive); width: 18px; height: 18px; }
.health-note { margin: 12px 0 0; font-size: 0.92rem; color: var(--olive-dark); background: var(--tint); padding: 10px 12px; border-radius: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; color: var(--muted); }
.check input { margin-top: 3px; flex: none; }
.form-error { color: #b3261e; font-weight: 600; margin: 0 0 14px; }
.booking-done { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); max-width: 780px; border-top: 5px solid var(--orange); }
.booking-done:focus { outline: none; }

/* Preguntas */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative; font-weight: 600; font-size: 1.08rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; font-weight: 400; color: var(--olive); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); padding-bottom: 12px; }

/* Contacto y pie */
.contact { display: grid; gap: 24px; }
.address { font-size: 1.15rem; }
.contact-ctas { display: flex; flex-direction: column; gap: 12px; align-self: center; }
.site-footer { padding: 26px 0 30px; font-size: 0.9rem; }
.footer-inner p { margin: 0 0 6px; }
.footer-links { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.footer-links .linklike { min-height: 44px; }

/* Barra fija en móvil y botón flotante */
.mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(251, 251, 248, .96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.mobile-bar .btn { min-height: 48px; }
.ig-fab { display: none; }

/* Mensajes directos de Instagram simulados */
.chat { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #fff; height: 100vh; height: 100dvh; }
.chat[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 10px; background: #fff; color: #000; padding: calc(8px + env(safe-area-inset-top)) 12px 8px 4px; border-bottom: 1px solid #dbdbdb; }
.chat-back { background: none; border: 0; color: #000; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #c1306f; }
.chat-avatar svg { width: 26px; height: 26px; }
.chat-id h2 { font-size: 1rem; font-weight: 600; margin: 0; letter-spacing: 0; }
.chat-status { margin: 0; font-size: 0.78rem; color: #737373; }
.chat-demo { margin: 0; font-size: 0.75rem; text-align: center; padding: 6px 12px; background: #fdf3c4; color: #5b4a12; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 12px 6px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.msg { max-width: 80%; padding: 9px 13px; border-radius: 20px; font-size: 0.95rem; line-height: 1.42; white-space: pre-line; overflow-wrap: anywhere; }
.msg time { display: none; }
.msg-bot { align-self: flex-start; background: #efefef; color: #000; }
.msg-user { align-self: flex-end; background: #3d5afe; background: linear-gradient(135deg, #5b51d8 0%, #833ab4 100%); color: #fff; }
.msg-day { align-self: center; background: none; color: #737373; font-size: 0.75rem; padding: 4px 10px; }
.msg-clinic { align-self: stretch; max-width: none; background: var(--olive); color: #eef0e8; border-radius: 14px; margin: 6px 0; font-size: 0.88rem; }
.msg-clinic strong { display: block; font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: #f3c98a; margin-bottom: 4px; }
.msg-clinic .flag { display: inline-block; margin-top: 6px; background: #f7d9a8; color: #4a2f0e; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.typing { align-self: flex-start; background: #efefef; border-radius: 20px; padding: 12px 14px; display: flex; gap: 4px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #8e8e8e; animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.chat-chips { display: flex; gap: 8px; padding: 6px 10px; overflow-x: auto; flex-wrap: nowrap; }
.chat-chips:empty { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #dbdbdb; background: #fff; color: #000; font: 600 0.9rem var(--sans); cursor: pointer; }
.chip:hover { background: #fafafa; }
.chat-input { display: flex; gap: 8px; align-items: center; margin: 6px 10px calc(10px + env(safe-area-inset-bottom)); padding: 4px 6px 4px 16px; border: 1px solid #dbdbdb; border-radius: 999px; }
.chat-input input { flex: 1; min-height: 42px; border: 0; padding: 0; font-size: 1rem; background: transparent; }
.chat-input input:focus { box-shadow: none; }
.chat-input button { border: 0; background: none; color: #0a5fc4; font: 700 0.95rem var(--sans); padding: 0 10px; min-height: 42px; cursor: pointer; }

/* Textos legales */
.legal { border: 0; border-radius: var(--radius); padding: 26px; max-width: min(560px, calc(100% - 32px)); box-shadow: var(--shadow); color: var(--ink); background: var(--surface); }
.legal::backdrop { background: rgba(30, 36, 29, .45); }
.legal p { color: var(--muted); font-size: 0.95rem; }

/* Tableta y escritorio */
@media (min-width: 700px) {
  .hero-ctas { flex-direction: row; flex-wrap: wrap; }
  .fields { grid-template-columns: 1fr 1fr; }
  .days { flex-wrap: wrap; overflow-x: visible; }
  .booking { padding: 32px; }
  .menu-row { grid-template-columns: 1fr auto auto; }
  .menu-row .btn { grid-column: auto; }
  .reviews { grid-template-columns: repeat(3, 1fr); }
  .reviews-head { grid-column: 1 / -1; }
  .contact { grid-template-columns: 1fr auto; align-items: center; }
}
@media (min-width: 700px) and (max-width: 959px) {
  .hero-media img, .doctor-photo img, .visit-photo img { max-width: 560px; margin-inline: auto; }
  .hero-chip { left: calc(50% - 266px); }
}
@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .nav-toggle { display: none; }
  .main-nav { display: flex; gap: 24px; position: static; }
  .main-nav a { padding: 0; }
  .main-nav a:hover { background: none; }
  .header-cta { display: inline-flex; }
  .mobile-bar { display: none; }
  .hero { padding: 56px 0 90px; }
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 60px; }
  .section { padding: 96px 0; }
  .doctor { grid-template-columns: 0.85fr 1.15fr; gap: 64px; }
  .visit { grid-template-columns: 1.2fr 0.8fr; gap: 64px; }
  .hero-media img { max-height: min(600px, 72vh); }
  .doctor-photo img { max-height: 620px; }
  .visit-photo img { max-height: 520px; }
  h1 { font-size: clamp(2.6rem, 5.4vw, 4.4rem); }
  .ig-fab { display: grid; place-items: center; position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 62px; height: 62px; border-radius: 20px; border: 0; color: #fff; background: linear-gradient(135deg, #8a2bb8 0%, #c1306f 55%, #c44a1e 100%); box-shadow: 0 10px 26px rgba(193, 48, 111, .35); cursor: pointer; }
  .chat { inset: auto 24px 100px auto; width: 380px; height: min(640px, calc(100vh - 130px)); border-radius: 18px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
  .chat-head { padding-top: 8px; }
}

/* Ajustes tras la segunda verificación */
.chat-chips { flex-wrap: wrap; max-height: 38vh; overflow-y: auto; }
.booking, .booking-done { margin-inline: auto; }
#reserva .section-head { margin-inline: auto; text-align: center; }
.check .linklike { padding-block: 8px; }
