/* Base común de las demos. Cada demo define sus tokens en :root (colores, tipografías, radio). */
:root {
  --bg: #fff;
  --surface: #fff;
  --ink: #111;
  --muted: #666;
  --line: #e5e5e5;
  --accent: #111;
  --accent-ink: #fff;
  --radius: 10px;
  --font-display: Georgia, serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--bg); border-radius: var(--radius);
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* Formularios */
.field { display: grid; gap: 6px; }
.field > span, .field-label { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
select.input, input.input { height: 52px; padding-block: 0; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field-error { min-height: 1.2em; font-size: 0.8rem; color: #c0392b; }
.input[aria-invalid='true'] { border-color: #c0392b; }

/* Botón flotante de WhatsApp */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 20px 0 16px; border-radius: 999px;
  background: #1f9d55; color: #fff; text-decoration: none; font-weight: 600;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
  transition: transform 0.2s var(--ease);
}
.wa-float:hover { transform: translateY(-2px); }
.wa-float svg { width: 26px; height: 26px; }
@media (max-width: 600px) {
  .wa-float { width: 56px; padding: 0; justify-content: center; }
  .wa-float span { display: none; }
}

/* Aparición al hacer scroll: solo se oculta cuando hay JavaScript */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal='fade'] { transform: none; }

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