/* AXKAN /pedidos — kit móvil (Fase 1, maqueta). 2026-09-18
   Reglas que encarna (../kit.md):
   · Una sola tipografía: Objektiv VF (400 / 600 / 700). Nada de RL Aqva.
   · Fondo blanco. Contenedores (.box) bien delimitados: borde 1 px #d8d2c9, radio 16, sombra suave.
   · Verde selva = acción y progreso (botón primario, stepper, foco, chip activo).
   · Rosa = MÁXIMO un elemento por pantalla (utilidad .pink). Naranja/rojo solo para avisos y errores.
   · Móvil primero: columna única ≤ 480 px, controles de 48 px, texto de inputs 16 px, CTA fija abajo. */

@font-face {
  font-family: "Objektiv";
  src: url("fonts/Objektiv-VF.woff2") format("woff2"), url("fonts/Objektiv-VF.otf") format("opentype");   /* woff2: 88 KB en vez de 292 */
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --font: "Objektiv", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* lienzo y contenedores */
  --canvas: #ffffff;
  --box: #ffffff;
  --box-border: #d8d2c9;
  --box-shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 6px 18px rgba(20, 20, 20, .05);
  --box-shadow-lift: 0 2px 4px rgba(20, 20, 20, .05), 0 14px 32px rgba(20, 20, 20, .09);
  --soft: #fbfaf7;

  /* texto */
  --ink: #1c1a17;
  --ink-2: #6b655d;
  --ink-3: #9a938a;
  --line: rgba(28, 26, 23, .10);

  /* acción y progreso (verde del logo) */
  --acc: #8ab73b;
  --acc-deep: #76a12f;
  --acc-ink: #4f7a17;
  --acc-tint: rgba(138, 183, 59, .10);
  --acc-ring: rgba(138, 183, 59, .28);

  /* rosa: un elemento por pantalla, máximo */
  --pink: #e72a88;

  /* avisos y estados */
  --warn: #f39223;
  --danger: #e52421;
  --ok: #6f9a2e;    --ok-bg: rgba(138, 183, 59, .16);
  --pend: #d17f1a;  --pend-bg: rgba(243, 146, 35, .16);
  --bad: #c92f2a;   --bad-bg: rgba(229, 36, 33, .12);

  /* forma y espacio (8 · 12 · 16 · 24 · 32) */
  --r-box: 16px;
  --r-ctl: 12px;
  --r-pill: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --gutter: 16px;
  --ctl-h: 48px;
  --page-w: 480px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--acc-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; }
.pink { color: var(--pink); }

