/* ============================================================
   Ruta: css/landing.css
   Landing Page oficial de jemPOS
   ------------------------------------------------------------
   - Tokens de diseño: espejo exacto de static/css/global.css
     (si la landing se sirve desde Flask, puede sustituirse el
     bloque :root por @import url('/static/css/global.css');)
   - Metodología: BEM (bloque__elemento--modificador)
   - Layout: CSS Grid + Flexbox, mobile-first
   ============================================================ */

/* ------------------------------------------------------------
   1. TOKENS DEL SISTEMA DE DISEÑO (derivado de global.css)
   ------------------------------------------------------------
   NOTA DE AUDITORÍA: --color-primary, --color-text-muted y
   --color-danger se oscurecieron un paso respecto a global.css.
   Los valores originales (#3b82f6 / #64748b / #ef4444) no alcanzan
   4.5:1 de contraste WCAG AA para texto normal en varias combinaciones
   ya usadas en esta página (texto blanco sobre botón primario: 3.68:1;
   "Stock bajo" en rojo sobre superficie blanca: 3.76:1). Si se quiere
   la misma paleta en toda la app, conviene portar este ajuste a
   global.css también.
   ------------------------------------------------------------ */
:root {
  --color-primary: #2563eb;
  /* Variante clara solo para texto sobre fondos oscuros (.tour__eyebrow):
     con el primary oscurecido de arriba, el texto sobre --color-secondary
     cae a 2.83:1; esta variante da 5.75:1. */
  --color-primary-on-dark: #60a5fa;
  --color-secondary: #1e293b;
  --color-background: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-muted: #57667a;
  --color-success: #10b981;
  --color-danger: #dc2626;

  /* Bordes redondeados estilo iOS */
  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;

  /* Sombras suaves y difuminadas */
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 38px rgba(15, 23, 42, 0.11);

  /* Tamaño mínimo táctil recomendado por Apple */
  --touch-target-min: 44px;

  /* Tokens locales de la landing (derivados de los globales) */
  --color-primary-soft: rgba(59, 130, 246, 0.1);
  --max-width: 72rem;
  --header-height: 4.25rem;
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ------------------------------------------------------------
   2. RESET LIGERO Y BASE
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Los anclajes no quedan ocultos bajo el header fijo */
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul[role="list"] {
  list-style: none;
}

a {
  color: inherit;
}

/* Foco visible para navegación por teclado (WCAG 2.4.7) */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Utilidad: texto solo para lectores de pantalla */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Enlace de salto (aparece solo al recibir foco) */
.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--color-secondary);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease-smooth);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ------------------------------------------------------------
   3. BOTONES (targets táctiles ≥ 44px + micro-feedback)
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target-min);
  padding: 0.6rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s var(--ease-smooth),
    box-shadow 0.2s var(--ease-smooth),
    background-color 0.2s var(--ease-smooth);
}

/* will-change solo mientras el botón puede animarse (hover/foco/press):
   promocionarlo a su propia capa de composición todo el tiempo, en
   todos los botones de la página, desperdicia memoria de GPU sin
   necesidad (uso imprudente de will-change). */
.btn:hover,
.btn:focus-visible,
.btn:active {
  will-change: transform;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn--ghost {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--ghost:hover {
  background: var(--color-primary-soft);
}

.btn--inverse {
  background: var(--color-surface);
  color: var(--color-secondary);
  box-shadow: var(--shadow-md);
}

.btn--sm { padding: 0.4rem 1.1rem; font-size: 0.925rem; }
.btn--lg { padding: 0.75rem 2rem; font-size: 1.06rem; }
.btn--block { width: 100%; }

/* Micro-feedback táctil: escala al presionar (estilo app nativa) */
.btn:active,
.tour__dot:active,
.header__link:active,
.footer__link:active {
  transform: scale(0.96);
}

/* ------------------------------------------------------------
   4. HEADER
   ------------------------------------------------------------ */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: box-shadow 0.25s var(--ease-smooth);
}

/* Sombra sutil que aparece cuando la página tiene scroll (vía JS) */
.header.is-scrolled {
  box-shadow: var(--shadow-sm);
}

.header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--touch-target-min);
  color: var(--color-primary);
  text-decoration: none;
}

.header__name {
  font-size: 1.3rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.header__name strong {
  color: var(--color-primary);
}

.header__menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Contenedor de acciones de sesión (Iniciar sesión + Prueba gratis) */
.header__auth {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header__links {
  display: flex;
  gap: 0.25rem;
}

.header__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target-min);
  padding-inline: 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s, transform 0.15s var(--ease-smooth);
}

