/* Estética tomada de bezza.com.ar (2026-09-30): fondo lavanda claro, cards blancas, degradé
   magenta→rojo como marca, botones negros, Mona Sans (títulos) + Public Sans (texto).
   Tema claro únicamente (decisión de JG). Pares texto/fondo medidos ≥4.5:1. */
@font-face {
  font-family: "Public Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/public-sans.woff2") format("woff2");
}
@font-face {
  font-family: "Mona Sans"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("fonts/mona-sans.woff2") format("woff2");
}

:root {
  --bg: #f9f7fc;
  --card: #ffffff;
  --card-2: #f3ebff;      /* relleno secundario: inputs, chips, botones suaves */
  --line: #ece6f4;        /* divisores (decorativos) */
  --line-strong: #8f86a0; /* borde que delimita un control (≥3:1 sobre blanco) */
  --text: #18181a;
  --muted: #636363;
  --accent: #c315ab;      /* magenta de marca: como texto y como fondo con texto blanco */
  --accent-soft: #f3ebff;
  --grad: linear-gradient(120deg, #c315ab 0%, #cf108a 25%, #db0b69 50%, #e70548 75%, #f30027 100%);
  --ok: #005f5a;
  --ok-bg: #d4f8d9;
  --warn: #a15c00;
  --warn-bg: #fff4d6;
  --danger: #d0021b;
  --danger-bg: #ffebec;
  --overlay: rgba(24, 24, 26, .55);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(24, 24, 26, .04), 0 4px 16px rgba(24, 24, 26, .05);
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Mona Sans", "Public Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 12px calc(80px + env(safe-area-inset-bottom)) 12px;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.4 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Íconos (Lucide, sprite en index.html): heredan color y escalan con el texto. */
.ic { width: 1em; height: 1em; flex: 0 0 auto; vertical-align: -0.125em; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Títulos y cifras protagonistas en Mona Sans, apretada como en bezza. */
h1, h2, h3, .big-price, .ctrl-word, .ctrl-price, .ch-price, .sc-total, .compar-total b,
.numpad-display, .sync-warn, .sync-pct, .store-total, .it-price .p, .cartbar .info .tot {
  font-family: var(--font-head); letter-spacing: -0.02em;
}

header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  background: var(--bg);
  z-index: 5;
}

h1 { font-size: 28px; margin: 0; font-weight: 800; }
/* Wordmark con el degradé de marca (texto grande: el tramo rojo pasa 3:1). */
.brand { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 20px; margin: 0; }

.tag {
  font-size: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.head-actions { display: flex; gap: 8px; }

/* Loader de la base */
.bar { height: 8px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; margin-top: 10px; }
#loader-bar { height: 100%; width: 0; background: var(--grad); transition: width .2s; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

/* !important: gana siempre como utilidad de toggle, aunque otra clase (ej. .cam
   con display:flex) tenga más prioridad por orden. Sin esto, el overlay de
   cámara no se ocultaba (el botón Cerrar parecía no funcionar). */
.hidden { display: none !important; }

/* Botones grandes: pensados para dedo en pantalla de 5.45" */
button {
  font-family: inherit;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  background: var(--text);
  border: 0;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 16px;
  min-height: 46px;
  cursor: pointer;
}
button:disabled { opacity: .45; }
button.ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

/* Zona */
.zona-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.zona-grid label { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); gap: 4px; }
input {
  font-size: 20px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
}
input:focus { outline: none; border-color: var(--accent); }
.zona-presets { margin-bottom: 10px; }
.zona-resumen { color: var(--muted); font-size: 16px; margin: -4px 0 6px; }
.fecha-lista { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.fecha-lista:empty { display: none; }
.fecha-lista.desfasada { color: var(--warn); font-weight: 600; }

/* Input de escaneo: invisible pero enfocable (recibe el scan del lector) */
#scan-form { margin-bottom: 12px; }
#scan { position: absolute; width: 1px; height: 1px; opacity: 0; padding: 0; border: 0; }
button.icon { min-width: 54px; padding: 0 12px; font-size: 28px; }

/* Modo manual (botón ⌨): input visible + se oculta el indicador de puntería */
body.manual #aim { display: none; }
body.manual #scan {
  position: static; width: 100%; height: auto; opacity: 1;
  font-size: 24px; letter-spacing: 1px; text-align: center; padding: 16px;
  border: 2px solid var(--accent); border-radius: 8px;
}
body.manual #scan:focus { outline: none; }

/* Indicador de puntería: marco con línea que barre + pulso */
.aim { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 12px; }
.aim-box {
  position: relative; width: 80%; max-width: 320px; height: 88px;
  border: 2px solid var(--accent); border-radius: var(--radius); overflow: hidden; background: var(--card);
  animation: aim-pulse 1.6s ease-in-out infinite;
}
.aim-line {
  position: absolute; left: 8%; right: 8%; height: 3px; border-radius: 3px; top: 14px;
  background: var(--grad); box-shadow: 0 0 8px rgba(243, 0, 39, .45);
  animation: aim-scan 1.4s ease-in-out infinite;
}
.aim-label { color: var(--muted); font-size: 16px; }
/* Con cámara disponible el marco se toca para abrirla (ver habilitarAimCamara). */
.aim.tocable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.aim.tocable:active .aim-box { border-color: var(--text); }
@keyframes aim-scan { 0%, 100% { top: 14px; } 50% { top: 70px; } }
@keyframes aim-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(195, 21, 171, .08); } 50% { box-shadow: 0 0 0 6px rgba(195, 21, 171, .18); } }

