/* =========================================================
   ODONTO EXCELLENCE — Sistema visual
   Concepto: "Precisión cálida" — carbón + hueso, rojo de marca
   usado como acento de autoridad, tipografía editorial serif
   para titulares y sans humanista para cuerpo/UI.
   ========================================================= */

:root {
  /* Color — extraído y verificado del logo y CSS original de marca */
  --red: #F20405;
  --red-dark: #C40304;
  --red-tint: #FDEBEA;
  --ink: #1C1C1E;
  --ink-soft: #55555A;
  --ink-faint: #8A8A8E;
  --paper: #FFFFFF;
  --bone: #FBF9F7;
  --bone-deep: #F3EFEA;
  --line: #E8E2DA;

  /* Tipografía */
  --font-display: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Espaciado */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 3.25rem;
  --space-9: 4.5rem;
  --space-10: 5.5rem;

  /* Forma */
  --radius-sm: 8px;
  --radius-md: 18px;
  --radius-lg: 32px;
  --shadow-soft: 0 20px 45px -20px rgba(28, 28, 30, .25);
  --shadow-red: 0 16px 32px -14px rgba(242, 4, 5, .45);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .5s;
}

/* =========================== RESET =========================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; cursor: pointer; }
svg { width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: .8em 1.4em;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.wrap {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.eyebrow {
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.eyebrow-light { color: #ffb3ae; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; color: var(--ink); }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.05; letter-spacing: -.01em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.15; }
h3 { font-size: 1.3rem; line-height: 1.3; }

.section { padding: var(--space-9) 0; position: relative; overflow: hidden; }
.section-alt { background: var(--bone); }
.section-head { max-width: 640px; margin-bottom: var(--space-7); }
.section-lead { margin-top: var(--space-3); color: var(--ink-soft); font-size: 1.05rem; }

/* Reveal on scroll — cascade timing set per-item via --stagger (JS) */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--stagger, 0) * 90ms);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* Ambient glow — soft brand-colored light, fills negative space, drifts slowly */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  will-change: transform;
}
.ambient-glow--red { background: radial-gradient(circle, rgba(242,4,5,.16), rgba(242,4,5,0) 70%); }
.ambient-glow--ink { background: radial-gradient(circle, rgba(28,28,30,.10), rgba(28,28,30,0) 70%); }
@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3%, -6%) scale(1.08); }
}
@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-4%, 5%) scale(.94); }
}
.ambient-glow.a { animation: drift-a 16s ease-in-out infinite; }
.ambient-glow.b { animation: drift-b 20s ease-in-out infinite; }
.section > .wrap, .hero > .wrap, .trust-strip > .wrap { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .ambient-glow { animation: none !important; }
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--red);
  z-index: 900;
  transition: width .1s linear;
}

/* =========================== BUTTONS =========================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .95em 1.9em;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform .25s var(--ease), box-shadow var(--dur) var(--ease);
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 66%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
  z-index: 1;
  pointer-events: none;
}
.btn:hover::before { transform: translateX(120%); }
.btn-primary {
  background: var(--red);
  color: var(--paper);
  box-shadow: var(--shadow-red);
}
.btn-primary:hover {
  background: var(--paper);
  color: var(--red);
  border-color: var(--red);
  transform: translateY(-2px);
}
.btn-sm { padding: .65em 1.4em; font-size: .85rem; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-inverse {
  background: var(--paper);
  color: var(--red);
}
.btn-inverse:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }

/* =========================== HEADER =========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(251, 249, 247, 0);
  backdrop-filter: blur(0px);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), backdrop-filter var(--dur) var(--ease);
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding-block: var(--space-4);
}
.brand-logo { height: 40px; width: auto; max-width: 46vw; }

.main-nav ul { display: flex; gap: var(--space-6); }
.main-nav a {
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 4px;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: var(--space-4); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================== HERO =========================== */
.hero { padding-top: var(--space-8); padding-bottom: var(--space-10); overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
}
.hero-lead { margin-top: var(--space-5); font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-7); }
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}
.hero-badges li {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: .02em;
  position: relative;
  padding-left: 1.1em;
}
.hero-badges li::before {
  content: "";
  position: absolute;
  left: 0; top: .5em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.hero-visual { position: relative; perspective: 1200px; will-change: transform; }
.hero-photo-frame {
  border-radius: 200px 24px 200px 24px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  aspect-ratio: 4 / 3;
  transform: rotateX(0deg) rotateY(0deg);
  transition: transform .4s var(--ease);
  transform-style: preserve-3d;
}
.hero-photo-frame img {
  width: 100%; height: 100%; object-fit: cover;
  animation: ken-burns 18s ease-in-out infinite alternate;
}
@keyframes ken-burns {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.07) translate(-1%, -1%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-photo-frame img { animation: none; }
}

.hero-float-card {
  position: absolute;
  left: -6%;
  bottom: -8%;
  background: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 230px;
}
.hero-float-icon {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--red-tint);
  color: var(--red);
  padding: 9px;
}
.hero-float-card strong { display: block; font-size: .8rem; color: var(--ink-soft); font-weight: 600; }
.hero-float-card a { font-weight: 700; text-decoration: none; color: var(--ink); }