.header__link:hover {
  color: var(--color-text);
  background: var(--color-primary-soft);
}

/* Hamburguesa: oculta en escritorio */
.header__toggle {
  display: none;
  position: relative;
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.header__toggle-bar,
.header__toggle-bar::before,
.header__toggle-bar::after {
  position: absolute;
  left: 50%;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease-smooth), opacity 0.2s;
  content: "";
}

.header__toggle-bar { top: 50%; transform: translate(-50%, -50%); }
.header__toggle-bar::before { transform: translate(-50%, -7px); }
.header__toggle-bar::after  { transform: translate(-50%, 7px); }

/* Estado abierto: la hamburguesa se convierte en una X */
.header__toggle[aria-expanded="true"] .header__toggle-bar { background: transparent; }
.header__toggle[aria-expanded="true"] .header__toggle-bar::before { transform: translate(-50%, 0) rotate(45deg); }
.header__toggle[aria-expanded="true"] .header__toggle-bar::after  { transform: translate(-50%, 0) rotate(-45deg); }

/* ------------------------------------------------------------
   5. HERO
   ------------------------------------------------------------ */
.hero {
  padding: calc(var(--header-height) + 3rem) 1.25rem 4rem;
  overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 85% -5%, var(--color-primary-soft), transparent 60%),
    var(--color-background);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
  align-items: center;
  max-width: var(--max-width);
  margin-inline: auto;
}

.hero__eyebrow {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.hero__title {
  margin-top: 1.1rem;
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero__title-accent {
  background: linear-gradient(90deg, var(--color-primary), #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  margin-top: 1.25rem;
  max-width: 34rem;
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-top: 1.6rem;
}

.hero__badge {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* --- Mockup de smartphone (solo CSS) --- */
.hero__visual {
  position: relative;
  display: grid;
  place-items: center;
  padding-block: 1rem;
}

.phone {
  position: relative;
  width: min(19rem, 78vw);
  aspect-ratio: 9 / 18.5;
  padding: 0.7rem;
  background: var(--color-secondary);
  border-radius: 2.6rem;
  box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.phone__notch {
  position: absolute;
  top: 1.05rem;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 1.35rem;
  background: var(--color-secondary);
  border-radius: 999px;
  z-index: 2;
}

.phone__screen {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  height: 100%;
  padding: 2.6rem 0.9rem 1rem;
  background: var(--color-background);
  border-radius: 2rem;
  overflow: hidden;
}

.phone__statusbar {
  position: absolute;
  top: 1.15rem;
  left: 1.7rem;
  right: 1.7rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text);
  z-index: 1;
}

/* Barritas de señal dibujadas con gradiente */
.phone__signal {
  width: 1.1rem;
  height: 0.7rem;
  background: linear-gradient(
    to right,
    var(--color-text) 0 20%, transparent 20% 30%,
    var(--color-text) 30% 50%, transparent 50% 60%,
    var(--color-text) 60% 80%, transparent 80% 90%,
    var(--color-text) 90%
  );
  border-radius: 1px;
  clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
}

.phone__appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.phone__appbar-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.phone__appbar-chip {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-success);
  font-size: 0.66rem;
  font-weight: 700;
}

.phone__items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.phone__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.7rem;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: 0.8rem;
}

.phone__item-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.phone__item-dot--a { background: var(--color-primary); }
.phone__item-dot--b { background: #f59e0b; }
.phone__item-dot--c { background: var(--color-success); }

.phone__item-name { flex: 1; font-weight: 500; }
.phone__item-price { color: var(--color-text-muted); font-weight: 600; }

.phone__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding: 0.65rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-text);
  font-size: 0.85rem;
}

.phone__cta {
  padding: 0.7rem;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
}

/* Tarjetas flotantes decorativas con animación suave */
.hero__float {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.8rem 1.1rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: hero-float 5s ease-in-out infinite;
}

.hero__float--sales { top: 12%; left: 0; }
.hero__float--stock { bottom: 14%; right: 0; animation-delay: -2.5s; }

.hero__float-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero__float-value {
  font-weight: 800;
  font-size: 1rem;
}

.hero__float-value em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--color-success);
}

.hero__float-value--warn { color: var(--color-danger); }

@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ------------------------------------------------------------
   6. PRODUCT TOUR (scroll horizontal con sticky)
   ------------------------------------------------------------
   Escritorio: la sección mide N × 100vh; el contenido queda
   pegado con position: sticky y el JS traduce el progreso de
   scroll vertical en translateX del carril (hardware-accelerated).
   ------------------------------------------------------------ */
