/* =========================================================================
   ARCHIVO: frontend/public/landing/styles.css
   PROPÓSITO: Hoja base de estilos y tokens visuales compartidos de la landing
              comercial (index.html) y del Developer Hub público (neuroapi.html).
   MÓDULO: Frontend / Landing
   DEPENDENCIAS: [frontend/public/landing/neuroapi.css, assets/*]
   ÚLTIMA MODIFICACIÓN: 2026-09-30 - Cobertura responsive completa
              (1024/880/768/480/360px) sin alterar el diseño de escritorio.
   ========================================================================= */

:root {
  --bg: #FFFFFF;
  --bg-soft: #F8F9FA;
  --ink: #111111;
  --ink-2: #4A4A4A;
  --ink-3: #666666;
  --line: #E5E5E5;
  --line-2: #DCDCDC;
  --font-display: "Space Grotesk", "Montserrat", sans-serif;
  --font-body: "Inter", "Space Grotesk", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  /* Escala global del contenido al 80%: el diseño original se veía sobredimensionado en
     portátiles y móviles. Todo el CSS está en rem/em, así que basta ajustar la raíz.
     En pantallas pequeñas se sube para no castigar la legibilidad táctil. */
  font-size: 12.8px; /* 16px × 0.8 */
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  body { font-size: 14px; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
}

.btn, .nav-toggle, .wa-bar, .wa-float { touch-action: manipulation; }

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

/* Blindaje base contra desbordamiento horizontal: ninguna imagen, video ni
   contenedor embebido puede exceder su columna. `height: auto` preserva la
   proporción real de cada pieza (el <video> del hero no se deforma nunca). */
img, video, iframe, embed, object, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Reserva el alto del video del hero según su proporción nativa y evita que
   cualquier contenedor de rejilla lo estire (deformación) al cambiar de ancho. */
video { display: block; align-self: center; }

/* Los hijos de rejillas y flex deben poder encogerse por debajo de su contenido
   mínimo; sin esto, una tabla o un bloque <pre> ancho desborda la página. */
.productos-grid > *,
.selector-grid > *,
.features-grid > *,
.how-grid > *,
.footer-grid > *,
.neuroapi-cards-grid > *,
.hero > *,
.opt-card,
.feature,
.how-step,
.footer-col {
  min-width: 0;
}

/* Enlaces y botones largos (URLs, correos) se parten en móvil en lugar de
   empujar el ancho del documento. */
a, p, li, h1, h2, h3, h4, td, th, .section-title, .hero-title, .opt-title,
.feature h3, .how-step h3, .producto-text, .producto-list li {
  overflow-wrap: break-word;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: 1060px; /* Reduced from 1200px */
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Background geometry ---------- */
.bg-geo {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
.geo-lines {
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

/* Neuron pulses animation */
.pulse {
  stroke-dasharray: 150 3000;
  stroke-dashoffset: 3000;
  stroke-linecap: round;
  animation: pulse-anim linear infinite;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.7));
}
.p1 { animation-duration: 8s; animation-delay: 0s; }
.p2 { animation-duration: 11s; animation-delay: 2s; }
.p3 { animation-duration: 7s; animation-delay: 4s; }
.p4 { animation-duration: 9s; animation-delay: 1s; }
.p5 { animation-duration: 6s; animation-delay: 3s; }
.p6 { animation-duration: 10s; animation-delay: 5s; }
.p7 { animation-duration: 14s; animation-delay: 0s; }
.p8 { animation-duration: 16s; animation-delay: 3s; }
.p9 { animation-duration: 7s; animation-delay: 2s; }

@keyframes pulse-anim {
  0% {
    stroke-dashoffset: 3000;
    stroke: #3b82f6; /* Blue */
  }
  33% {
    stroke: #8b5cf6; /* Violet */
  }
  66% {
    stroke: #ec4899; /* Pink */
  }
  100% {
    stroke-dashoffset: 0;
    stroke: #3b82f6; /* Blue */
  }
}


/* ---------- Eyebrow / labels ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 22px;
}
.eyebrow.center { justify-content: center; text-align: center; }
.eyebrow.light { color: #9a9a9a; }
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  flex: 0 0 auto;
}
.eyebrow.center .dot { display: none; }

.section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem); /* Scaled down */
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 16px;
}
.section-title.center { text-align: center; }
.section-title.light { color: #FFFFFF; }
.section-sub {
  color: var(--ink-2);
  font-size: 15px;
  max-width: 640px;
}
.section-sub.center { margin: 0 auto 56px; text-align: center; }
.section-sub.light { color: #b5b5b5; }

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  transition: all 0.3s ease;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
  padding: 0 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.28em;
  font-size: 13px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  margin-left: 32px;
}
.nav-links {
  display: flex;
  gap: 4px;
  margin: 0 auto;
}
.nav-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  position: relative;
  padding: 8px 16px;
  border-radius: 100px;
  transition: all 0.25s ease;
}
.nav-links a:hover { 
  color: var(--ink); 
  background: rgba(0, 0, 0, 0.04);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth-login {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.2s ease;
}
.auth-login:hover {
  color: var(--ink);
}
.auth-register {
  padding: 8px 20px;
  font-size: 12px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 1.6px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 44% 56%;
  align-items: center;
  gap: 40px;
  min-height: 80vh;
  padding-top: 110px;
  padding-bottom: 40px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4.4vw, 3.6rem); /* Scaled down */
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin-bottom: 24px;
  position: relative;
}
.strike {
  position: relative;
  display: inline-block;
}
.strike-line {
  position: absolute;
  left: -4%;
  bottom: 6%;
  width: 108%;
  height: 0.5em;
  color: var(--ink);
  opacity: 0.85;
  pointer-events: none;
}
.hero-title-sub {
  font-size: 0.72em;
  color: var(--ink-2);
  font-weight: 400;
  letter-spacing: 0.06em;
}

.hero-text {
  color: var(--ink-2);
  font-size: 16px;
  max-width: 480px;
  margin-bottom: 34px;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 52px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 12px 24px; /* Smaller button */
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: #FFFFFF;
}
.btn-primary:hover { background: #2a2a2a; transform: translateY(-2px); }
.btn-ghost {
  border-color: var(--line-2);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-light {
  background: #FFFFFF;
  color: var(--ink);
}
.btn-light:hover { transform: translateY(-2px); }
.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.4);
  color: #FFFFFF;
  background: transparent;
}
.btn-outline-light:hover { border-color: #FFFFFF; }

/* Hero visual */
.hero-visual {
  position: relative;
}
.visual-stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.hero-img {
  position: relative;
  z-index: 1;
  width: min(300px, 92%);
  height: auto;
  max-height: 80vh;
  object-fit: cover;
  border-radius: 36px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.15), 0 0 0 8px #111;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ---------- Productos de la suite (NeuroChat / NeuroCRM / NeuroAPI) ---------- */
.productos {
  padding: 80px 0 90px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.productos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}
.producto-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.producto-card:hover {
  border-color: var(--line-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}
/* La tarjeta del producto nuevo se destaca con un borde de acento azul de marca. */
.producto-card-destacado {
  border-color: #BFD7F5;
  background: linear-gradient(180deg, #F7FAFF 0%, #FFFFFF 45%);
}
.producto-card-destacado:hover {
  border-color: #93B8EA;
}
.producto-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.producto-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--ink);
}
.producto-icon svg { width: 26px; height: 26px; }
.producto-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.producto-tag-nuevo { color: #2563eb; }
.producto-name {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.producto-name span { color: #2563eb; }
.producto-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
}
.producto-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 2px 0 0;
  padding: 0;
}
.producto-list li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.producto-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  opacity: 0.55;
}
.producto-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.producto-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.producto-link:hover { color: #2563eb; border-color: #2563eb; }

/* ---------- Selector (frictionless) ---------- */
.selector {
  padding: 80px 0 90px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.opt-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 30px 26px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  position: relative;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
  overflow: hidden;
}
.opt-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.opt-card:hover {
  border-color: var(--ink);
  transform: translateY(-4px);
  background: #FFFFFF;
}
.opt-card:hover::after { transform: scaleX(1); }
.opt-num {
  position: absolute;
  top: 18px;
  right: 20px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}
.opt-icon {
  width: 44px;
  height: 44px;
  color: var(--ink);
  margin-bottom: 4px;
}
.opt-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}
.opt-free {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 4px;
}
.opt-text {
  font-size: 13px;
  color: var(--ink-2);
  flex: 1;
}
.opt-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 6px;
  transition: gap 0.25s ease;
}
.opt-card:hover .opt-go { gap: 12px; }
.selector-more {
  margin-top: 34px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-2);
}
.selector-more a {
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.selector-more a:hover { color: var(--ink-3); border-color: var(--ink-3); }

/* ---------- Spotlight (personalización) ---------- */
.spotlight {
  padding: 0 0 80px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}
.spotlight-box {
  background: var(--ink);
  color: #FFFFFF;
  border-radius: 16px;
  padding: 72px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.spotlight-box::before {
  content: "";
  position: absolute;
  left: -120px;
  top: -120px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.spotlight-box::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.spotlight-copy { position: relative; z-index: 1; }
.spotlight-box .section-sub { max-width: 720px; }
.spotlight-box .section-sub.center { margin-bottom: 40px; }
.spotlight-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Features ---------- */
.features {
  padding: 80px 0;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 10px;
}
.feature {
  padding: 32px 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  transition: border-color 0.25s ease;
}
.feature:hover { border-color: var(--ink-2); }
.feature-num {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-3);
  display: block;
  margin-bottom: 16px;
}
.feature h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.feature p {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 16px;
}
.feature ul li {
  font-size: 12.5px;
  color: var(--ink-2);
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}
.feature ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-3);
}