/* =========================== TRUST STRIP =========================== */
.trust-strip { background: var(--ink); padding: var(--space-6) 0; }
.trust-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
.trust-item { display: flex; align-items: center; gap: var(--space-4); color: #E8E6E4; }
.trust-item svg { width: 26px; height: 26px; flex: none; color: var(--red); }
.trust-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: #9A9A9E; margin-bottom: 2px; }
.trust-item a { text-decoration: none; font-weight: 600; }
.trust-item a:hover { color: var(--red); }

/* =========================== NOSOTROS =========================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}
.about-copy p { color: var(--ink-soft); margin-top: var(--space-4); max-width: 56ch; }
.about-copy .btn { margin-top: var(--space-6); }

.about-features { display: flex; flex-direction: column; gap: var(--space-6); }
.about-features li { display: flex; gap: var(--space-4); }
.about-features .num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--red);
  flex: none;
  width: 2.2ch;
}
.about-features strong { display: block; margin-bottom: var(--space-1); }
.about-features p { color: var(--ink-soft); font-size: .95rem; }

/* =========================== SERVICIOS =========================== */
.services-index { border-top: 1px solid var(--line); }
.service-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: var(--space-5);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left var(--dur) var(--ease);
}
.service-row:hover { padding-left: var(--space-3); }
.service-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink-faint);
  padding-top: .1em;
}
.service-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--bone-deep);
  color: var(--red);
  padding: 11px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.service-row:hover .service-icon { background: var(--red); color: var(--paper); transform: rotate(-8deg); }
.service-copy h3 { margin-bottom: var(--space-2); }
.service-copy p { color: var(--ink-soft); max-width: 58ch; }