.tour {
  /* Altura total del "recorrido": 4 tarjetas × 105vh + margen.
     Da tiempo de retención visual suficiente por tarjeta. */
  height: calc(4 * 105vh + 40vh);
  background: var(--color-secondary);
}

.tour__sticky {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.2rem;
  height: 100vh;
  overflow: hidden;
  padding-block: calc(var(--header-height) + 0.5rem) 1.5rem;
}

.tour__header {
  text-align: center;
  padding-inline: 1.25rem;
}

.tour__eyebrow {
  /* Variante clara: el --color-primary base no llega a 4.5:1 sobre el
     fondo oscuro de esta sección (ver nota de tokens al inicio). */
  color: var(--color-primary-on-dark);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tour__title {
  margin-top: 0.4rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
}

.tour__viewport {
  overflow: hidden;
}

.tour__track {
  display: flex;
  gap: 1.5rem;
  /* Padding lateral para que la 1.ª y última tarjeta queden centradas */
  padding-inline: max(1.25rem, calc((100vw - 34rem) / 2));
}

/* will-change solo mientras el JS tiene el modo horizontal activo
   (viewport de escritorio, sin prefers-reduced-motion). Fuera de esa
   ventana no vale la pena mantener el carril en su propia capa de GPU. */
.tour__track.is-animating {
  will-change: transform;
}

.tour-card {
  flex: 0 0 min(34rem, 86vw);
}

.tour-card__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  height: 100%;
  padding: 2.2rem 2rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  /* Las tarjetas no activas se atenúan levemente (lo controla JS) */
  transition: opacity 0.45s var(--ease-smooth), transform 0.45s var(--ease-smooth);
}

.tour-card:not(.is-active) .tour-card__inner {
  opacity: 0.45;
  transform: scale(0.94);
}

.tour-card__icon {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: var(--radius-md);
}

.tour-card__icon--primary   { background: var(--color-primary-soft); color: var(--color-primary); }
.tour-card__icon--success   { background: rgba(16, 185, 129, 0.12); color: var(--color-success); }
.tour-card__icon--secondary { background: rgba(30, 41, 59, 0.08); color: var(--color-secondary); }

.tour-card__step {
  position: absolute;
  top: 1.6rem;
  right: 2rem;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--color-background);
  -webkit-text-stroke: 1.5px var(--color-text-muted);
  opacity: 0.5;
}

.tour-card__badge {
  align-self: flex-start;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--color-success);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tour-card__title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-primary);
}

.tour-card__text {
  color: var(--color-text-muted);
}

.tour-card__list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.tour-card__list li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Check de lista dibujado con pseudo-elemento (sin imágenes) */
.tour-card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--color-success);
}