/* Cámara en pantalla partida (modo Check): mitad superior video, abajo el resultado */
.cam-split { position: fixed; top: 0; left: 0; right: 0; height: 50vh; z-index: 45; background: #000; overflow: hidden; }
#cam-split-video { width: 100%; height: 100%; object-fit: cover; }
.cam-split-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: linear-gradient(0deg, rgba(0, 0, 0, .6), transparent); }
.cam-split-hint { color: #fff; font-size: 16px; }
#cam-split-cerrar { min-height: 42px; }
#cam-split-torch, #cam-split-flip { background: rgba(0, 0, 0, .5); color: #fff; min-width: 44px; }
#cam-split-torch.on { background: #fff; color: var(--text); }

/* Selector de cámara en Ajustes */
.zona-cam { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.zona-cam label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.zona-cam select { font-size: 18px; color: var(--text); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-family: inherit; padding: 10px; width: 100%; }

/* Identidad del dispositivo en Ajustes */
.zona-id { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 16px; color: var(--muted); }
.zona-id b { color: var(--accent); font-family: ui-monospace, monospace; }
.zona-id-btns { display: flex; gap: 8px; }
.zona-id-btns button { min-height: 38px; padding: 6px 12px; }

/* Layout de cámara partida (ambos modos): video arriba (50vh), abajo el panel del modo */
body.cam-open { padding-top: calc(50vh + 6px); }
body.cam-open header, body.cam-open #fecha-lista, body.cam-open #zona-resumen,
body.cam-open .nav, body.cam-open #check-bar, body.cam-open #scan-form,
body.cam-open #aim, body.cam-open #status, body.cam-open #bottom-bar { display: none; }
/* Check: resultado más compacto */
body.cam-open .ctrl { min-height: 40vh; padding: 14px; }
body.cam-open .ctrl-icon { font-size: 80px; }
body.cam-open .ctrl-price { font-size: 48px; }
/* Mi lista: sumar ítems SIN precios en el flujo de escaneo */
body.cam-open .li-precio { display: none; }

/* Modal de sincronización de precios (bloqueante, letras grandes) */
.sync { position: fixed; inset: 0; z-index: 60; background: rgba(249, 247, 252, .98);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.sync-box { width: 100%; max-width: 480px; text-align: center; }
.sync-warn { font-size: 40px; font-weight: 900; color: var(--danger); display: flex; align-items: center; justify-content: center; gap: 10px; line-height: 1.1; margin-bottom: 14px; }
.sync-sub { font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 22px; }
.sync-dates { font-size: 28px; line-height: 1.6; margin-bottom: 22px; color: var(--muted); }
.sync-dates b { color: var(--accent); font-size: 32px; }
.sync-bar { height: 18px; }
#sync-bar-fill { height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.sync-pct { font-size: 40px; font-weight: 800; color: var(--text); margin-top: 14px; font-variant-numeric: tabular-nums; }

/* Overlay de cámara */
.cam { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; align-items: center; justify-content: center; }
#cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame {
  position: relative; width: 74%; max-width: 340px; aspect-ratio: 3 / 2;
  border: 3px solid var(--accent); border-radius: 12px;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, .38);
}
#cam-hint {
  position: absolute; bottom: 108px; color: #fff; font-size: 18px;
  background: rgba(0, 0, 0, .55); padding: 8px 14px; border-radius: 999px;
}
#cam-cerrar { position: absolute; bottom: 32px; }
.cam-torch { position: absolute; top: 24px; right: 20px; background: rgba(0, 0, 0, .5); color: #fff; }
.cam-torch.on { background: #fff; color: var(--text); }
#scan:focus { border-color: var(--accent); }

/* Producto escaneado */
.prod-desc { font-weight: 600; margin: 0 0 2px; }
.prod-ean { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.chain-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.chain-row:first-of-type { border-top: 0; }
.chain-row.best .price { color: var(--ok); font-size: 24px; }
.chain-name { flex: 1; }
.chain-name small { color: var(--muted); display: block; font-size: 14px; }
.price { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.price .list { color: var(--muted); text-decoration: line-through; font-weight: 400; font-size: 14px; margin-right: 6px; }
.promo { color: var(--warn); font-size: 14px; }
.notfound { color: var(--danger); }

/* Navegación de páginas (4 tabs) */
.nav { display: flex; gap: 4px; background: var(--card); padding: 4px; border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow); }
.nav-btn {
  flex: 1; min-width: 0; background: transparent; color: var(--muted); font-weight: 600;
  min-height: 46px; font-size: 24px; padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.nav-btn span { font-size: 12px; font-weight: 700; }
.nav-btn.active { background: var(--accent-soft); color: var(--accent); }

/* El indicador de puntería y la barra inferior solo en check/lista (páginas que escanean) */
body.pg-comparar #aim, body.pg-compra #aim,
body.pg-comparar #bottom-bar, body.pg-compra #bottom-bar { display: none; }

/* Toast de estado */
.status { background: var(--card-2); color: var(--text); font-size: 18px; padding: 9px 12px; border-radius: 10px; margin: -4px 0 12px; }

/* Modo check: resultado grande */
.big { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 0 6px; }
.big-price { font-size: 56px; font-weight: 800; color: var(--ok); line-height: 1; font-variant-numeric: tabular-nums; }
.big-store { margin-top: 6px; font-size: 24px; font-weight: 600; }
.big-store small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }
.otros-label, .prod-ean { color: var(--muted); font-size: 14px; margin: 10px 0 4px; }

/* Modo Check = control de puerta: VÁLIDO / RECHAZADO / YA CHEQUEADO */
.check-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: 16px; }
.check-bar button { min-height: 40px; padding: 8px 12px; }

.ctrl { text-align: center; padding: 24px 14px; border-width: 2px; border-style: solid;
  min-height: 58vh; display: flex; flex-direction: column; justify-content: center; }
.ctrl.ok  { background: var(--ok-bg); border-color: var(--ok); }
.ctrl.no  { background: var(--danger-bg); border-color: var(--danger); }
.ctrl.dup { background: var(--warn-bg); border-color: var(--warn); }
.ctrl-icon { font-size: 116px; line-height: 1; font-weight: 900; }
.ctrl.ok  .ctrl-icon, .ctrl.ok  .ctrl-word { color: var(--ok); }
.ctrl.no  .ctrl-icon, .ctrl.no  .ctrl-word { color: var(--danger); }
.ctrl.dup .ctrl-icon, .ctrl.dup .ctrl-word { color: var(--warn); }
.ctrl-word { font-size: 48px; font-weight: 900; letter-spacing: 1px; margin: 2px 0 12px; }
.ctrl-price { font-size: 56px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.ctrl-store { font-size: 24px; font-weight: 600; margin-top: 8px; }
.ctrl-store small { display: block; color: var(--muted); font-size: 16px; font-weight: 400; }
.ctrl-oferta { color: var(--warn); font-size: 16px; margin-top: 6px; }
.ctrl-desc { color: var(--muted); font-size: 18px; margin-top: 10px; }
.ctrl-sub { font-size: 20px; color: var(--muted); margin-top: 10px; }
.ctrl-first { font-size: 24px; color: var(--muted); margin-top: 6px; }
.ctrl-first b { display: block; font-size: 40px; font-weight: 800; color: var(--warn); margin-top: 2px; }
.ctrl-attempts { font-size: 16px; color: var(--muted); margin: 10px 0 4px; }

/* Flash de molinete a pantalla completa */
#flash { position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0; }
#flash.on-ok  { background: var(--ok); animation: flash .45s ease-out; }
#flash.on-no  { background: var(--danger); animation: flash .45s ease-out; }
#flash.on-dup { background: var(--warn); animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: .82; } 100% { opacity: 0; } }

/* Barra inferior fija: herramientas de escaneo */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(24, 24, 26, .05);
}
.bb-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--card-2); color: var(--text); font-size: 28px; min-height: 56px;
}
.bb-btn span { font-size: 14px; font-weight: 600; color: var(--muted); }