/* =========================== FINANCIAMIENTO =========================== */
.financing { background: var(--ink); color: var(--paper); }
.financing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}
.financing-copy h2 { color: var(--paper); }
.financing-copy p { margin-top: var(--space-4); color: #C8C7C6; max-width: 50ch; }
.financing-copy .btn { margin-top: var(--space-6); }

.financing-stats { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
.stat-card {
  background: #29292C;
  border-radius: var(--radius-md);
  padding: var(--space-6);
  border: 1px solid #38383B;
}
.stat-number, .stat-word {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--red);
  line-height: 1;
}
.stat-suffix { font-size: 1.1rem; font-weight: 700; margin-left: .2em; color: #C8C7C6; }
.stat-card p { margin-top: var(--space-3); color: #A9A8A7; font-size: .92rem; }

/* =========================== CONTACTO =========================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}
.contact-list { display: flex; flex-direction: column; gap: var(--space-5); margin-bottom: var(--space-6); }
.contact-list strong { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin-bottom: 2px; }
.contact-list a { text-decoration: none; font-weight: 600; }
.contact-list a:hover { color: var(--red); }

.social-links { display: flex; gap: var(--space-3); margin-bottom: var(--space-6); }
.social-links a {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.social-links a svg { width: 18px; height: 18px; }
.social-links a:hover { background: var(--red); border-color: var(--red); color: var(--paper); }

.map-frame { border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-soft); }
.map-frame iframe { display: block; }

.contact-form {
  background: var(--bone);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
}
.form-note { color: var(--ink-soft); margin-bottom: var(--space-5); }
.form-field { margin-bottom: var(--space-5); }
.form-field label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: var(--space-2); }
.form-field input, .form-field textarea {
  width: 100%;
  padding: .85em 1em;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--paper);
  font: inherit;
  color: var(--ink);
  resize: vertical;
  transition: border-color var(--dur) var(--ease);
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--red); outline: none; }
.form-status { margin-top: var(--space-4); font-size: .9rem; font-weight: 600; min-height: 1.2em; }
.form-status.is-success { color: #1a7d3a; }
.form-status.is-error { color: var(--red-dark); }

/* =========================== FOOTER =========================== */
.site-footer { background: var(--ink); color: #C8C7C6; padding-top: var(--space-8); }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  padding-bottom: var(--space-7);
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  margin-bottom: var(--space-5);
}
.footer-logo img { width: 40px; height: 40px; flex: none; border-radius: 7px; }
.footer-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.footer-logo-text .fw-small {
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .22em;
  color: #9A9A9E;
}
.footer-logo-text .fw-serif {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--paper);
}
.footer-brand p { max-width: 32ch; }
.footer-brand .social-links a { border-color: #3A3A3D; color: #C8C7C6; }
.footer-nav h3, .footer-contact h3 { font-family: var(--font-body); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--paper); margin-bottom: var(--space-4); }
.footer-nav ul { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--paper); }
.footer-contact p { margin-bottom: var(--space-3); }
.footer-contact a { text-decoration: none; }
.footer-contact a:hover { color: var(--paper); }
.footer-bottom { border-top: 1px solid #3A3A3D; padding-block: var(--space-5); font-size: .85rem; }
.footer-legal { margin-bottom: var(--space-2); }
.footer-legal a, .footer-bottom a { text-decoration: underline; text-underline-offset: 2px; color: #C8C7C6; }
.footer-legal a:hover, .footer-bottom a:hover { color: var(--paper); }

/* =========================== WHATSAPP FAB =========================== */
.whatsapp-fab {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--red);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-red);
  z-index: 400;
  padding: 15px;
  animation: fab-pulse 2.8s ease-in-out infinite;
}
.whatsapp-fab:hover { transform: scale(1.06); }
@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242,4,5,.35), var(--shadow-red); }
  50% { box-shadow: 0 0 0 12px rgba(242,4,5,0), var(--shadow-red); }
}

/* =========================== LEGAL PAGES =========================== */
.legal-content { max-width: 760px; }
.legal-content .legal-updated { color: var(--ink-faint); font-size: .85rem; margin-bottom: var(--space-7); }
.legal-content h2 { font-size: 1.5rem; margin-top: var(--space-8); margin-bottom: var(--space-3); }
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content p { color: var(--ink-soft); margin-bottom: var(--space-4); max-width: 68ch; }
.legal-content ul { margin: 0 0 var(--space-4); padding-left: 1.2em; list-style: disc; color: var(--ink-soft); }
.legal-content ul li { margin-bottom: var(--space-2); max-width: 64ch; }
.legal-content a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.legal-content a:hover { color: var(--red-dark); }
.back-home { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; text-decoration: none; color: var(--ink-soft); margin-bottom: var(--space-6); }
.back-home:hover { color: var(--red); }

/* =========================== RESPONSIVE =========================== */
@media (min-width: 640px) {
  .trust-grid { grid-template-columns: repeat(3, 1fr); }
  .financing-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; }
  .about-grid { grid-template-columns: 1.2fr .8fr; }
  .financing-grid { grid-template-columns: 1fr 1fr; align-items: center; }
  .financing-stats { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.4fr .8fr .8fr 1fr; }
}

@media (min-width: 1000px) {
  .financing-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 859px) {
  .main-nav {
    position: fixed;
    inset: 0 0 0 30%;
    background: var(--paper);
    transform: translateX(100%);
    transition: transform .4s var(--ease);
    padding: calc(var(--space-8) + 60px) var(--space-6) var(--space-6);
    box-shadow: -20px 0 40px rgba(0,0,0,.1);
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: var(--space-5); }
  .main-nav a { font-size: 1.1rem; }
  .nav-toggle { display: flex; }
  .header-actions .btn-sm { display: none; }
}

@media (max-width: 480px) {
  .hero-float-card { position: static; margin-top: var(--space-5); max-width: none; }
  .hero-photo-frame { border-radius: 120px 20px 120px 20px; }
  .contact-form { padding: var(--space-5); }
}

/* El brillo decorativo y el menú lateral cerrado no deben generar desplazamiento de costado en el celular */
html, body { overflow-x: clip; }
