@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');
/* ============================================================
   La Escoba · Cotizaciones B2B — Sistema de diseño
   ============================================================ */
:root {
  /* Azul corporativo */
  --brand: #2563eb;
  --brand-600: #1d4ed8;
  --brand-700: #1e3a8a;
  --brand-soft: #e0ebff;
  --brand-ink: #ffffff;

  --ink: #0f1826;
  --muted: #5a6778;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e6eaf1;
  --border-strong: #d4dae6;

  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --info: #2563eb;

  /* Fuentes */
  --font-body: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font-body);

  /* Sombras suaves */
  --shadow-sm: 0 1px 2px rgba(20,30,50,.05), 0 2px 6px rgba(20,30,50,.04);
  --shadow-md: 0 6px 22px rgba(20,30,50,.09);
  --shadow-lg: 0 24px 60px rgba(15,25,45,.22);

  /* Bordes más redondeados */
  --radius: 18px;
  --radius-sm: 13px;
  --radius-lg: 24px;

  --header-h: 124px;
  --maxw: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e7ecf0;
    --muted: #9aa6b1;
    --bg: #0e1319;
    --surface: #161c23;
    --surface-2: #1b222b;
    --border: #28313b;
    --border-strong: #38434f;
    --brand-soft: #16284d;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 6px 20px rgba(0,0,0,.45);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --ink: #e7ecf0; --muted: #9aa6b1; --bg: #0e1319; --surface: #161c23;
  --surface-2: #1b222b; --border: #28313b; --border-strong: #38434f; --brand-soft: #16284d;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-600); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1,h2,h3 { line-height: 1.2; margin: 0; font-family: var(--font-display); letter-spacing: -.01em; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-top { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; font-size: 1.15rem; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-700));
  display: grid; place-items: center; color: #fff; font-size: 18px; box-shadow: var(--shadow-sm);
}
.brand small { display:block; font-weight: 600; font-size: .66rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.header-spacer { flex: 1; }

.search {
  flex: 1; max-width: 520px; position: relative;
}
.search input {
  width: 100%; height: 42px; border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 0 16px 0 42px; background: var(--surface); color: var(--ink); font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.icon-btn {
  height: 42px; min-width: 42px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--brand); }
.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -6px; right: -6px; background: var(--brand); color: #fff;
  min-width: 20px; height: 20px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  display: grid; place-items: center; padding: 0 5px; box-shadow: var(--shadow-sm);
}

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 8px 0 12px; scrollbar-width: thin; }
.chips::-webkit-scrollbar { height: 6px; }
.chips::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
.chip {
  white-space: nowrap; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--muted); border-radius: 999px; padding: 6px 13px; font-size: .83rem; font-weight: 600;
  transition: all .15s;
}
.chip:hover { border-color: var(--brand); color: var(--ink); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Hero note ---------- */
.notice {
  background: var(--brand-soft); color: var(--brand-700);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  border-radius: var(--radius); padding: 12px 16px; margin: 18px 0 6px; font-size: .9rem;
  display: flex; gap: 10px; align-items: flex-start;
}
:root[data-theme="dark"] .notice, :root:not([data-theme="light"]) .notice { color: #a9c6ff; }

/* ---------- Product grid ---------- */
.grid {
  display: grid; gap: 12px; padding: 14px 0 36px;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 12px; display: flex; flex-direction: column; gap: 5px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .tag {
  align-self: flex-start; font-size: .68rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--brand-700); background: var(--brand-soft);
  padding: 2px 7px; border-radius: 7px; font-size: .63rem;
}
:root[data-theme="dark"] .card .tag, :root:not([data-theme="light"]) .card .tag { color:#a9c6ff; }
.card .desc { font-weight: 600; font-size: .88rem; line-height: 1.3; min-height: 2.3em; letter-spacing: -.005em; }
.card .meta { font-size: .73rem; color: var(--muted); display: flex; gap: 7px; flex-wrap: wrap; }
.card .price-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: auto; gap:8px;}
.card .price { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; letter-spacing: -.02em; }
.card .btn.add { padding: 8px 12px; font-size: .85rem; border-radius: 11px; }
.card .price small { font-size: .7rem; color: var(--muted); font-weight: 600; display:block; }

.qty {
  display: inline-flex; align-items: center; border: 1px solid var(--border-strong);
  border-radius: 12px; overflow: hidden;
}
.qty button { width: 32px; height: 34px; border: none; background: var(--surface-2); color: var(--ink); font-size: 1.1rem; }
.qty button:hover { background: var(--brand-soft); }
.qty input { width: 42px; height: 34px; border: none; text-align: center; background: var(--surface); color: var(--ink); font-size: .95rem; font-weight: 600; -moz-appearance: textfield; appearance: textfield; }
.qty input:focus { outline: none; }
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.add-row { display: flex; gap: 8px; align-items: center; }
.btn {
  border: none; border-radius: 13px; padding: 10px 16px; font-weight: 700; font-size: .9rem;
  background: var(--brand); color: #fff; transition: background .15s, transform .05s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:hover { background: var(--brand-600); }
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 18px; font-size: 1rem; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--border-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.add { flex: 1; }
.btn.added { background: var(--ok); }

/* ---------- Loading / empty ---------- */
.state { text-align: center; color: var(--muted); padding: 60px 20px; }
.skeleton { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); height: 190px; position: relative; overflow: hidden; }
.skeleton::after { content:""; position:absolute; inset:0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--border) 60%, transparent), transparent); animation: sh 1.2s infinite; }
@keyframes sh { 100% { transform: translateX(100%); } }
.load-more { display: grid; place-items: center; padding: 10px 0 50px; }