/* Búsqueda por texto */
#search-form { display: flex; gap: 8px; margin-bottom: 12px; }
#search { flex: 1; min-width: 0; }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.result-row:first-child { border-top: 0; }
.result-info { flex: 1; font-size: 18px; }
.result-info small { display: block; color: var(--muted); font-size: 14px; }
.add { min-width: 44px; font-size: 28px; padding: 6px 12px; }

/* Stepper de cantidad en la lista */
.li-info { flex: 1; font-size: 18px; }
.li-info small { display: block; }
.li-precio { color: var(--muted); }
.qty { display: flex; align-items: center; gap: 4px; }
.qbtn { min-width: 40px; min-height: 40px; padding: 0; font-size: 24px; background: var(--card-2); color: var(--text); }
.qbtn.rm { color: var(--danger); font-size: 20px; }
.qnum { min-width: 26px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty-tag { color: var(--accent); font-weight: 700; }

/* Barra de listas nombradas */
.listas-bar { display: flex; gap: 6px; margin-bottom: 12px; }
.listas-bar select {
  flex: 1; min-width: 0; font-size: 18px; color: var(--text); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px; font-family: inherit;
}
.listas-bar button { min-width: 44px; padding: 8px 10px; min-height: 44px; }

/* Botón Ir de compras (en Mi lista) */
.ir-compras { width: 100%; margin-top: 12px; font-size: 20px; min-height: 52px; }

/* Reparto en varias tiendas (bloque en "Ver óptima") */
.rk-opt { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }
.rk-opt:first-of-type { border-top: 0; }
.rk-opt .ahorro { font-size: 14px; margin-left: 6px; }
.rk-suc { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0 3px 12px; font-size: 16px; color: var(--muted); }
.rk-suc .qty { display: block; font-size: 14px; }
.rk-suc .price { color: var(--text); }

/* ===== PÁGINA COMPRA (elegir súper → góndola) ===== */
/* Deja lugar abajo para la barra fija de total del carrito. */
body.pg-compra { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.compras-view { max-width: 640px; margin: 0 auto; }
.compras-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0 12px;
}
.compras-bar h2 { font-size: 20px; margin: 0; min-width: 0; }
.compras-bar .ghost { min-height: 40px; min-width: 44px; padding: 6px 12px; }
.compras-bar-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.picker-sub { color: var(--muted); font-size: 14px; margin: -4px 2px 12px; }
.store.generico { border-style: dashed; border-color: var(--card-2); }

/* Selector de súper */
.store {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); color: var(--text); border: 1px solid transparent;
  border-radius: var(--radius); padding: 13px 14px; margin-bottom: 9px; font-weight: 400;
}
.store.best { border-color: var(--ok); background: var(--ok-bg); }
.store-main { flex: 1; min-width: 0; }
.store-name { font-weight: 600; font-size: 18px; }
.store-name .badge-best {
  font-size: 12px; background: var(--ok); color: #fff; font-weight: 700;
  padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: middle; white-space: nowrap;
}
.store-meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.store-cover { font-size: 14px; margin-top: 3px; }
.store-cover.full { color: var(--ok); }
.store-cover.part { color: var(--warn); }
.store-total { text-align: right; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.store-total small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }

/* Cabecera de la sucursal elegida */
.shop-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--card); border-radius: var(--radius); padding: 11px 14px; margin-bottom: 12px;
}
.shop-head .st { font-weight: 700; font-size: 18px; min-width: 0; }
.shop-head .st small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; margin-top: 2px; }
.shop-head .ghost { min-height: 40px; padding: 8px 12px; }

.sec-title {
  color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .5px;
  font-weight: 700; margin: 14px 4px 8px; display: flex; justify-content: space-between;
}

/* Ítem de góndola */
.item {
  display: flex; gap: 12px; align-items: flex-start; background: var(--card);
  border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: pointer;
}
.item .check {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line);
  margin-top: 2px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: transparent; transition: background .12s, border-color .12s;
}
.item.done .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.it-main { flex: 1; min-width: 0; }
.it-name { font-weight: 600; font-size: 18px; }
.it-name .qty { color: var(--accent); font-weight: 700; }
.item.done .it-name { text-decoration: line-through; color: var(--muted); }
.it-cmp { font-size: 14px; margin-top: 3px; }
.it-cmp.here { color: var(--ok); }
.it-cmp.cheaper { color: var(--warn); }
.it-cmp.none { color: var(--muted); }
.it-price { text-align: right; white-space: nowrap; flex: 0 0 auto; }
.it-price .p { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.it-price .p.editable { border-bottom: 1px dashed var(--line-strong); padding-bottom: 1px; cursor: text; }
.it-price .promo { display: block; color: var(--warn); font-size: 12px; }
.it-price .real { display: block; color: var(--accent); font-size: 12px; }
.it-price .load {
  display: block; color: var(--accent); background: transparent; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; margin-top: 2px; min-height: 0;
}

/* Barra de total del carrito (fija abajo) */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
.cartbar .info { flex: 1; min-width: 0; }
.cartbar .info .n { color: var(--muted); font-size: 14px; }
.cartbar .info .tot { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cartbar .info .tot .lbl { font-size: 14px; color: var(--muted); font-weight: 600; }

/* Canasta */
.canasta-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.canasta-actions { display: flex; gap: 8px; }
.badge { background: var(--card-2); color: var(--accent); border-radius: 999px; padding: 1px 9px; font-size: 18px; }
#lista-items { list-style: none; margin: 0; padding: 0; }
#lista-items li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 18px;
}
#lista-items li:first-child { border-top: 0; }

/* Resultado de la canasta */
.block { margin-bottom: 16px; }
.block h3 { margin: 0 0 8px; font-size: 18px; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 18px; }
.line .qty { color: var(--muted); }
.total { font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.ahorro { color: var(--ok); font-weight: 700; }
.msg { color: var(--muted); }

/* ===== Chips de categoría (góndola de COMPRA) ===== */
.shop-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; }
.shop-cats:empty { display: none; }
.cat-chip { flex: 0 0 auto; background: var(--card-2); color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; min-height: 0; }
.cat-chip.on { background: var(--text); color: #fff; }
#shop-orden.on { background: var(--text); color: #fff; border-color: var(--text); }
.shop-head #shop-orden { min-height: 40px; padding: 8px 12px; }

/* ===== Página COMPARAR: hero + stepper ===== */
.compar-hero { text-align: center; padding: 22px 14px; }
.ch-label { color: var(--muted); font-size: 16px; text-transform: uppercase; letter-spacing: .5px; }
.ch-price { font-size: 56px; font-weight: 800; color: var(--ok); line-height: 1.05; font-variant-numeric: tabular-nums; margin-top: 4px; }
.ch-sub { color: var(--muted); font-size: 18px; margin-top: 6px; }
.ch-one { margin-top: 14px; font-size: 18px; color: var(--text); }
.ch-one b { color: var(--accent); }
.compar-steprow { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 12px; font-size: 18px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .qnum { font-size: 32px; min-width: 34px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.stepper .qbtn { min-width: 48px; min-height: 48px; font-size: 32px; background: var(--card-2); color: var(--text); }

/* ===== Modal (búsqueda) ===== */
.modal { position: fixed; inset: 0; z-index: 55; background: var(--overlay);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 12px 12px; }
.modal-box { width: 100%; max-width: 560px; background: var(--card); border-radius: var(--radius);
  padding: 12px; max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { display: flex; gap: 8px; margin-bottom: 10px; }
.modal-head input { flex: 1; min-width: 0; }
.modal-head .ghost { min-width: 46px; }
.modal-list { overflow-y: auto; }

/* ===== Pad numérico (precio real) ===== */
.numpad { position: fixed; inset: 0; z-index: 58; background: var(--overlay);
  display: flex; align-items: flex-end; justify-content: center; }
.numpad-box { width: 100%; max-width: 480px; background: var(--card); border-radius: 18px 18px 0 0;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); }
.numpad-titulo { color: var(--muted); font-size: 16px; text-align: center; margin-bottom: 6px; }
.numpad-display { font-size: 48px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; padding: 8px 0 16px; }
.numpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.np { background: var(--card-2); color: var(--text); font-size: 28px; min-height: 58px; }
.np-del { color: var(--danger); }
.numpad-actions { display: flex; gap: 8px; margin-top: 12px; }
.numpad-actions button { flex: 1; }

/* Total de los súper elegidos (Comparar): tipografía al doble para comparar de un vistazo */
.compar-total { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 0 4px; }
.compar-total span { color: var(--muted); font-size: 14px; }
.compar-total b { font-size: 48px; font-weight: 800; color: var(--accent); line-height: 1.05; font-variant-numeric: tabular-nums; }

/* Ciudades + geolocalización + fuente de súper (en Zona) */
.zona-presets { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
#ciudad-select { flex: 1; min-width: 0; font-size: 16px; color: var(--text); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-family: inherit; padding: 10px; }
#geo-btn { flex: 0 0 auto; }
.zona-fuente { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.seg { display: flex; background: var(--card-2); border-radius: 8px; padding: 3px; }
.seg-btn { background: transparent; color: var(--muted); min-height: 40px; padding: 8px 14px; font-size: 14px; }
.seg-btn.active { background: var(--text); color: #fff; }

/* ===== COMPARAR con cards ===== */
/* Hero como botón tappable (mantener look de card, no de botón cyan) */
.compar-hero { display: block; width: 100%; background: var(--card); color: var(--text); border: 0; text-align: center; cursor: pointer; }
.compar-hero .ch-price { font-size: 56px; }

/* Carrusel de "un solo súper" + favoritos (deslizable) */
.carrusel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; margin-bottom: 4px; -webkit-overflow-scrolling: touch; }
.carrusel::-webkit-scrollbar { height: 0; }
.sc-card { flex: 0 0 86%; scroll-snap-align: center; background: var(--card); color: var(--text); border: 0; border-radius: var(--radius); padding: 16px; text-align: center; cursor: pointer; }
.sc-label { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .5px; }
.sc-name { font-weight: 700; font-size: 18px; margin-top: 4px; }
.sc-total { font-size: 32px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 6px; }
.sc-delta { font-size: 14px; color: var(--warn); margin-top: 4px; }
.sc-delta.ok { color: var(--ok); }
.sc-cover { font-size: 12px; color: var(--muted); margin-top: 3px; }
.carrusel-hint { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 12px; }

/* Pestañas Todos / Mis favoritos */
.k-tabs { display: flex; gap: 6px; background: var(--card-2); border-radius: 10px; padding: 4px; margin-bottom: 12px; }
.k-tab { flex: 1; background: transparent; color: var(--muted); min-height: 42px; font-size: 14px; }
.k-tab.active { background: var(--text); color: #fff; }

/* Detalle por súper (al tocar el hero) */
.det-volver { margin-bottom: 12px; }
.det-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.det-name { font-weight: 700; font-size: 16px; }
.det-meta { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }

/* ===== Comparar: tipografía de las cards agrandada (~doble el texto de apoyo) ===== */
#comparar-body .ch-label { font-size: 24px; }
#comparar-body .ch-price { font-size: 64px; }
#comparar-body .ch-sub { font-size: 24px; }
#comparar-body .sc-label { font-size: 24px; }
#comparar-body .sc-name { font-size: 32px; }
#comparar-body .sc-total { font-size: 48px; }
#comparar-body .sc-delta { font-size: 24px; }
#comparar-body .sc-cover { font-size: 20px; }
#comparar-body .sc-ver { font-size: 20px; color: var(--accent); margin-top: 6px; }
#comparar-body .k-tab { font-size: 24px; min-height: 54px; }
#comparar-body .compar-steprow { font-size: 24px; }
#comparar-body .stepper .qnum { font-size: 48px; }
#comparar-body .stepper .qbtn { min-width: 56px; min-height: 56px; font-size: 32px; }
#comparar-body .compar-total span { font-size: 24px; }
#comparar-body .compar-total b { font-size: 64px; }
#comparar-body .rk-suc { font-size: 24px; }
#comparar-body .rk-suc .qty { font-size: 18px; }
#comparar-body .det-name { font-size: 28px; }
#comparar-body .det-meta { font-size: 20px; }
#comparar-body .line { font-size: 24px; }
#comparar-body .msg { font-size: 20px; }
#comparar-body .carrusel-hint { font-size: 18px; }

/* ===== Íconos SVG (reemplazan a los emojis) ===== */
.ctrl-icon { display: flex; justify-content: center; }
.ctrl-icon .ic { stroke-width: 1.75; }
.sync-warn .ic { width: 1.1em; height: 1.1em; }
.fecha-lista .ic, .it-cmp .ic, .real .ic, .store-name .ic, .store-cover .ic { width: 1.05em; height: 1.05em; }
.item .check .ic { width: 18px; height: 18px; stroke-width: 3; }
.nav-btn .ic { width: 24px; height: 24px; }
.bb-btn .ic { width: 26px; height: 26px; }
button.icon .ic { width: 24px; height: 24px; }
/* Superficies sueltas (no .card) con la misma elevación suave de bezza */
.store, .item, .sc-card, .shop-head, .modal-box { box-shadow: var(--shadow); }

/* Botones con contenido en bloque: el button base es inline-flex (ícono + texto en fila),
   estos apilan su contenido. */
.sc-card { display: block; }
/* Comparar a 360px: "Comprando en [−] N [+] súper" no entra en una línea con la tipografía agrandada. */
.compar-steprow { flex-wrap: wrap; row-gap: 6px; }
.compar-steprow > span { white-space: nowrap; }
/* Lista: el contador no se separa del título; acciones más compactas para que entren al lado. */
.canasta-head h2 { white-space: nowrap; }
.canasta-actions button { font-size: 16px; min-height: 44px; padding: 8px 10px; }
/* Veredicto del control de puerta: Mona Sans negra es más ancha que la del sistema; escala con
   la pantalla para que "YA CHEQUEADO" (la palabra más larga) entre a 360px. */
.ctrl-word { font-size: clamp(28px, 9.5vw, 48px); letter-spacing: -0.01em; }
.compar-steprow > span:first-child { flex-basis: 100%; text-align: center; }

/* ===== Primer ingreso: deslinde + instalar (encima del modal de descarga) ===== */
.deslinde { position: fixed; inset: 0; z-index: 70; background: var(--overlay);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.deslinde-box { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--card); border-radius: 24px; padding: 24px 20px; box-shadow: var(--shadow); }
.deslinde h2 { font-size: 28px; line-height: 1.1; margin: 0 0 16px; }
.deslinde p { font-size: 16px; margin: 0 0 12px; }
.deslinde button { width: 100%; min-height: 52px; margin-top: 8px; }
