/* ==========================================================================
   NODEX · Base
   Sistema de diseño (variables), reset, tipografía, utilidades y componentes
   compartidos por todas las páginas.

   Guía rápida
   - Mobile-first: los estilos base son para móvil; se amplían con
     @media (min-width: 40em | 60em | 80em)  →  640 / 960 / 1280 px.
   - Nada de colores, tamaños, radios ni sombras a mano: usa las variables.
   - Secciones oscuras: añade .oscuro y los acentos cambian solos.
   - Solo se animan transform y opacity; todo respeta prefers-reduced-motion.
   ========================================================================== */

:root {
  /* ---------- Color ---------- */
  --c-fondo: #FFFFFF;
  --c-superficie: #F6F6F6;          /* tarjetas y bandejas */
  --c-superficie-2: #F2F2F2;        /* rellenos sutiles dentro de tarjetas */
  --c-tinta: #0A0A0A;               /* texto principal y fondos oscuros */
  --c-tinta-2: #1A1A1A;             /* superficies sobre fondo oscuro */
  --c-texto-2: #3F3F3F;             /* texto secundario fuerte */
  --c-texto-3: #5C5C5C;             /* texto secundario (6.9:1 sobre blanco) */
  --c-texto-osc: #A3A3A3;           /* texto secundario sobre oscuro (7.9:1) */
  --c-borde: #E5E5E5;
  --c-borde-osc: #2A2A2A;
  --c-laton: #8A6A4A;               /* acento de marca para rellenos */
  --c-laton-osc: #7A5A3A;           /* acento para texto sobre claro (5.9:1) */
  --c-laton-claro: #C9A27A;         /* acento sobre oscuro */
  --c-senal: #4F6B4A;               /* estado "en línea" */
  --c-senal-fondo: #E5F2EB;
  --c-error: #A3392C;
  --c-error-fondo: #FBF4F2;
  --c-wa: #25D366;                  /* solo el logotipo de WhatsApp */

  /* Acentos semánticos (cambian dentro de .oscuro) */
  --acento: var(--c-laton-osc);
  --acento-relleno: var(--c-laton);

  /* ---------- Tipografía ---------- */
  --f-sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --t-xs: .75rem;                                         /* 12 · etiquetas */
  --t-sm: .875rem;                                        /* 14 · notas */
  --t-base: 1rem;                                         /* 16 · textos de tarjeta */
  --t-cuerpo: clamp(1.0625rem, .95rem + .3vw, 1.3125rem); /* 17→21 · cuerpo */
  --t-md: clamp(1rem, .9rem + .3vw, 1.25rem);             /* 16→20 */
  --t-lg: clamp(1.125rem, .95rem + .55vw, 1.625rem);      /* 18→26 · entradillas */
  --t-h3: clamp(1.375rem, 1rem + .9vw, 2.25rem);          /* 22→36 */
  --t-xl: clamp(1.5rem, 1rem + 1.8vw, 3.25rem);           /* 24→52 */
  --t-h2: clamp(2rem, .7rem + 4.4vw, 6.25rem);            /* 32→100 */
  --t-h1: clamp(2.5rem, .8rem + 6.4vw, 8.5rem);           /* 40→136 */
  --t-cifra: clamp(3rem, 1.5rem + 4.5vw, 7rem);           /* números grandes */

  /* ---------- Espacio (base 4px) ---------- */
  --e-1: .25rem; --e-2: .5rem; --e-3: .75rem; --e-4: 1rem; --e-5: 1.5rem;
  --e-6: 2rem; --e-7: 3rem; --e-8: 4rem;
  --e-bloque: clamp(2.5rem, 2rem + 2vw, 4.5rem);          /* entre cabecera y contenido */
  --e-seccion: clamp(4rem, 2.5rem + 6vw, 8.5rem);         /* padding vertical de sección */
  --gutter: clamp(1rem, .2rem + 3.6vw, 5rem);
  --max: 118rem;
  --max-texto: 62rem;

  /* ---------- Radios ---------- */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-2xl: 28px; --r-pill: 999px;

  /* ---------- Sombras ---------- */
  --sombra-1: 0 1px 2px rgba(10,10,10,.05);
  --sombra-2: 0 1px 2px rgba(10,10,10,.04), 0 30px 60px -40px rgba(10,10,10,.3);
  --sombra-3: 0 20px 50px -24px rgba(10,10,10,.45);
  --sombra-flotante: 0 12px 30px -16px rgba(10,10,10,.45);

  /* ---------- Capas ---------- */
  --z-1: 1; --z-2: 2;
  --z-flotante: 40; --z-nav: 50; --z-modal: 60; --z-textura: 150; --z-intro: 200;

  /* ---------- Movimiento ---------- */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-suave: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --d-rapida: 160ms; --d-media: 280ms; --d-lenta: 800ms;
}

/* Secciones oscuras: los acentos pasan a latón claro */
.oscuro { --acento: var(--c-laton-claro); --acento-relleno: var(--c-laton-claro); color: var(--c-fondo); }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; scrollbar-color: var(--c-texto-osc) var(--c-fondo); }
body {
  margin: 0; overflow-x: clip;
  background: var(--c-fondo); color: var(--c-tinta);
  font-family: var(--f-sans); font-size: var(--t-cuerpo); line-height: 1.6; letter-spacing: -.005em;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--acento); text-underline-offset: .2em; text-decoration-thickness: 1px; }