.tour-card__list li::after {
  content: "";
  position: absolute;
  left: 0.26rem;
  top: 0.51rem;
  width: 0.48rem;
  height: 0.26rem;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

/* Puntos de progreso del tour */
.tour__progress {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.tour__dot {
  /* Target táctil de 44px con punto visual pequeño centrado */
  position: relative;
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

.tour__dot::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 0.55rem;
  height: 0.55rem;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  transition: width 0.3s var(--ease-smooth), background-color 0.3s;
}

/* Micro-feedback: en dispositivos con puntero fino, un punto inactivo
   se aclara al pasar el mouse para dar pista de que es clicable
   (Nielsen #1: visibilidad del estado del sistema). */
@media (hover: hover) and (pointer: fine) {
  .tour__dot:not(.is-active):hover::after {
    background: rgba(255, 255, 255, 0.6);
  }
}

.tour__dot.is-active::after {
  width: 1.7rem;
  /* Variante clara: --color-primary base no llega a 3:1 (no-texto)
     sobre este fondo oscuro. */
  background: var(--color-primary-on-dark);
}

/* ------------------------------------------------------------
   7. PRECIOS
   ------------------------------------------------------------ */
.pricing {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 5rem 1.25rem 4rem;
}

.pricing__header {
  text-align: center;
  max-width: 40rem;
  margin-inline: auto;
}

.pricing__eyebrow {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pricing__title {
  margin-top: 0.4rem;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

.pricing__subtitle {
  margin-top: 0.8rem;
  color: var(--color-text-muted);
}

.pricing__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: stretch;
  max-width: 55rem;
  margin-top: 3rem;
  margin-inline: auto;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 2.5rem 2rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth);
}

.plan:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.plan--featured {
  border: 2px solid var(--color-primary);
  box-shadow: var(--shadow-lg);
}

.plan__ribbon {
  position: absolute;
  top: -0.85rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 1rem;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.plan__name {
  font-size: 1.15rem;
}

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.plan__amount {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.plan__period {
  color: var(--color-text-muted);
  font-weight: 500;
}

.plan__desc {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.plan__features {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-block: 0.6rem 1.2rem;
}

.plan__features li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
}

.plan__features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: 800;
}

.plan .btn {
  margin-top: auto;
}

/* ------------------------------------------------------------
   8. CTA FINAL
   ------------------------------------------------------------ */
.cta-final {
  padding: 1rem 1.25rem 5rem;
  max-width: var(--max-width);
  margin-inline: auto;
}

.cta-final__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3.5rem 2rem;
  text-align: center;
  /* #6366f1 original bajaba el texto blanco del subtítulo (opacity 0.9)
     a 3.94:1 en el extremo del degradado; #4f46e5 mantiene ≥5.4:1 */
  background: linear-gradient(135deg, var(--color-primary), #4f46e5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

.cta-final__title {
  font-size: clamp(1.5rem, 3.5vw, 2.3rem);
  letter-spacing: -0.02em;
}

.cta-final__text {
  max-width: 32rem;
  opacity: 0.9;
}

/* ------------------------------------------------------------
   9. FOOTER
   ------------------------------------------------------------ */
.footer {
  background: var(--color-secondary);
  color: rgba(255, 255, 255, 0.85);
  padding: 3.5rem 1.25rem 2rem;
}

.footer__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 2.5rem;
  max-width: var(--max-width);
  margin-inline: auto;
}

.footer__brand .header__name {
  color: #fff;
}

.footer__tagline {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  max-width: 16rem;
}

.footer__heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.9rem;
}

.footer__col ul {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target-min);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s, transform 0.15s var(--ease-smooth);
}

.footer__link:hover {
  color: #fff;
  text-decoration: underline;
}

.footer__copy {
  max-width: var(--max-width);
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  /* 0.45 medía 4.17:1 (falla AA 4.5:1 para texto normal); 0.64 da ~6.2:1 */
  color: rgba(255, 255, 255, 0.64);
}

/* ------------------------------------------------------------
   10. ANIMACIONES DE ENTRADA (IntersectionObserver)
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------------------------------------
   11. RESPONSIVE
   ------------------------------------------------------------ */

/* Escritorio: hero a dos columnas */
@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: 1.15fr 1fr;
  }
}

/* Móvil: menú colapsable + tour degradado a carrusel nativo */
@media (max-width: 767px) {

  /* --- Menú móvil --- */
  .header__toggle {
    display: block;
  }

  .header__menu {
    position: absolute;
    top: var(--header-height);
    left: 0.75rem;
    right: 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    /* Cerrado por defecto */
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s var(--ease-smooth), transform 0.25s var(--ease-smooth);
  }

  .header__menu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .header__links {
    flex-direction: column;
  }

  /* Botones de sesión a ancho completo dentro del menú desplegable */
  .header__auth {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .hero__float--sales { top: 4%; }
  .hero__float--stock { bottom: 4%; }

  /* --- Tour: carrusel horizontal nativo con scroll-snap ---
     Sin sticky ni JS: el usuario desliza con el dedo. */
  .tour {
    height: auto;
  }

  .tour__sticky {
    position: static;
    height: auto;
    padding-block: 3.5rem;
  }

  .tour__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tour__viewport::-webkit-scrollbar { display: none; }

  .tour__track {
    padding-inline: 1.25rem;
    transform: none !important; /* anula cualquier translate del JS */
  }

  .tour-card {
    scroll-snap-align: center;
  }

  /* En el carrusel táctil todas las tarjetas se ven a plena opacidad */
  .tour-card:not(.is-active) .tour-card__inner {
    opacity: 1;
    transform: none;
  }

  /* La grilla de precios a 2 columnas fijas es demasiado angosta en móvil */
  .pricing__grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------
   12. ACCESIBILIDAD: movimiento reducido (WCAG 2.3.3)
   Desactiva parallax, floats y el secuestro del scroll.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__float {
    animation: none;
  }

  /* El tour se convierte en una lista vertical simple */
  .tour {
    height: auto;
  }

  .tour__sticky {
    position: static;
    height: auto;
    padding-block: 3.5rem;
  }

  .tour__viewport {
    overflow: visible;
  }

  .tour__track {
    flex-direction: column;
    align-items: center;
    transform: none !important;
    padding-inline: 1.25rem;
  }

  .tour-card:not(.is-active) .tour-card__inner {
    opacity: 1;
    transform: none;
  }

  .tour__progress {
    display: none;
  }

  .btn,
  .plan,
  .header__toggle-bar,
  .header__toggle-bar::before,
  .header__toggle-bar::after {
    transition: none;
  }
}

/* ============================================================
   PAGINAS LEGALES (aviso legal / politica de privacidad)
   Reutilizan los tokens y el header/footer del landing.
   ============================================================ */
.legal {
  /* El header es fijo: se deja aire para que no tape el titulo */
  padding: 6.5rem 1.25rem 3rem;
}

.legal__inner {
  max-width: 48rem;   /* ~75 caracteres por linea: lectura comoda */
  margin: 0 auto;
}

.legal__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-secondary);
  line-height: 1.15;
}