/* ---------- Cart drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10,15,20,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 440px; max-width: 94vw;
  background: var(--surface); z-index: 60; transform: translateX(100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer-head h2 { font-size: 1.1rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 18px; }
.drawer-foot { border-top: 1px solid var(--border); padding: 16px 18px; background: var(--surface-2); }

.line {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--border);
}
.line .ldesc { font-weight: 650; font-size: .92rem; }
.line .lmeta { font-size: .76rem; color: var(--muted); }
.line .lprice { font-weight: 700; text-align: right; white-space: nowrap; }
.line .lctrl { display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; justify-content: space-between; }
.link-danger { background: none; border: none; color: var(--danger); font-size: .82rem; font-weight: 600; padding: 4px; }

.totals { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.totals .t { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); }
.totals .grand { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 1.2rem; font-weight: 800; color: var(--ink); border-top: 1px dashed var(--border-strong); padding-top: 10px; margin-top: 4px; }
.totals .grand span:last-child { margin-left: auto; white-space: nowrap; }

/* ---------- Form fields ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field .req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; padding: 11px 12px;
  background: var(--surface); color: var(--ink); font-size: .95rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label {
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px; text-align: center;
  font-weight: 650; font-size: .9rem; cursor: pointer; transition: all .15s;
}
.seg input { position: absolute; opacity: 0; }
.seg label:hover { border-color: var(--brand); }
.seg input:checked + span { color: var(--brand-700); }
.seg label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-700); }

/* ---------- Confirmation ---------- */
.confirm { text-align: center; padding: 20px 6px; }
.confirm .big { width: 72px; height: 72px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-700); display: grid; place-items: center; margin: 0 auto 16px; font-size: 36px; }
.folio-box { font-size: 1.6rem; font-weight: 800; letter-spacing: .02em; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px; margin: 14px 0; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: all .2s; z-index: 80; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; padding: 24px 0; text-align: center; }
.foot a { margin: 0 8px; }