/* ---------- tipografía (máx. 3 tamaños visibles a la vez) ---------- */
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
.t-screen { font-size: 22px; }                                    /* título de pantalla */
.t-box    { font-size: 16px; }                                    /* título de contenedor */
.t-label  { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.t-muted  { color: var(--ink-2); }
.t-faint  { color: var(--ink-3); }
.t-small  { font-size: 13px; }
.t-big    { font-size: 26px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* ---------- página ---------- */
.page {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 var(--gutter) calc(112px + var(--safe-b));
}
.page.no-bar { padding-bottom: var(--s-6); }

.top {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.top .logo { height: 16px; width: auto; }
.top .step-txt { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.top.nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; justify-items: center; }
.top.nav .step-txt { justify-self: end; white-space: nowrap; }
.top .back {
  width: 44px; height: 44px; margin-left: -12px; border: 0; background: none;
  display: grid; place-items: center; color: var(--ink-2); cursor: pointer; border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.top .back:active { background: var(--soft); }

/* progreso real: 4 segmentos */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 var(--s-4); }
.stepper i { display: block; height: 4px; border-radius: 2px; background: var(--line); }
.stepper i.done, .stepper i.now { background: var(--acc); }

/* ---------- contenedor ---------- */
.box {
  background: var(--box);
  border: 1px solid var(--box-border);
  border-radius: var(--r-box);
  box-shadow: var(--box-shadow);
  padding: var(--s-4);
  margin: 0 0 var(--s-3);
}
.box.flat { box-shadow: none; }
.box.tight { padding: var(--s-3); }
.box > .head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: 0 0 var(--s-3); }
.box > .head h2 { font-size: 16px; }

/* ---------- tabla de 3 columnas: cantidad | producto | precio ---------- */
.lines { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lines th {
  font-size: 12px; font-weight: 500; color: var(--ink-2); text-align: left;
  padding: 0 0 var(--s-2); border-bottom: 1px solid var(--line);
}
.lines td { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines .qty { width: 60px; font-weight: 600; white-space: nowrap; }
.lines .price, .lines th.price { text-align: right; white-space: nowrap; }
.lines td.price { font-weight: 600; }
.lines .sub { display: block; font-size: 12px; color: var(--ink-2); font-weight: 400; margin-top: 2px; }
.lines tfoot td { border-bottom: 0; padding: var(--s-2) 0 0; }
.lines tfoot .muted td { color: var(--ink-2); font-weight: 400; }
.lines tfoot .total td { font-weight: 700; font-size: 18px; padding-top: var(--s-3); }

/* ---------- filas clave: valor ---------- */
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding: var(--s-2) 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink-2); }
.kv b { font-weight: 600; }
.kv.total span { color: var(--ink); font-weight: 600; }
.kv.total b { font-size: 20px; font-weight: 700; }

/* ---------- botones (48 px, verde = acción) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--ctl-h); padding: 0 20px;
  border-radius: var(--r-pill); border: 1.5px solid transparent;   /* Ivan, ronda 1: TODOS los botones son pills */
  font-size: 16px; font-weight: 600; color: var(--ink);
  background: transparent; cursor: pointer; text-decoration: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease), background .15s, border-color .15s;
}
/* `hidden` lo pisaba el display del botón: dos botones a la vez en la barra. */
.btn[hidden] { display: none; }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.primary:hover { background: var(--acc-deep); border-color: var(--acc-deep); }
.btn.outline { background: rgba(138, 183, 59, .06); border-color: var(--acc); color: var(--acc-ink); }
.btn.outline:hover { background: var(--acc-tint); }
.btn.quiet { border-color: var(--box-border); color: var(--ink-2); }
.btn.block { width: 100%; }
.btn.sm { height: 44px; padding: 0 14px; font-size: 14px; font-weight: 500; }   /* chico de ancho, nunca de alto */
.btn.link { border: 0; height: 44px; margin: -12px 0; padding: 0; font-size: 14px; font-weight: 500; color: var(--acc-ink); background: none; } /* 44 px tocables sin mover el layout */
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--acc-ring); }

/* ---------- campos (16 px para que iOS no haga zoom) ---------- */
.field { display: block; margin: 0 0 var(--s-3); }
.field > span { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin: 0 0 6px; }
.input, textarea.input {
  width: 100%; height: var(--ctl-h); padding: 0 14px;
  border: 1.5px solid var(--box-border); border-radius: var(--r-ctl);
  font: inherit; font-size: 16px; color: var(--ink); background: #fff; outline: none;
}
textarea.input { height: auto; min-height: 92px; padding: 12px 14px; line-height: 1.4; resize: vertical; }
.input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-tint); }
.input::placeholder { color: var(--ink-3); }

/* ---------- chips (selección) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  border-radius: var(--r-pill); border: 1.5px solid var(--box-border); background: #fff;
  font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chip.on { border-color: var(--acc); background: var(--acc-tint); color: var(--acc-ink); }

/* ---------- estados ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok   { color: var(--ok);   background: var(--ok-bg); }
.pill.pend { color: var(--pend); background: var(--pend-bg); }
.pill.bad  { color: var(--bad);  background: var(--bad-bg); }

/* ---------- aviso (lo primero que se ve; se puede cerrar) ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-ctl);
  border: 1px solid var(--box-border); background: var(--soft);
  font-size: 14px; line-height: 1.4; margin: 0 0 var(--s-3);
}
.notice b { font-weight: 600; }
.notice .x { margin: -12px -12px -12px auto; width: 44px; height: 44px; flex: none; background: none; border: 0; color: var(--ink-3); font-size: 22px; line-height: 1; cursor: pointer; align-self: center; }   /* 44 px tocables */
.notice.warn { border-color: rgba(243, 146, 35, .5); background: rgba(243, 146, 35, .08); }

