/* Layout: tienda mayorista luminosa — fondo con tinte azul, superficies blancas, color por producto y por estado; diseño claro a propósito (un solo tema) */
:root {
  color-scheme: light;
  --bg: #f3f6fe;
  --surface: #ffffff;
  --surface-2: #eaf0ff;
  --line: #dde5f7;
  --line-strong: #c3d0ee;
  --fg: #172040;
  --muted: #56658e;

  --primary: #2b5ff0;
  --primary-hover: #1f4dd4;
  --primary-ink: #1d47c4;
  --primary-soft: #e2eaff;
  --on-color: #ffffff;

  --pink: #e5447a;   --pink-ink: #bd1f57;   --pink-soft: #fde4ed;
  --orange: #f2791c; --orange-ink: #b04f05; --orange-soft: #ffead8;
  --green: #12a372;  --green-ink: #0a7852;  --green-soft: #daf5ea;
  --teal: #10a5b2;   --teal-ink: #08747e;   --teal-soft: #d8f3f5;
  --violet: #7b4df2; --violet-ink: #5a2fd0; --violet-soft: #ece5ff;
  --yellow: #f6bd16; --yellow-ink: #855b00; --yellow-soft: #fff3c9;

  --ok: var(--green);   --ok-ink: var(--green-ink);   --ok-soft: var(--green-soft);
  --warn: var(--orange); --warn-ink: var(--orange-ink); --warn-soft: var(--orange-soft);
  --err: #dc2f4f;       --err-ink: #b01836;           --err-soft: #fde3e8;

  --yape: #6c1f88;
  --overlay: rgba(23, 32, 64, .4);
  --shadow-sm: 0 1px 2px rgba(23, 32, 64, .06);
  --shadow: 0 2px 6px rgba(23, 32, 64, .06), 0 16px 40px rgba(43, 95, 240, .14);

  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --r-sm: 8px;
  --r: 12px;
}

/* Familias de color reutilizables (monogramas, cifras, pasos) */
.hue-0 { --c: var(--primary); --c-ink: var(--primary-ink); --c-soft: var(--primary-soft); }
.hue-1 { --c: var(--pink);    --c-ink: var(--pink-ink);    --c-soft: var(--pink-soft); }
.hue-2 { --c: var(--orange);  --c-ink: var(--orange-ink);  --c-soft: var(--orange-soft); }
.hue-3 { --c: var(--green);   --c-ink: var(--green-ink);   --c-soft: var(--green-soft); }
.hue-4 { --c: var(--teal);    --c-ink: var(--teal-ink);    --c-soft: var(--teal-soft); }
.hue-5 { --c: var(--violet);  --c-ink: var(--violet-ink);  --c-soft: var(--violet-soft); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--f-body); font-size: 15px; background: var(--bg); color: var(--fg); min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 25; background: var(--surface); }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; font-weight: 700; }
h1, h2 { font-family: var(--f-display); letter-spacing: -.015em; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding-block: 0 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--f-mono); font-size: .88em; }
.row { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
td, .price, .stat .v, .total-row, .chip-saldo, .num { font-variant-numeric: tabular-nums; }


/* Barra superior */
#topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.topbar-in { max-width: 1120px; margin: 0 auto; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; gap: 8px 20px; align-items: center; flex-wrap: wrap; }
.brand { font-family: var(--f-display); font-weight: 800; font-size: 1.2rem; color: var(--fg); display: flex; align-items: center; gap: 9px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-dot { width: 32px; height: 32px; border-radius: 10px; background: var(--primary); color: var(--on-color); display: grid; place-items: center; font-size: .78rem; font-family: var(--f-body); font-weight: 700; position: relative; }
.brand-dot::after { content: ""; position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); border: 2px solid var(--surface); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: .92rem; font-weight: 500; }
.nav a:hover { color: var(--primary-ink); background: var(--surface-2); text-decoration: none; }
.nav a.on { color: var(--primary-ink); background: var(--primary-soft); font-weight: 600; }
.chip-saldo { color: var(--green-ink); background: var(--green-soft); padding: 6px 12px; border-radius: 999px; font-size: .88rem; font-weight: 500; }
.chip-saldo:hover { text-decoration: none; filter: brightness(.97); }
.chip-saldo b { font-weight: 700; }
.aviso { background: var(--primary-soft); color: var(--primary-ink); padding-block: 7px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); font-size: .85rem; font-weight: 500; text-align: center; }