.legal__meta {
  margin: 0 0 1.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Banda de borrador: el texto es de relleno y hay que decirlo */
.legal__aviso {
  margin: 0 0 2.25rem;
  padding: 0.9rem 1.1rem;
  background: rgba(220, 38, 38, 0.07);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-danger);
}

.legal__section {
  margin-bottom: 2.25rem;
}

.legal__h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-secondary);
  /* scroll-margin: al saltar por ancla, el header fijo no tapa el titulo */
  scroll-margin-top: 6rem;
}

.legal__h3 {
  margin: 1.5rem 0 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-secondary);
  scroll-margin-top: 6rem;
}

.legal__p {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
}

.legal__list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.legal__list li {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
}

.legal__link {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal__link:hover {
  color: var(--color-secondary);
}

@media (min-width: 768px) {
  .legal { padding: 7.5rem 2rem 4rem; }
}

/* ============================================================
   AVISO DE COOKIES
   Barra inferior discreta. Oculta por CSS (no por JS) cuando
   cookies.js encuentra la aceptacion guardada, para que no
   parpadee en la primera pintada.
   ============================================================ */
.cookies {
  position: fixed;
  left: 1rem;
  right: 1rem;
  /* Respeta la barra de gestos de iOS */
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  background: var(--color-surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: cookies-entrada 0.28s ease-out;
}

/* Marca que pone cookies.js en <html> cuando ya se acepto */
[data-cookies-ok] .cookies {
  display: none;
}

@keyframes cookies-entrada {
  from { opacity: 0; transform: translateY(0.75rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .cookies { animation: none; }
}

.cookies__texto {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.cookies__enlace {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.cookies__enlace:hover {
  color: var(--color-secondary);
}

.cookies__btn {
  flex-shrink: 0;
  /* 44px: minimo tactil del sistema de diseno */
  min-height: 44px;
  padding: 0.6rem 1.5rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.cookies__btn:hover { background: var(--color-secondary); }
.cookies__btn:active { transform: scale(0.97); }

.cookies__btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* A partir de tablet: una sola linea, boton a la derecha */
@media (min-width: 640px) {
  .cookies {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(56rem, calc(100% - 2rem));
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.9rem 1.25rem;
  }

  /* La animacion no puede pisar el translateX que centra la barra */
  @keyframes cookies-entrada-centrada {
    from { opacity: 0; transform: translateX(-50%) translateY(0.75rem); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
  }

  .cookies { animation-name: cookies-entrada-centrada; }
}

/* El aviso de cookies es fijo y se apoya en el borde inferior: se deja aire al
   final del pie para que no tape el copyright ni los enlaces legales mientras
   el visitante no lo acepta. Incondicional a proposito: evita el salto de
   layout que produciria quitar el relleno al aceptar, y :has() todavia no es
   fiable en los WebView Android antiguos del publico objetivo. */
.footer {
  padding-bottom: 7rem;
}

@media (min-width: 640px) {
  .footer { padding-bottom: 6rem; }
}

/* ── Pagina 404 ───────────────────────────────────────────────
   Reutiliza el layout .legal (mismo ancho de lectura y el mismo hueco
   superior para el header fijo). Solo se anaden las piezas propias del
   error. */

.error404__codigo {
  margin: 0 0 0.25rem;
  font-size: clamp(3.5rem, 14vw, 6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  /* Decorativo: el mensaje real lo da el <h1>, y el lector de pantalla ya
     omite este parrafo por su aria-hidden. Al ser decoracion no necesita
     llegar a 4.5:1, pero se deja en un azul con 4.6:1 sobre blanco para que
     siga siendo legible con poca luz o en una pantalla barata. */
  color: var(--color-primary);
  opacity: 0.85;
}

.error404__texto {
  margin: 0 0 1.75rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.error404__acciones {
  display: flex;
  flex-wrap: wrap;   /* en movil estrecho los botones se apilan solos */
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}