/* ---------- barra fija inferior (al alcance del pulgar) ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--box-border);
  padding: var(--s-3) var(--gutter) calc(var(--s-3) + var(--safe-b));
}
.bar .in { max-width: var(--page-w); margin: 0 auto; display: grid; gap: 10px; }
.bar .in.two { grid-template-columns: 1fr 1fr; }
.bar .in.two .btn { padding: 0 8px; font-size: 15px; }   /* dos acciones en 390 px sin partir el texto */
.bar .sum { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 2px; font-variant-numeric: tabular-nums; }
.bar .sum span { color: var(--ink-2); font-size: 13px; }
.bar .sum b { font-size: 18px; font-weight: 700; }

/* ---------- secciones plegables ---------- */
details.sec { border: 1px solid var(--box-border); border-radius: var(--r-box); background: #fff; box-shadow: var(--box-shadow); margin: 0 0 var(--s-3); }
details.sec > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 14px var(--s-4); cursor: pointer; font-weight: 600; font-size: 16px; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary .r { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }
details.sec > summary .chev { width: 18px; height: 18px; transition: transform .18s var(--ease); }
details.sec[open] > summary .chev { transform: rotate(180deg); }
details.sec > .body { padding: 0 var(--s-4) var(--s-4); }

/* ---------- iconos (Lucide, 18 px, inline) ---------- */
.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- progreso: UNA barra con agua verde que fluye (Ivan, ronda 1) ----------
   width = fracción de pasos (--p). Avanza o retrocede con transición; .done la detiene. */
.flow { height: 6px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; margin: 0 0 var(--s-4); }
.flow > i {
  display: block; height: 100%; width: var(--p, 25%); border-radius: inherit;
  background: linear-gradient(90deg, #6f9a2e 0%, #8ab73b 30%, #b9d67f 50%, #8ab73b 70%, #6f9a2e 100%);
  background-size: 200% 100%;
  animation: flow 2.2s linear infinite;
  transition: width .6s var(--ease);
}
.flow.done > i { animation: none; background: var(--acc); }
@keyframes flow { from { background-position: 0% 0; } to { background-position: -200% 0; } }

/* ---------- "agregar": atractivo sin competir con el primario (Ivan, ronda 1) ---------- */
.btn.add { background: rgba(138, 183, 59, .08); border: 1.5px dashed var(--acc); color: var(--acc-ink); }
.btn.add:hover { background: var(--acc-tint); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- tarjeta de línea: cantidad | producto | precio (de la v2) ---------- */
.line-card {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
  padding: var(--s-3); border: 1px solid var(--box-border); border-radius: var(--r-box); background: #fff;
  margin: 0 0 var(--s-2);
}
.line-card .q { height: 44px; border-radius: var(--r-ctl); border: 1px solid var(--box-border); background: var(--soft); display: grid; place-items: center; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.line-card .n { display: grid; gap: 2px; min-width: 0; }
.line-card .n b { font-weight: 600; }
.line-card .n span { font-size: 13px; color: var(--ink-2); }
.line-card .p { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- cifra pegada arriba (total, o lo que hoy se paga) ---------- */
.total-top {
  position: sticky; top: 0; z-index: 5; background: #fff;
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 0 10px; margin: 0 0 var(--s-3); border-bottom: 1px solid var(--line);
}
.total-top .t-label { margin-right: auto; }
.total-top .pill { align-self: center; }

/* ---------- sugerencias (autocompletar de dirección) ---------- */
.sugs { border: 1px solid var(--box-border); border-radius: var(--r-box); background: #fff; box-shadow: var(--box-shadow-lift); overflow: hidden; margin: 8px 0 0; }
.sugs button { display: block; width: 100%; min-height: 48px; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; font-size: 15px; color: var(--ink); cursor: pointer; }
.sugs button:last-child { border-bottom: 0; }
.sugs button:hover, .sugs button:focus { background: var(--soft); outline: none; }
.sugs button small { display: block; color: var(--ink-2); font-size: 13px; }

/* ---------- cantidad ---------- */
.qty { display: inline-grid; grid-template-columns: 44px 64px 44px; align-items: center; height: 44px; border: 1.5px solid var(--box-border); border-radius: var(--r-pill); overflow: hidden; background: #fff; }
.qty button { border: 0; background: none; height: 100%; font-size: 22px; line-height: 1; color: var(--acc-ink); cursor: pointer; }
.qty input { border: 0; width: 100%; height: 100%; text-align: center; font: inherit; font-size: 16px; font-weight: 600; outline: none; font-variant-numeric: tabular-nums; }

/* ---------- subir comprobante ---------- */
.upload { display: grid; place-items: center; gap: 4px; padding: 22px 16px; border: 1.5px dashed var(--acc); border-radius: var(--r-box); background: rgba(138, 183, 59, .05); color: var(--acc-ink); text-align: center; cursor: pointer; margin: 0 0 var(--s-3); }
.upload input { display: none; }
.upload b { font-weight: 600; font-size: 16px; }
.upload.ok { border-style: solid; background: var(--ok-bg); color: var(--ok); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); z-index: 20; transform: translateX(-50%) translateY(8px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-pill); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.toast.in { opacity: 1; transform: translateX(-50%); }

/* ---------- barra universal con contorno verde que brilla (Ivan, ronda 2) ---------- */
.glow { position: relative; border-radius: var(--r-pill); padding: 2px;
  background: linear-gradient(90deg, #4f7a17, #8ab73b, #c8e296, #8ab73b, #4f7a17);
  background-size: 300% 100%;
  animation: glowmove 3s linear infinite, glowpulse 2.4s ease-in-out infinite; }
.glow .input { border: 0; border-radius: var(--r-pill); height: 52px; padding: 0 18px 0 46px; }
.glow .input:focus { box-shadow: none; }
.glow > .ic { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--acc-ink); z-index: 1; }
@keyframes glowmove { to { background-position: 300% 0; } }
@keyframes glowpulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(138, 183, 59, .12), 0 0 14px rgba(138, 183, 59, .28); }
  50%      { box-shadow: 0 0 0 5px rgba(138, 183, 59, .18), 0 0 28px rgba(138, 183, 59, .48); }
}

/* ---------- escenario centrado: pregunta + barra al centro; al escribir, la barra sube y la
   pregunta se desvanece (Ivan, ronda 7; aplica a ② Dirección y ③ Productos) ---------- */
/* Ivan, ronda 8: el doble de largo (1.1 s la subida, 0.6 s el desvanecido) */
.stage { display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - 56px - 22px - 112px - var(--safe-b)); transition: min-height 1.1s var(--ease); }
.stage.up { min-height: 0; justify-content: flex-start; }
.stage .ask { text-align: center; margin: 0 0 var(--s-4); max-height: 96px; overflow: hidden; transition: opacity .6s var(--ease), max-height 1s var(--ease), margin 1s var(--ease); }
.stage.up .ask { opacity: 0; max-height: 0; margin: 0; pointer-events: none; }
.stage .after { margin-top: var(--s-3); }

/* ---------- línea especial: envío como producto (no se puede quitar) ---------- */
.line-card .q.ico { color: var(--ink-2); }
.line-card .q.ico .ic { width: 22px; height: 22px; }

/* ---------- marca (solo en Listo): banda arcoíris y blobs suaves ---------- */
.band { height: 3px; border-radius: 2px; background: linear-gradient(90deg, #e72a88 0 20%, #8ab73b 20% 40%, #f39223 40% 60%, #09adc2 60% 80%, #e52421 80% 100%); }
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blobs i { position: absolute; width: 280px; height: 280px; border-radius: 50%; filter: blur(64px); opacity: .20; animation: drift 6s ease-in-out infinite alternate; }
.blobs .r { background: #e72a88; top: -80px; right: -90px; }
.blobs .t { background: #09adc2; bottom: 160px; left: -120px; animation-delay: -2s; }
.blobs .g { background: #8ab73b; bottom: -100px; right: -60px; animation-delay: -4s; }
@keyframes drift { to { transform: translate(12px, -10px); } }

/* ---------- movimiento (nada rebota, nada gira, nada parpadea) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .18s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.reveal { opacity: 0; transform: translateY(8px); transition: opacity .22s var(--ease), transform .22s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rise, .reveal { animation: none; transition: none; opacity: 1; transform: none; }
}