/* Botones y campos */
.btn { appearance: none; border: 1px solid var(--primary); background: var(--primary); color: var(--on-color); padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background-color .12s, border-color .12s, box-shadow .12s; line-height: 1.3; }
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); text-decoration: none; box-shadow: 0 4px 12px rgba(43, 95, 240, .25); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--primary-ink); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--primary); box-shadow: none; }
.btn.ok { background: var(--green); border-color: var(--green); }
.btn.ok:hover { background: var(--green-ink); border-color: var(--green-ink); box-shadow: 0 4px 12px rgba(18, 163, 114, .25); }
.btn.danger { background: var(--surface); border-color: var(--err); color: var(--err-ink); }
.btn.danger:hover { background: var(--err-soft); box-shadow: none; }
.btn.block { width: 100%; justify-content: center; padding-block: 11px; }
.btn.tiny { padding: 3px 11px; font-size: .8rem; }
.badge { background: var(--pink); color: var(--on-color); border-radius: 999px; font-size: .72rem; padding: 0 7px; font-weight: 700; line-height: 1.55; }

label { display: block; font-size: .84rem; font-weight: 600; color: var(--fg); margin: 12px 0 5px; }
input, select, textarea { width: 100%; background: var(--surface); border: 1px solid var(--line-strong); color: var(--fg); border-radius: var(--r-sm); padding: 9px 12px; font: inherit; font-size: .95rem; outline: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { min-height: 110px; resize: vertical; }
input[type=file] { padding: 7px; font-size: .85rem; background: var(--bg); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
label.row { font-weight: 400; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* Portada del catálogo */
.hero { margin-top: 24px; background: var(--primary-soft); border-radius: 16px; padding: 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px 32px; align-items: center; }
.hero-text { display: grid; gap: 8px; min-width: 0; }
.hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 800; color: var(--fg); }
.hero p { color: var(--muted); max-width: 52ch; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: paso; }
.steps li { counter-increment: paso; display: grid; grid-template-columns: 34px 1fr; gap: 0 12px; align-items: center; background: var(--surface); border-radius: var(--r); padding: 10px 14px; box-shadow: var(--shadow-sm); }
.steps li::before { content: counter(paso); grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; background: var(--c-soft); color: var(--c-ink); display: grid; place-items: center; font-weight: 700; }
.steps b { font-weight: 650; }
.steps span { color: var(--muted); font-size: .85rem; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 24px 0 18px; }
.toolbar input { max-width: 300px; border-radius: 999px; padding-inline: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); padding: 5px 13px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .86rem; font-weight: 500; }
.chip:hover { color: var(--primary-ink); border-color: var(--primary); }
.chip.on { background: var(--primary); color: var(--on-color); border-color: var(--primary); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s; }
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card-top { display: flex; gap: 12px; align-items: center; }
.card-top > div { min-width: 0; }
.thumb { width: 46px; height: 46px; flex: none; border-radius: 12px; background: var(--c-soft, var(--primary-soft)); color: var(--c-ink, var(--primary-ink)); display: grid; place-items: center; overflow: hidden;
  font-family: var(--f-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .name { font-weight: 650; font-size: 1rem; line-height: 1.3; }
.card .meta { color: var(--c-ink, var(--muted)); font-size: .8rem; font-weight: 500; margin-top: 2px; }
.card .desc { color: var(--muted); font-size: .88rem; flex: 1; }
.card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.card .price { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; color: var(--fg); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--primary-ink); white-space: nowrap; }
.tag.ok { color: var(--ok-ink); background: var(--ok-soft); }
.tag.warn { color: var(--warn-ink); background: var(--warn-soft); }
.tag.err { color: var(--err-ink); background: var(--err-soft); }
.empty { text-align: center; color: var(--muted); padding: 44px 12px; border: 2px dashed var(--line-strong); border-radius: var(--r); grid-column: 1 / -1; background: var(--surface); }

/* Carrito */
#overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 30; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(420px, 100%); background: var(--surface); z-index: 31; display: flex; flex-direction: column; box-shadow: var(--shadow);
  padding-top: env(safe-area-inset-top, 0px); padding-right: env(safe-area-inset-right, 0px); }
.drawer header { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.drawer .items { flex: 1; overflow: auto; padding: 4px 16px; }
.drawer footer { padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; background: var(--bg); }
.cart-line { display: flex; gap: 10px; align-items: center; padding: 12px 0; }
.cart-line .info { flex: 1; min-width: 0; }
.qty { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 2px; }
.qty span { min-width: 22px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.qty button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--surface); color: var(--primary-ink); cursor: pointer; font: inherit; font-size: 1rem; font-weight: 700; box-shadow: var(--shadow-sm); }
.qty button:hover { background: var(--primary); color: var(--on-color); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; }
.total-row b { font-size: 1.25rem; }

/* Paneles */
.page-title { padding-block: 30px 4px; }
.page-title h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 16px 0 20px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; scrollbar-width: none; }
.tab { background: none; border: none; color: var(--muted); padding: 7px 14px; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 500; border-radius: 999px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--primary-ink); background: var(--surface-2); }
.tab.on { color: var(--on-color); background: var(--primary); font-weight: 600; }
.tab.on .badge { background: var(--surface); color: var(--pink-ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; min-width: 0; overflow: hidden; box-shadow: var(--shadow-sm); }
.panel > .table-wrap:first-child { margin-top: -18px; }
.panel > h3:first-child { margin-bottom: 10px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }
.cols > * { min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--c-soft); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column-reverse; gap: 4px; }
.stat:nth-child(6n+1) { --c-soft: var(--primary-soft); --c-ink: var(--primary-ink); }
.stat:nth-child(6n+2) { --c-soft: var(--violet-soft);  --c-ink: var(--violet-ink); }
.stat:nth-child(6n+3) { --c-soft: var(--orange-soft);  --c-ink: var(--orange-ink); }
.stat:nth-child(6n+4) { --c-soft: var(--pink-soft);    --c-ink: var(--pink-ink); }
.stat:nth-child(6n+5) { --c-soft: var(--teal-soft);    --c-ink: var(--teal-ink); }
.stat:nth-child(6n+6) { --c-soft: var(--green-soft);   --c-ink: var(--green-ink); }
.stat .v { font-family: var(--f-display); font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; color: var(--fg); }
.stat .k { color: var(--c-ink); font-size: .78rem; font-weight: 600; }
#lowStock { display: grid; }
#lowStock > .row { justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
#lowStock > .row:last-child { border-bottom: 0; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--primary-ink); font-weight: 600; font-size: .78rem; background: var(--surface-2); border-bottom: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f7f9ff; }
.table-wrap { overflow-x: auto; }
.panel.table-wrap { padding: 0; }
.panel.table-wrap > h3 { padding: 16px 16px 8px; }
.panel .table-wrap { margin-inline: -18px; margin-bottom: -18px; }
.panel h3 + .table-wrap, .panel p + .table-wrap { margin-top: 12px; }
td .btn { margin: 2px 4px 2px 0; }
.pos { color: var(--green-ink); font-weight: 600; }
.neg { color: var(--err-ink); font-weight: 600; }
section[data-sec] > h3 { margin: 24px 0 10px; }