/* ---------- Tables (admin/vendedor) ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
tr:hover td { background: var(--surface-2); }
.badge { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; display: inline-block; }
.b-NUEVA { background: #dbeafe; color: #1d4ed8; }
.b-CONTACTADO { background: #fef3c7; color: #b45309; }
.b-COTIZADO { background: #e0e7ff; color: #4338ca; }
.b-CERRADA_GANADA { background: #dcfce7; color: #15803d; }
.b-CERRADA_PERDIDA { background: #fee2e2; color: #b91c1c; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin: 18px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.stat .n { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; }
.stat .l { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.page-title { padding: 22px 0 6px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.page-title h1 { font-size: 1.5rem; letter-spacing: -.02em; }

/* Números destacados con la fuente de carácter */
.folio-box, .totals .grand span:last-child { font-family: var(--font-display); }

/* ============================================================
   Modo autoatención (kiosco) — solo en la portada (body.kiosk)
   ============================================================ */
.shop {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 338px;
  gap: 16px; align-items: start; padding-bottom: 40px;
}

/* Rail de categorías */
.cats {
  position: sticky; top: 76px; align-self: start;
  display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 96px); overflow-y: auto; scrollbar-width: thin;
}
.cat {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  border-radius: 12px; padding: 9px 11px; font-weight: 600; font-size: .9rem;
  transition: background .12s, color .12s; white-space: nowrap; overflow: hidden;
}
.cat:hover { background: var(--surface-2); color: var(--ink); }
.cat.active { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.cat-ico { font-size: 1.15rem; width: 24px; text-align: center; flex: 0 0 auto; }
.cat-lbl { overflow: hidden; text-overflow: ellipsis; }

/* Catálogo central */
.catalog .grid { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 9px; padding-top: 10px; }
.card-action { margin-top: 2px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }

/* Badge de stock (en palabras, derivado del número) */
.stockchip { font-size: .62rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.stockchip.s-alto { background: #dcfce7; color: #15803d; }
.stockchip.s-medio { background: #fef3c7; color: #b45309; }
.stockchip.s-bajo { background: #ffedd5; color: #c2410c; }
.stockchip.s-nulo { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
:root[data-theme="dark"] .stockchip.s-alto, :root:not([data-theme="light"]) .stockchip.s-alto { background:#0f3d24; color:#86efac; }
:root[data-theme="dark"] .stockchip.s-medio, :root:not([data-theme="light"]) .stockchip.s-medio { background:#3a2c0a; color:#fcd34d; }
:root[data-theme="dark"] .stockchip.s-bajo, :root:not([data-theme="light"]) .stockchip.s-bajo { background:#3a1f0a; color:#fdba74; }

/* Contador en el rail de categorías */
.cat-n { margin-left: auto; font-size: .7rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 7px; }
.cat.active .cat-n { background: rgba(255,255,255,.25); color: #fff; }
.card.in-cart { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset, var(--shadow-sm); }
.card.in-cart .tag { background: var(--brand); color: #fff; }

/* Stepper grande (táctil) en tarjetas agregadas */
.qty.big { display: flex; width: 100%; border-radius: 12px; }
.qty.big button { flex: 0 0 42px; height: 40px; font-size: 1.3rem; }
.qty.big input { flex: 1; width: auto; min-width: 0; height: 40px; font-size: 1rem; }
.qty.sm button { width: 30px; height: 32px; font-size: 1rem; }
.qty.sm input { width: 36px; height: 32px; font-size: .9rem; }

/* Panel de cotización (columna derecha fija en PC) */
.cartpanel {
  position: sticky; top: 76px; align-self: start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; overflow: hidden;
  max-height: calc(100vh - 96px);
}
.cp-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.cp-head h2 { font-size: 1.05rem; }
.cp-close { display: none; height: 36px; min-width: 36px; padding: 0 10px; }
.cp-body { flex: 1; overflow-y: auto; padding: 4px 14px; }
.cp-foot { border-top: 1px solid var(--border); padding: 14px; background: var(--surface-2); }
.cp-empty { padding: 44px 16px; }

/* Barra superior del carrito (contador + Vaciar) */
.cart-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 4px; font-size: .8rem; color: var(--muted); }
.link-clear { background: none; border: none; color: var(--danger); font-size: .8rem; font-weight: 600; padding: 2px 4px; cursor: pointer; }
.link-clear:hover { text-decoration: underline; }

/* Línea del panel */
.line {
  display: grid; grid-template-columns: 1fr auto auto;
  grid-template-areas: "main price x" "qty qty qty"; gap: 8px 10px;
  padding: 12px 2px; border-bottom: 1px solid var(--border); align-items: center;
}
.line .lmain { grid-area: main; min-width: 0; }
.line .ldesc { font-weight: 600; font-size: .9rem; }
.line .lmeta { font-size: .76rem; color: var(--muted); }
.line .lprice { grid-area: price; font-weight: 700; text-align: right; white-space: nowrap; }
.line .line-x { grid-area: x; background: none; border: none; color: var(--muted); font-size: .9rem; line-height: 1; padding: 2px 4px; cursor: pointer; border-radius: 6px; }
.line .line-x:hover { color: var(--danger); background: var(--surface-2); }
.line .qty.sm { grid-area: qty; justify-self: start; }

/* Barra inferior fija (móvil/tablet) */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: none;
  align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 22px rgba(15,25,45,.12);
}
.bottombar .bb-info { display: flex; flex-direction: column; line-height: 1.15; }
.bb-count { font-size: .74rem; color: var(--muted); }
.bb-total { font-family: var(--font-display); font-size: 1.18rem; }
.bottombar .btn { margin-left: auto; }

.hide-sm { }

/* ============================================================
   Catálogo en lista de líneas
   ============================================================ */
.plist {
  display: flex; flex-direction: column; margin-top: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.prow {
  display: grid;
  grid-template-columns: 44px 1fr auto 124px;
  grid-template-areas: "thumb info price action";
  align-items: center; gap: 14px; min-height: 62px;
  padding: 8px 14px; border-bottom: 1px solid var(--border); transition: background .12s;
}
.prow:last-child { border-bottom: none; }
.prow:hover { background: var(--surface-2); }
.prow.in-cart { background: color-mix(in srgb, var(--brand-soft) 55%, transparent); box-shadow: inset 3px 0 0 var(--brand); }
.pthumb {
  grid-area: thumb; width: 44px; height: 44px; border-radius: 12px; line-height: 1;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 21px;
}
.pinfo { grid-area: info; min-width: 0; }
.pname { font-weight: 600; font-size: .92rem; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmeta { font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: 7px; flex-wrap: nowrap; margin-top: 2px; }
.pmeta .mtext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pstock { flex: 0 0 auto; }
.pprice { grid-area: price; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; text-align: right; white-space: nowrap; }
.pprice small { font-size: .62rem; color: var(--muted); font-weight: 600; margin-left: 3px; }
.paction { grid-area: action; display: flex; justify-content: flex-end; }
.paction .btn.add { width: 100%; padding: 8px 8px; font-size: .82rem; border-radius: 10px; }
.paction .qty.big { width: 100%; }
.paction .qty.big button { flex: 0 0 36px; height: 36px; font-size: 1.2rem; }
.paction .qty.big input { height: 36px; font-size: .95rem; }

/* Estado de stock: punto de color + texto neutro (integra con el tema) */
.pstock { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.sdot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.sdot.s-alto { background: #22c55e; }
.sdot.s-medio { background: #f0b429; }
.sdot.s-bajo { background: #f08c3c; }
.sdot.s-nulo { background: var(--border-strong); }

.skrow { height: 56px; border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.skrow::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--border) 60%, transparent), transparent); animation: sh 1.2s infinite; }

/* ---------- Responsive ---------- */
@media (max-width: 1079px) {
  .shop { grid-template-columns: 1fr; gap: 12px; }
  /* Categorías pasan a fila horizontal (estilo kiosco) */
  .cats {
    position: sticky; top: 60px; z-index: 30;
    flex-direction: row; gap: 6px; overflow-x: auto; max-height: none; padding: 8px;
  }
  .cat { flex: 0 0 auto; width: auto; flex-direction: column; min-width: 74px; gap: 4px; padding: 8px 6px; text-align: center; font-size: .72rem; }
  .cat-ico { width: auto; font-size: 1.35rem; }
  .cat-lbl { max-width: 72px; }
  /* Panel pasa a hoja inferior */
  .cartpanel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%;
    max-height: 86vh; border-radius: 20px 20px 0 0; z-index: 60;
    transform: translateY(100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
  }
  .cartpanel.open { transform: translateY(0); }
  .cp-close { display: inline-flex; }
  .bottombar:not([hidden]) { display: flex; }
  body.kiosk { padding-bottom: 74px; }
}

@media (max-width: 640px) {
  .header-top { flex-wrap: wrap; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .row2 { grid-template-columns: 1fr; }
  .brand small { display: none; }
  .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .prow {
    grid-template-columns: 44px 1fr auto;
    grid-template-areas: "thumb info info" "thumb price action";
    gap: 6px 12px; padding: 10px 14px; min-height: 0;
  }
  .pthumb { align-self: center; }
  .pprice { text-align: left; align-self: center; }
  .paction { width: 124px; }
}

/* ============================================================
   Chat del cliente (burbuja flotante)
   ============================================================ */
.chatw { position: fixed; right: 20px; bottom: 20px; z-index: 70; }
.chatw-fab {
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 24px; box-shadow: var(--shadow-lg);
  display: grid; place-items: center; position: relative; transition: transform .12s, background .15s;
}
.chatw-fab:hover { background: var(--brand-600); transform: translateY(-2px); }
.chatw-badge {
  position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--surface);
}
.chatw-badge[hidden] { display: none; }
.chatw-win {
  position: absolute; right: 0; bottom: 70px; width: 360px; max-width: calc(100vw - 32px); height: 480px; max-height: calc(100vh - 120px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(12px) scale(.98); pointer-events: none; transition: opacity .18s, transform .18s;
}
.chatw-win.open { opacity: 1; transform: none; pointer-events: auto; }
.chatw-head { background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.chatw-head small { display: block; opacity: .85; font-size: .72rem; }
.chatw-x { background: rgba(255,255,255,.18); border: none; color: #fff; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.chatw-x:hover { background: rgba(255,255,255,.3); }
.chatw-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.chatw-msg { max-width: 82%; display: flex; flex-direction: column; }
.chatw-msg .b { padding: 9px 12px; border-radius: 14px; font-size: .9rem; line-height: 1.35; word-wrap: break-word; white-space: pre-wrap; }
.chatw-msg time { font-size: .62rem; color: var(--muted); margin: 2px 4px 0; }
.chatw-msg.out { align-self: flex-end; align-items: flex-end; }
.chatw-msg.out .b { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chatw-msg.in, .chatw-msg.bot { align-self: flex-start; }
.chatw-msg.in .b, .chatw-msg.bot .b { background: var(--surface); border: 1px solid var(--border); color: var(--ink); border-bottom-left-radius: 4px; }
.chatw-foot { border-top: 1px solid var(--border); padding: 10px; background: var(--surface); }
.chatw-name { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; font-size: .82rem; margin-bottom: 8px; background: var(--surface); color: var(--ink); }
.chatw-foot.named .chatw-name { display: none; }
.chatw-inrow { display: flex; gap: 8px; align-items: flex-end; }
.chatw-inrow textarea { flex: 1; border: 1px solid var(--border-strong); border-radius: 12px; padding: 9px 12px; font-size: .9rem; resize: none; background: var(--surface); color: var(--ink); font-family: inherit; max-height: 90px; }
.chatw-inrow textarea:focus { outline: none; border-color: var(--brand); }
.chatw-send { width: 40px; height: 40px; flex: 0 0 40px; border: none; border-radius: 12px; background: var(--brand); color: #fff; font-size: 1rem; cursor: pointer; }
.chatw-send:hover { background: var(--brand-600); }
@media (max-width: 1079px) { .chatw { bottom: 80px; } }
@media (max-width: 640px) { .chatw { right: 14px; bottom: 76px; } .chatw-win { bottom: 68px; } }