/* ---------- How it works ---------- */
.how {
  padding: 80px 0;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 10px;
}
.how-step {
  padding: 40px 32px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  position: relative;
}
.step-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 2.6rem;
  color: var(--line-2);
  display: block;
  margin-bottom: 18px;
  line-height: 1;
}
.how-step h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.how-step p { font-size: 13.5px; color: var(--ink-2); }

/* ---------- Final CTA ---------- */
.cta-final {
  background: var(--ink);
  color: #FFFFFF;
  padding: 90px 0;
  position: relative;
  overflow: hidden;
}
.cta-final::before {
  content: "";
  position: absolute;
  right: -140px;
  top: -140px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.cta-final::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.cta-final .container { position: relative; z-index: 1; }
.cta-final-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 38px;
}

/* ---------- Footer ---------- */
.footer {
  background: #0c0c0c;
  color: #cfcfcf;
  padding: 80px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 60px;
}
.footer-brand .brand-name { color: #FFFFFF; }
.footer-brand p {
  font-size: 13px;
  color: #9a9a9a;
  margin-top: 16px;
  max-width: 300px;
}
.footer-dev {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #FFFFFF;
  margin-bottom: 18px;
}
.footer-col a {
  display: block;
  font-size: 13.5px;
  color: #9a9a9a;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: #FFFFFF; }
.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 22px 24px;
  font-size: 12px;
  color: #7a7a7a;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
}
.footer-legal a {
  color: #9a9a9a;
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-legal a:hover { color: #FFFFFF; text-decoration: underline; }
.footer-col a[href^="/legal/"] { color: #9a9a9a; }

/* ---------- Pie legal del Developer Hub (neuroapi.html) ---------- */
.nc-legal-footer {
  border-top: 1px solid var(--line, #E5E5E5);
  margin-top: 40px;
  padding: 22px 0;
  background: #FFFFFF;
}
.nc-legal-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  font-size: 12px;
  color: #7a7a7a;
}
.nc-legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.nc-legal-footer-links a {
  color: #666666;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nc-legal-footer-links a:hover { color: #2563eb; text-decoration: underline; }

/* ---------- WhatsApp float ---------- */
.wa-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #111111;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  transition: transform 0.25s ease;
}
.wa-float:hover { transform: translateY(-4px); }
.wa-float::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(17, 17, 17, 0.35);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- WhatsApp bottom bar (mobile) ---------- */
.wa-bar {
  display: none;
}

/* ---------- Responsive ---------- */
/* Tablet horizontal: las rejillas de 4 pasan a 2 columnas y la navegación se compacta. */
@media (max-width: 1024px) {
  .nav { gap: 18px; }
  .nav a { font-size: 12px; }
  .selector-grid { grid-template-columns: repeat(2, 1fr); }
  /* La rejilla de 3 productos pasa a 2 columnas en tablet: sus tarjetas llevan
     listas de 4 ítems y a 1 columna quedarían demasiado altas (pasa a 1 columna
     en el bloque de 768px). */
  .productos-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; padding-top: 110px; }
  .hero-copy { order: 1; }
  .hero-visual { order: 2; }
  .hero-title { font-size: clamp(2.2rem, 8vw, 3.4rem); }
  /* Área táctil suficiente para el disparador del menú y el pie legal. */
  .nav-toggle { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .nc-legal-footer-inner { gap: 12px; }
}

@media (max-width: 880px) {
  .header {
    top: 0;
    width: 100%;
    max-width: none;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
    z-index: 10000;
  }
  .header-inner { height: 64px; }
  .nav-toggle { display: flex; z-index: 10001; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-name { letter-spacing: 0.18em; font-size: 12px; }

  .nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 10000;
    transform: none;
    flex-direction: column;
    margin-left: 0;
    gap: 0;
    background: #ffffff;
    border-bottom: none;
    padding: 0 24px;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.32s ease, opacity 0.25s ease, padding 0.32s ease, visibility 0.32s ease;
  }
  .nav.open {
    max-height: calc(100vh - 64px);
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
    pointer-events: auto;
    background: #ffffff;
    padding: 12px 24px 28px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
  }
  
  .nav-links {
    display: flex;
    flex-direction: column;
    margin: 0;
    width: 100%;
  }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid #f1f1f1; border-radius: 0; }
  .nav-links a:last-child { border-bottom: none; }
  
  .header-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    padding-bottom: 24px;
  }

  .hero { padding-top: 92px; padding-bottom: 44px; gap: 34px; }
  .hero-title { font-size: clamp(2rem, 9.5vw, 3rem); }
  .hero-text { font-size: 15px; margin-bottom: 28px; }
  .hero-cta { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 36px; }
  .btn { width: 100%; min-height: 52px; }
  .hero-visual { text-align: center; }
  .hero-img { width: min(260px, 90%); }

  .selector, .features, .how { padding: 64px 0; }
  .spotlight { padding: 0 0 64px; }
  .spotlight-box { padding: 48px 22px; border-radius: 12px; }
  .spotlight-actions { flex-direction: column; align-items: stretch; }
  .selector-grid { grid-template-columns: 1fr; gap: 14px; }
  .opt-card { padding: 26px 22px; }
  /* Rejillas de 3 -> 2 columnas en tablet vertical (pasan a 1 columna en <=768px). */
  .features-grid, .how-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .section-sub.center { margin-bottom: 40px; }
  .selector-more { margin-top: 28px; }

  .cta-final { padding: 72px 0 96px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  /* Reserva el alto de la barra fija inferior `.wa-bar` para que el pie de
     página nunca quede tapado por ella. 64px cubre el alto real medido de la
     barra en una línea (~56px) más un margen de seguridad si el texto envuelve. */
  .footer { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  .wa-float { display: none; }

  .wa-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    background: #111111;
    color: #FFFFFF;
    padding: 13px 20px calc(13px + env(safe-area-inset-bottom));
    border-top: 1px solid #2a2a2a;
  }
  .wa-bar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
  }
  .wa-bar-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .wa-bar-note {
    font-size: 10.5px;
    letter-spacing: 0.08em;
    color: #a5a5a5;
  }
}

/* ---------------------------------------------------------------------------
   Móvil — 768px / 480px / 360px
   Se declaran al final del archivo (de mayor a menor) para que ganen por orden
   de cascada sobre los bloques 1024px y 880px anteriores.

   NOTA DE ESCALA GLOBAL: la escala del 80% se define junto a la regla `body`
   al principio de este archivo (`body { font-size: 12.8px }`, subiendo a 14px
   en <=768px y a 15px en <=480px). Por eso NINGÚN bloque de aquí abajo declara
   `font-size` sobre `body`: se regularía por cascada y pisaría esa escala.
   Los títulos grandes escalan con `clamp()` en su propio selector.
   --------------------------------------------------------------------------- */

/* Móvil grande: rejillas a una columna, cabecera colapsada con `.nav.open`,
   títulos fluidos y áreas táctiles de 44px. */
@media (max-width: 768px) {
  .container { padding: 0 20px; }

  .header-inner { height: 60px; padding: 0 16px; gap: 12px; }
  .brand { gap: 10px; }
  .brand-logo { width: 32px; height: 32px; }
  .brand-name { font-size: 11.5px; letter-spacing: 0.16em; }
  .nav-toggle { display: flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .nav { top: 60px; padding: 0 16px; }
  .nav.open { max-height: calc(100vh - 60px); padding: 10px 16px 24px; }
  .nav-links a { min-height: 44px; display: flex; align-items: center; }
  .header-actions a { min-height: 44px; display: flex; align-items: center; justify-content: center; }

  .hero { padding-top: 84px; padding-bottom: 40px; gap: 28px; }
  .hero-title { font-size: clamp(1.85rem, 9vw, 2.6rem); }
  .section-title { font-size: clamp(1.45rem, 6.2vw, 2rem); }
  .hero-text { font-size: 14.5px; max-width: 100%; }
  .section-sub { font-size: 14px; }
  .hero-cta { gap: 10px; }
  .hero-cta .btn { width: 100%; min-height: 52px; }

  /* Video del hero: conserva proporción real y no se deforma nunca. */
  .hero-img { width: min(260px, 88%); max-height: none; height: auto; object-fit: contain; }

  .selector, .features, .how { padding: 52px 0; }
  .spotlight { padding: 0 0 52px; }
  .spotlight-box { padding: 40px 20px; }
  .productos { padding: 52px 0 58px; }
  .productos-grid { grid-template-columns: 1fr; gap: 16px; }
  .producto-card { padding: 24px 20px; gap: 14px; }
  .selector-grid, .features-grid, .how-grid { grid-template-columns: 1fr; gap: 14px; }
  .feature, .how-step { padding: 28px 22px; }
  .section-sub.center { margin-bottom: 32px; }

  .cta-final { padding: 60px 0 92px; }
  .cta-final-actions .btn { min-height: 48px; }
  /* padding-top en longhand para conservar el padding-bottom calculado que
     reserva el alto de la `.wa-bar` fija (declarado en el bloque de 880px). */
  .footer { padding-top: 56px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding-bottom: 44px; }

  /* Barra inferior: el contenido necesita reservar su alto para no quedar tapado. */
  .wa-bar { flex-direction: column; gap: 6px; text-align: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .wa-bar-label { font-size: 13px; }
  .wa-bar-note { font-size: 10px; }

  .nc-legal-footer { padding: 18px 0; margin-top: 32px; }
  .nc-legal-footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .nc-legal-footer-links { gap: 8px 14px; }
  .nc-legal-footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* Móvil: tipografía reducida, padding lateral mínimo, botones a ancho completo
   y tablas/bloques de código con scroll horizontal contenido. */
@media (max-width: 480px) {
  .container { padding: 0 14px; }

  .header-inner { height: 56px; padding: 0 12px; }
  .brand-logo { width: 30px; height: 30px; }
  .brand-name { font-size: 10.5px; letter-spacing: 0.12em; }
  .nav { top: 56px; padding: 0 12px; }
  .nav.open { max-height: calc(100vh - 56px); padding: 8px 12px 22px; }
  .auth-register { padding: 10px 16px; }

  .hero { padding-top: 78px; padding-bottom: 34px; gap: 24px; }
  .hero-title { font-size: clamp(1.6rem, 9.4vw, 2.15rem); margin-bottom: 18px; }
  .section-title { font-size: clamp(1.28rem, 6.6vw, 1.7rem); }
  .hero-text, .section-sub, .opt-text { font-size: 13.5px; }
  .eyebrow { font-size: 10px; letter-spacing: 0.26em; margin-bottom: 16px; }

  /* Botones a ancho completo en los bloques de llamada a la acción. */
  .hero-cta, .spotlight-actions, .cta-final-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .btn { width: 100%; min-height: 48px; padding: 12px 18px; white-space: normal; }
  .cta-final-actions { margin-top: 28px; }

  .selector, .features, .how { padding: 44px 0; }
  .spotlight { padding: 0 0 44px; }
  .spotlight-box { padding: 32px 16px; }
  .opt-card { padding: 22px 18px; }
  .productos { padding: 44px 0 50px; }
  .producto-card { padding: 20px 16px; }
  .producto-head { gap: 12px; align-items: flex-start; }
  .producto-icon { width: 40px; height: 40px; }
  .producto-icon svg { width: 22px; height: 22px; }
  .producto-name { font-size: 18px; }
  .producto-list li { font-size: 13px; }
  .producto-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .feature, .how-step { padding: 24px 18px; }
  .step-num { font-size: 2.2rem; margin-bottom: 14px; }

  .cta-final { padding: 52px 0 88px; }
  /* Ojo: se usa padding-top (no el atajo `padding`) para NO pisar el
     padding-bottom calculado que reserva el alto de la `.wa-bar` fija. */
  .footer { padding-top: 48px; }
  .footer-grid { gap: 24px; padding-bottom: 38px; }
  .footer-legal { padding: 18px 14px; font-size: 11.5px; }
  .footer-col a { font-size: 13px; }

  /* Tablas y bloques de código: scroll horizontal contenido, nunca desbordan
     la página. Se excluye a propósito `.doc-section` (contenedor de la
     documentación) porque `overflow` distinto de `visible` rompería el
     posicionamiento sticky de la barra de pestañas. */
  table, .param-table, pre, .code-content {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table, .param-table { display: block; width: 100%; }
  pre, .code-content { white-space: pre; }

  .wa-bar-label { font-size: 12px; }
  .wa-bar-note { font-size: 9.5px; }
  .nc-legal-footer-links a { min-height: 44px; }
}

/* Móvil muy pequeño: ajustes finales para que nada se desborde ni se corte. */
@media (max-width: 360px) {
  .container { padding: 0 12px; }

  .header-inner { height: 54px; padding: 0 10px; gap: 8px; }
  .brand-logo { width: 28px; height: 28px; }
  .brand-name { font-size: 9.5px; letter-spacing: 0.08em; }
  .nav { top: 54px; padding: 0 10px; }
  .nav.open { max-height: calc(100vh - 54px); padding: 8px 10px 20px; }
  .nav-links a { font-size: 13px; }
  .auth-register { font-size: 11px; padding: 9px 12px; }

  .hero { padding-top: 74px; gap: 20px; }
  .hero-title { font-size: clamp(1.42rem, 9.6vw, 1.85rem); }
  .section-title { font-size: clamp(1.15rem, 7vw, 1.5rem); }
  .eyebrow { font-size: 9.5px; letter-spacing: 0.2em; }

  .btn { min-height: 44px; font-size: 11px; letter-spacing: 0.1em; padding: 11px 14px; }
  .hero-img { width: min(230px, 92%); }

  .opt-card, .feature, .how-step { padding: 20px 15px; }
  .producto-card { padding: 18px 14px; }
  .spotlight-box { padding: 28px 13px; }
  .footer-legal { padding: 16px 10px; font-size: 11px; }
  .nc-legal-footer-links { gap: 6px 10px; font-size: 11.5px; }
}