::selection { background: var(--c-laton); color: var(--c-fondo); }
:focus-visible { outline: 2px solid var(--acento-relleno); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.05; letter-spacing: -.03em; text-wrap: balance; }
h1 { font-size: var(--t-h1); line-height: .98; letter-spacing: -.045em; }
h2 { font-size: var(--t-h2); line-height: 1; letter-spacing: -.045em; }
h3 { font-size: 1.25rem; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
figure { margin: 0; }

/* Textura de papel muy sutil sobre toda la página */
body::after {
  content: ""; position: fixed; inset: 0; z-index: var(--z-textura); pointer-events: none; opacity: .035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Utilidades ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: absolute; left: var(--e-4); top: -4rem; z-index: calc(var(--z-intro) + 1);
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 var(--e-4);
  border-radius: var(--r-pill); background: var(--c-tinta); color: var(--c-fondo); font-size: var(--t-sm); text-decoration: none;
}
.skip:focus { top: var(--e-4); }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.seccion { padding-block: var(--e-seccion); }
.seccion--pegada { padding-top: 0; }

/* Cabecera de sección: etiqueta + titular + entradilla, centrados */
.cab-seccion { text-align: center; }
.cab-seccion h2 { max-width: 22ch; margin: var(--e-5) auto 0; }
.entrada { max-width: var(--max-texto); margin: var(--e-5) auto 0; font-size: var(--t-lg); line-height: 1.55; color: var(--c-texto-3); }
.oscuro .entrada { color: var(--c-texto-osc); }
.nota { font-size: var(--t-sm); line-height: 1.55; color: var(--c-texto-3); }
.oscuro .nota { color: var(--c-texto-osc); }

/* Etiqueta de sección: texto fino entre dos líneas cortas */
.pastilla {
  display: inline-flex; align-items: center; gap: var(--e-3); text-align: center;
  font-size: var(--t-xs); font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--c-texto-3);
}
.pastilla i, .pastilla::after { flex: none; width: 28px; height: 1px; background: currentColor; }
/* el espaciado entre letras deja aire tras la última: se compensa para que quede simétrica */
.pastilla::after { content: ""; margin-left: -.18em; }
.oscuro .pastilla { color: var(--c-texto-osc); }

/* ---------- Botones (píldora) ---------- */
.btn {
  --bg: var(--c-tinta); --fg: var(--c-fondo); --bg-hover: var(--acento);
  display: inline-flex; align-items: center; justify-content: center; gap: .75em;
  min-height: 3.25rem; padding: var(--e-2) .55rem var(--e-2) 1.4rem;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bg); border-radius: var(--r-pill);
  font-size: var(--t-base); font-weight: 500; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: transform var(--d-rapida) var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn:active { transform: scale(.97); }
.btn .flecha { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--fg); color: var(--bg); }
.btn .flecha svg { width: 16px; height: 16px; }
.btn--simple { padding-inline: 1.5rem; }
.btn--laton { --bg: var(--c-laton); --fg: var(--c-fondo); --bg-hover: var(--c-laton-osc); }
.btn--claro { --bg: var(--c-fondo); --fg: var(--c-tinta); --bg-hover: var(--c-superficie); border-color: var(--c-borde); }
.btn--claro .flecha { background: var(--c-tinta); color: var(--c-fondo); }
.oscuro .btn--claro { --bg: transparent; --fg: var(--c-fondo); --bg-hover: var(--c-tinta-2); border-color: var(--c-borde-osc); }
.oscuro .btn--claro .flecha { background: var(--c-fondo); color: var(--c-tinta); }
.btn--sm { min-height: 2.75rem; padding: var(--e-2) 1.1rem; font-size: .9375rem; }
.btn--ancho { width: 100%; justify-content: space-between; }
.btn-wa svg { flex: none; width: 22px; height: 22px; color: var(--c-wa); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { --bg: var(--bg-hover); }
}

/* ---------- Marca ---------- */
.marca { display: inline-flex; align-items: center; gap: .6rem; color: var(--c-tinta); text-decoration: none; }
.oscuro .marca { color: var(--c-fondo); }
.marca svg.iso { flex: none; width: 26px; height: 26px; }
.logotipo { font-size: .9375rem; font-weight: 700; line-height: 1; letter-spacing: .26em; margin-right: -.26em; }
.iso-c { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--c-tinta); color: var(--c-fondo); }
.iso-c svg { width: 20px; height: 20px; }

/* Indicador "en línea" */
.punto { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c-senal); }
.punto::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--c-senal); animation: latido 2.4s var(--ease-out) infinite; }
@keyframes latido { 0% { transform: scale(.6); opacity: .9; } 70%, 100% { transform: scale(1.6); opacity: 0; } }
.atendiendo { display: inline-flex; align-items: center; gap: .55rem; font-size: .8125rem; font-weight: 500; color: var(--c-senal); }

/* ---------- Sello de garantía ---------- */
.sello { position: relative; width: min(100%, 12rem); aspect-ratio: 1; margin-inline: auto; color: var(--acento-relleno); }
.sello svg { width: 100%; height: 100%; }
.sello .anillo { transform-origin: 50% 50%; }
.sello text { font-size: 10.5px; font-weight: 500; letter-spacing: 3.2px; fill: currentColor; }
.sello .centro-sello { font-size: 52px; font-weight: 600; letter-spacing: -2px; }
.sello .centro-sello.dias { font-size: 12px; font-weight: 500; letter-spacing: 4px; }

/* ---------- Aparición suave al entrar en pantalla ---------- */
.js .revela { opacity: 0; transform: translateY(18px); transition: opacity var(--d-lenta) var(--ease-out), transform var(--d-lenta) var(--ease-out); }
.js .revela.visto { opacity: 1; transform: none; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .punto::after { animation: none; }
  .js .revela { transform: none; transition: opacity 300ms ease; }
}