/* Pedidos del cliente */
.order { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.order-head { padding: 13px 16px; display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; cursor: pointer; }
.order-head:hover { background: #f7f9ff; }
.order-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.cred { background: var(--bg); border-radius: var(--r-sm); padding: 8px 12px; margin-top: 10px; }
.cred-row { display: flex; gap: 10px; align-items: center; padding: 5px 0; }
.cred-row + .cred-row { border-top: 1px dashed var(--line-strong); }
.cred-row .k { color: var(--primary-ink); font-size: .78rem; font-weight: 600; width: 110px; flex: none; }
.cred-row .v { flex: 1; min-width: 0; word-break: break-all; }

.yape-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--yape); color: var(--on-color); border-radius: var(--r); padding: 16px; margin-top: 4px; }
.yape-box img { width: 128px; height: 128px; border-radius: var(--r-sm); background: #ffffff; padding: 6px; object-fit: contain; }
.yape-box .num { font-size: 1.45rem; font-weight: 700; letter-spacing: .02em; }
.yape-box .btn.ghost { background: transparent; color: var(--on-color); border-color: #ffffff99; margin-top: 8px; }
.yape-box .btn.ghost:hover { background: #ffffff26; }
#yapeInfo + p, #yapeInfo > p { margin-top: 12px; }

.auth { max-width: 420px; margin: 44px auto; }
.auth .panel, .panel.auth { padding: 26px; box-shadow: var(--shadow); }
.auth h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; }
.panel.auth h3 { margin-bottom: 4px; }
.panel.auth .btn.block { margin-top: 16px; }
.switch { text-align: center; margin-top: 16px; color: var(--muted); font-size: .9rem; }
.switch button { background: none; border: none; color: var(--primary-ink); cursor: pointer; font: inherit; font-weight: 600; }

.thumb-sm { width: 40px; height: 40px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-2); }
.shot { max-width: 100%; max-height: 66vh; border-radius: var(--r-sm); display: block; margin: 0 auto 10px; border: 1px solid var(--line); }

/* Modal y avisos */
.modal-bg { position: fixed; inset: 0; background: var(--overlay); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; padding: 22px; width: min(540px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal > .row:first-child { margin-bottom: 8px; }
.modal > .row:last-child { margin-top: 18px; }
.modal p + p { margin-top: 6px; }

#toasts { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(400px, calc(100% - 32px)); }
.toast { background: var(--surface); color: var(--fg); padding: 11px 14px; border-radius: var(--r); box-shadow: var(--shadow); font-size: .9rem; font-weight: 500; display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); }
.toast::before { content: "✓"; width: 22px; height: 22px; border-radius: 50%; background: var(--green-soft); color: var(--green-ink); display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex: none; }
.toast.err::before { content: "!"; background: var(--err-soft); color: var(--err-ink); }

/* Indicaciones y datos del cliente */
.indic { background: var(--orange-soft); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 10px; }
.indic-t { font-size: .74rem; font-weight: 700; color: var(--orange-ink); margin-bottom: 3px; }
.indic-b { white-space: pre-line; font-size: .88rem; }
details.ind summary { cursor: pointer; color: var(--orange-ink); font-size: .84rem; font-weight: 600; width: fit-content; }
details.ind[open] summary { margin-bottom: 6px; }
details.ind .indic-b { background: var(--orange-soft); border-radius: var(--r-sm); padding: 8px 10px; }
.msg { background: var(--green-soft); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 10px; white-space: pre-line; font-size: .9rem; }
.unit-form { background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 12px 12px; margin-bottom: 10px; }
.unit-form label { margin-top: 8px; }
.unit-form input { padding: 7px 10px; }
.item-block { padding: 12px 0; border-bottom: 1px solid var(--line); }
.item-block:last-child { border-bottom: none; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.seg label { margin: 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; font-weight: 600; }
.seg label:hover { border-color: var(--primary); }
.seg label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.seg input { margin: 0 6px 0 0; vertical-align: -1px; }
.seg small { display: block; color: var(--muted); margin-top: 3px; font-weight: 400; font-size: .78rem; line-height: 1.35; }

@media (max-width: 640px) {
  .cred-row .k { width: 84px; }
  th, td { padding: 9px 10px; }
  .toolbar input { max-width: none; }
  .hero { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Utilidades */
.mt-s { margin-top: 8px; }
.mt-m { margin-top: 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary-ink); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.form-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* Franja de ofertas deslizante (debajo del encabezado, en todas las páginas) */
.promo-band { display: flex; align-items: stretch; background: var(--primary); color: var(--on-color); overflow: hidden; font-size: .88rem; }
.promo-label { flex: none; display: flex; align-items: center; background: var(--yellow); color: var(--fg); font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  padding-block: 0; padding-right: 14px; padding-left: max(16px, env(safe-area-inset-left, 0px)); }
.promo-viewport { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.promo-track { display: flex; width: max-content; animation: promo-scroll var(--dur, 30s) linear infinite; }
.promo-band:hover .promo-track, .promo-band:focus-within .promo-track { animation-play-state: paused; }
.promo-group { display: flex; flex: none; }
.promo-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 36px 8px 0; white-space: nowrap; font-weight: 500; }
.promo-group .promo-item:first-child { padding-left: 28px; }
.promo-tag { background: rgba(255, 255, 255, .2); border-radius: 999px; padding: 1px 8px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
@keyframes promo-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .promo-track { animation: none; width: auto; }
  .promo-group { flex-wrap: wrap; }
  .promo-group[aria-hidden="true"] { display: none; }
  .promo-item { white-space: normal; }
}

/* Panel del modo demostración en la página de ingreso */
.demo-box { background: var(--yellow-soft); border: 1px solid #f0d27a; border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.demo-box h3 { margin-bottom: 4px; }
.demo-box .row { margin-top: 12px; }
.demo-box .btn { flex: 1; justify-content: center; }

/* ---------- Encabezado con íconos y menú lateral ---------- */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { appearance: none; position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; flex: none;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--primary-ink); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--primary); }
.icon-btn .icon { width: 22px; height: 22px; }
.cart-btn { background: var(--primary); border-color: var(--primary); color: var(--on-color); }
.cart-btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.cart-btn .badge { position: absolute; top: -7px; right: -7px; min-width: 20px; text-align: center; border: 2px solid var(--surface); line-height: 1.4; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.chip-saldo { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: .92rem; white-space: nowrap; }
.chip-saldo .icon { width: 18px; height: 18px; }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }

.menu-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 50; }
.side-menu { position: fixed; top: 0; bottom: 0; left: 0; z-index: 51; width: min(300px, 86vw); display: flex; flex-direction: column; overflow-y: auto;
  background: var(--surface); box-shadow: var(--shadow); animation: menu-entra .2s ease-out;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); }
@keyframes menu-entra { from { transform: translateX(-100%); } to { transform: none; } }
.side-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.side-title { font-family: var(--f-display); font-size: 1.1rem; }
.side-user { margin: 14px 14px 4px; padding: 12px 14px; border-radius: var(--r); background: var(--primary-soft); }
.side-user b { display: block; font-size: 1rem; }
.side-saldo { margin-top: 4px; font-weight: 700; color: var(--green-ink); }
.side-nav { display: grid; gap: 2px; padding: 10px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 10px; color: var(--fg); font-weight: 500; font-size: 1rem; }
.side-nav a .icon { color: var(--primary-ink); }
.side-nav a:hover { background: var(--surface-2); text-decoration: none; }
.side-nav a.on { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.side-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); }
.side-foot .btn .icon { width: 18px; height: 18px; }

@media (max-width: 720px) {
  .menu-btn { display: inline-grid; }
  .only-desktop { display: none !important; }
  .topbar-in { flex-wrap: nowrap; gap: 8px; padding-block: 8px; }
  .brand { min-width: 0; font-size: 1.05rem; gap: 8px; }
  .brand-dot { width: 30px; height: 30px; }
  .top-actions { gap: 6px; }
  .chip-saldo { padding: 6px 10px; font-size: .88rem; }
  .icon-btn { width: 40px; height: 40px; }
}
@media (max-width: 380px) {
  .brand-dot { display: none; }
  .chip-saldo .icon { display: none; }
}

/* ---------- Catálogo más amplio en celular ---------- */
@media (max-width: 640px) {
  .hero { margin-top: 12px; padding: 16px; gap: 12px; border-radius: 14px; }
  .hero h1 { font-size: 1.4rem; }
  .hero p { font-size: .88rem; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .steps li { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 4px; padding: 8px 6px; }
  .steps li::before { grid-row: auto; width: 26px; height: 26px; font-size: .8rem; }
  .steps b { font-size: .74rem; line-height: 1.2; font-weight: 600; }
  .steps span { display: none; }
  .toolbar { margin: 14px 0 12px; gap: 10px; }
  .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .toolbar .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .grid { gap: 10px; }
  .card { padding: 14px; }
  .page-title { padding-block: 20px 0; }
}
@media (prefers-reduced-motion: reduce) { .side-menu { animation: none; } }

/* ---------- Listas de precios ---------- */
.price-box { display: flex; flex-direction: column; line-height: 1.15; }
.price-antes { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.lista-nota { margin-left: auto; font-size: .85rem; color: var(--violet-ink); background: var(--violet-soft); padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.pl-list { display: grid; gap: 6px; }
.pl-item { appearance: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font: inherit; color: var(--fg); }
.pl-item:hover { border-color: var(--primary); }
.pl-item.on { border-color: var(--primary); background: var(--primary-soft); }
.pl-new { display: flex; gap: 8px; }
.pl-new input { flex: 1; min-width: 0; }
.pl-cell { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-input { width: 110px; padding: 7px 10px; }
.pl-select { min-width: 150px; padding: 6px 10px; font-size: .88rem; }
@media (max-width: 640px) { .lista-nota { margin-left: 0; } }

/* ---------- Cambio de página suave (Chrome/Edge): un fundido corto en lugar del destello en blanco ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
#topbar { view-transition-name: encabezado; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ---------- Pie de página con crédito ---------- */
.site-pie { text-align: center; font-size: .85rem; color: var(--muted); padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.site-pie a { color: var(--primary-ink); font-weight: 600; }
main[hidden] ~ .site-pie { display: none; }

/* El administrador no ve los pasos de compra; con pre.js ya se ocultan desde la primera imagen */
html[data-rol="admin"] .steps { display: none; }
#topbar:empty { min-height: var(--alto-cab, 0px); }
