/* Presupi, página pública. escrita desde cero.
   clara (sin modo oscuro: es una decisión, no un olvido), Archivo en todo, azul como acento y el verde de
   WhatsApp solo en su ícono y en las burbujas del chat. mucho aire, sombras neutras, radios de 8 a 12 px.
   se diseña primero a 375 px y se escala */

@font-face {
  font-family: "Archivo";
  src: url("fuentes/archivo.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --bg: #FFFFFF;
  --bg-soft: #F6F7F9;
  --text: #0F172A;
  --text-muted: #556070;
  --border: #E3E7ED;
  --accent: #1F4FD1;
  --accent-soft: #EAF0FD;
  --wa: #25D366;
  --ok: #157F4A;
  --warn: #B45309;
  --accent-hover: #1A43B3;
  --sombra: 0 1px 2px rgb(15 23 42 / 0.06), 0 12px 32px rgb(15 23 42 / 0.08);
  --letra: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
/* la barra fija mide 64 px: el scroll (links y enganche) la descuenta, y cada sección con id frena 24 px más abajo */
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
[id] { scroll-margin-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--letra); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.seccion-interior, .nav-interior, .hero, .demo-zona > .ventana {
  max-width: 1160px; margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- botones (como mucho 2 a la vista) ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 10px; text-decoration: none;
  font: 700 17px var(--letra); touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background-color 150ms ease, transform 120ms ease-out, box-shadow 150ms ease;
}
.btn:active { transform: scale(0.98); }
.btn-azul { background: var(--accent); color: #FFFFFF; }
.btn-borde { background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--border); }
.btn-blanco { background: #FFFFFF; color: var(--text); }
.btn-chico { min-height: 40px; padding: 0 16px; font-size: 15px; white-space: nowrap; }
.ico-wa { width: 20px; height: 20px; fill: var(--wa); flex: none; }
.btn-blanco .ico-wa { fill: var(--wa); }
.btn-azul .ico-wa { fill: #FFFFFF; }
@media (hover: hover) and (pointer: fine) {
  .btn-azul:hover { background: var(--accent-hover); }
  .btn-borde:hover { box-shadow: inset 0 0 0 1.5px var(--text-muted); }
  .btn-blanco:hover { background: var(--accent-soft); }
  .nav-links a:hover, .nav-entrar:hover { color: var(--text); }
}

/* ---------- 1. barra fija ---------- */

.nav { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top, 0px); }
.nav-interior { display: flex; align-items: center; gap: 24px; height: 64px; }
/* la marca: el isotipo y "Presupi" en Archivo 800, color tinta */
.logo { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-weight: 800; font-size: 21px; color: #0F172A; text-decoration: none; letter-spacing: -0.015em; }
.logo img { width: 32px; height: 32px; flex: none; }
.nav-links { display: none; gap: 28px; margin-left: 12px; }
.nav-links a, .nav-entrar { color: var(--text-muted); text-decoration: none; font-size: 15.5px; font-weight: 500; }
.nav-acciones { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.nav-links a[aria-current="true"] { color: var(--accent); }

/* ---------- 2. hero ---------- */

.hero { text-align: center; padding-top: 36px; padding-bottom: 28px; }
.hero h1 { font-size: clamp(36px, 9.6vw, 64px); line-height: 1.04; font-weight: 800; letter-spacing: -0.025em; max-width: 15ch; margin-inline: auto; }
.hero-bajada { margin: 20px auto 0; max-width: 40ch; font-size: 18px; color: var(--text-muted); }
.hero-botones { margin-top: 28px; display: grid; gap: 12px; }
.hero-linea { margin-top: 20px; font-size: 14.5px; color: var(--text-muted); }

/* ---------- 3. la demo ---------- */

/* el único degradé permitido: de blanco a azul muy suave, de borde a borde, detrás de la demo */
.demo-zona { padding-bottom: 72px; background: linear-gradient(var(--bg), var(--accent-soft)); }
.demo-zona > .ventana { padding: 0; margin-inline: max(20px, env(safe-area-inset-left, 0px)); }
.ventana { border: 1px solid var(--border); border-radius: 12px; background: var(--bg); box-shadow: var(--sombra); overflow: hidden; }
.ventana-barra { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.puntos { display: flex; gap: 8px; }
.puntos i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.12); }
.puntos .rojo { background: #FF5F57; }
.puntos .amarillo { background: #FEBC2E; }
.puntos .verde { background: #28C840; }
.direccion { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 7px; background: #ECEEF2; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.direccion svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.ficticio { justify-self: end; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
@media (max-width: 599px) { .direccion { display: none; } .ventana-barra { grid-template-columns: auto 1fr; } }

.pestanas { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
.pestanas::-webkit-scrollbar { display: none; }
.pestanas button {
  flex: none; scroll-snap-align: start; border: 0; background: none; border-radius: 8px; padding: 8px 14px; cursor: pointer;
  font: 600 15px var(--letra); color: var(--text-muted); touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background-color 150ms ease, color 150ms ease;
}
.pestanas button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }

.demo { position: relative; display: grid; gap: 16px; padding: 16px 12px 18px; background: var(--bg-soft); transition: opacity 180ms ease, transform 220ms ease-out; }
.demo[data-cambiando] { opacity: 0; transform: translateY(6px); }
.respondido { justify-self: start; padding: 4px 10px; border-radius: 6px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); font-size: 13.5px; font-weight: 600; color: var(--ok); }

.demo-chat { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #EFEAE2; }
.chat-cab { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--border); }
.chat-cab strong { font-size: 15.5px; }
.chat-cab span { font-size: 13px; color: var(--text-muted); }
.chat-cab span[data-escribiendo] { color: var(--ok); }
.chat { list-style: none; margin: 0; padding: 12px 12px 14px; display: grid; gap: 8px; align-content: start; }
/* los mensajes que todavía no salieron ocupan su lugar (no hay saltos) pero no se ven */
.msj[data-pendiente] { visibility: hidden; opacity: 0; }
.msj { transition: opacity 260ms ease-out, transform 260ms ease-out; }
.msj[data-pendiente] { transform: translateY(6px); }
.respondido[data-pendiente] { visibility: hidden; opacity: 0; }
.respondido { transition: opacity 260ms ease-out; }
.msj { max-width: 90%; padding: 8px 11px 5px; border-radius: 10px; font-size: 15.5px; line-height: 1.42; background: var(--bg); box-shadow: 0 1px 1px rgb(15 23 42 / 0.08); }
.msj.cliente { justify-self: end; background: color-mix(in srgb, var(--wa) 22%, #FFFFFF); }
.msj.comercio { justify-self: start; }
.msj .hora { display: block; text-align: right; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.audio { display: flex; align-items: center; gap: 9px; }
.audio .play { width: 0; height: 0; border-left: 10px solid var(--text); border-block: 7px solid transparent; flex: none; }
.audio .onda { flex: 1; min-width: 110px; height: 16px; background: repeating-linear-gradient(90deg, var(--text-muted) 0 3px, transparent 3px 6px); opacity: 0.55; border-radius: 2px; }
.audio .dur { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.transcripcion { display: block; margin-top: 6px; font-size: 14px; color: var(--text-muted); font-style: italic; }
.presu strong { display: block; margin-bottom: 4px; }
.presu .fila { display: flex; justify-content: space-between; gap: 14px; font-size: 14.5px; }
.presu .fila span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.presu .falta { color: var(--warn); font-size: 13px; }
.presu .total { margin-top: 4px; padding-top: 5px; border-top: 1px dashed var(--border); font-weight: 700; }
.presu .acepta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.presu .acepta span { text-align: center; padding: 7px; border-radius: 8px; border: 1px solid var(--border); font-weight: 700; font-size: 14.5px; color: var(--accent); }
.presu .acepta span:first-child { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }

.demo-panel { border: 1px solid var(--border); border-radius: 10px; background: var(--bg); overflow: hidden; }
.panel-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.panel-cab strong { display: block; font-size: 16px; }
.panel-cab span { display: block; font-size: 13px; color: var(--text-muted); }
.panel-cab .estado { flex: none; padding: 4px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.panel-tabla { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.panel-tabla th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--text-muted); padding: 10px 14px 6px; }
.panel-tabla td { padding: 10px 14px; border-top: 1px solid var(--border); vertical-align: top; }
.panel-tabla td:first-child { color: var(--text-muted); width: 32%; }
.panel-tabla .ok { color: var(--ok); font-weight: 600; white-space: nowrap; }
.panel-tabla .warn { color: var(--warn); font-weight: 600; white-space: nowrap; }
/* en el celu: "Entrar" pasa al pie (la barra no da para tres cosas) y el encabezado del panel se apila */
@media (max-width: 419px) { .nav-entrar { display: none; } .logo { font-size: 17px; } }
@media (max-width: 599px) { .panel-cab { flex-direction: column; align-items: flex-start; } }
/* en el celu la tabla queda con lo que importa: el producto y el stock */
@media (max-width: 599px) { .panel-tabla th:first-child, .panel-tabla td:first-child { display: none; } }
.panel-pie { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }

/* ---------- secciones ---------- */

.seccion { padding-block: 56px; }
.fondo-suave { background: var(--bg-soft); }
.seccion h2, .cierre h2 { font-size: clamp(30px, 7vw, 44px); line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 32px; }
.seccion h3 { font-size: 19px; line-height: 1.3; font-weight: 700; }

.antes-con { display: grid; gap: 16px; }
.antes-con > div { border-radius: 12px; padding: 22px; background: var(--bg); border: 1px solid var(--border); }
.antes-con h3 { margin-bottom: 12px; }
.antes h3 { color: var(--text-muted); }
.con { box-shadow: var(--sombra); border-left: 3px solid var(--accent) !important; }
.antes-con ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.antes-con li { display: grid; grid-template-columns: 22px minmax(0, 1fr); }
.antes li { color: var(--text-muted); }
.antes li::before { content: "✕"; color: var(--text-muted); font-weight: 700; }
.con li::before { content: "✓"; color: var(--ok); font-weight: 800; }

.pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; }
.paso-n { display: block; font-size: 52px; line-height: 1; font-weight: 800; color: var(--accent); margin-bottom: 10px; }
.pasos p { margin-top: 6px; color: var(--text-muted); }

.rubros { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
/* cada tarjeta usa las filas de la grilla (subgrid): título, cita y descripción quedan a la misma altura */
.rubros li { display: grid; grid-row: span 4; grid-template-rows: subgrid; }
.rubro {
  display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 8px; padding: 20px 18px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 120ms ease-out;
  touch-action: manipulation;
}
.rubro:active { transform: scale(0.99); }
.rubros h3 { font-size: 18px; }
.rubros q { font-size: 15.5px; color: var(--text); quotes: "«" "»"; }
.rubros p { font-size: 15px; color: var(--text-muted); line-height: 1.5; }
.rubro .ver { align-self: end; color: var(--accent); font-weight: 700; font-size: 15px; padding-top: 4px; }
@media (hover: hover) and (pointer: fine) { .rubro:hover { border-color: var(--accent); box-shadow: var(--sombra); } }

.testimonios { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.testimonios blockquote { margin: 0; font-size: 19px; }
.testimonio-autor { margin-top: 10px; color: var(--text-muted); font-size: 15px; }

.no-hace { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.no-hace p { margin-top: 4px; color: var(--text-muted); }

.faq { border-top: 1px solid var(--border); max-width: 760px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; position: relative; padding: 18px 40px 18px 0; font-size: 18px; font-weight: 700; line-height: 1.35; touch-action: manipulation; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 8px; top: 24px; width: 10px; height: 10px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: transform 200ms ease-out; }
.faq details[open] summary::after { transform: rotate(-135deg); top: 29px; }
.faq details p { padding-bottom: 20px; color: var(--text-muted); }

/* ---------- 9. cierre: la única franja oscura ---------- */

.cierre { background: #0F172A; color: #FFFFFF; text-align: center; padding-block: 80px; }
.cierre h2 { margin-bottom: 12px; }
.cierre p { color: #C8D0DC; font-size: 18px; margin-bottom: 28px; }
.cierre .cierre-numero { margin: 16px 0 0; color: #FFFFFF; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }

.pie { border-top: 1px solid var(--border); padding-block: 24px max(28px, env(safe-area-inset-bottom, 0px)); font-size: 14px; color: var(--text-muted); }
.pie-interior { display: grid; gap: 6px; }

/* ---------- aparecer al entrar en pantalla, una sola vez ---------- */

.js [data-aparece] { transition: opacity 400ms ease-out, transform 400ms ease-out; }
.js [data-aparece]:not([data-visible]) { opacity: 0; transform: translateY(16px); }

/* ---------- tablet y compu ---------- */

@media (min-width: 720px) {
  .hero-botones { display: flex; justify-content: center; }
  .antes-con { grid-template-columns: 1fr 1fr; gap: 20px; }
  .pasos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
  .rubros { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .no-hace { grid-template-columns: 1fr 1fr; gap: 32px 48px; }
  .pie-interior { display: flex; justify-content: space-between; }
}
@media (min-width: 1200px) {
  .demo-zona > .ventana { max-width: 1120px; margin-inline: auto; }
}
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .hero { padding-top: 44px; padding-bottom: 32px; }
  .hero h1 { font-size: clamp(44px, 4.1vw, 58px); max-width: 18ch; }
  .hero-bajada { max-width: 52ch; }
  .hero-bajada { font-size: 18.5px; }
  .demo-zona { padding-bottom: 80px; }
  .demo { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; padding: 24px; align-items: start; }
  .respondido { position: absolute; top: 24px; right: 24px; z-index: 1; }
  .demo-panel { margin-top: 44px; }
  .seccion { padding-block: 80px; }
  /* 3 arriba y 2 abajo centradas: 6 columnas, cada tarjeta ocupa 2 */
  .rubros { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .rubros li { grid-column: span 2; }
  .rubros li:nth-child(4) { grid-column: 2 / span 2; }
  .cierre { padding-block: 88px; }
}

/* sin enganche entre secciones (scroll-snap): con secciones de distinto alto devolvía la página al
   punto de enganche y al subir parecía que no se movía. el scroll es el normal del navegador */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-aparece], .js [data-aparece]:not([data-visible]) { opacity: 1; transform: none; transition: none; }
  .msj, .respondido, .rubro { transition: none; }
  .btn, .demo, .pestanas button, .faq summary::after { transition: none; }
  .btn:active { transform: none; }
}
