:root {
  --red: #e11d37;
  --red-dark: #b3142b;
  --ink: #141414;
  --ink-2: #333;
  --muted: #66707a;
  --line: #e4e6ea;
  --bg: #f3f4f6;
  --card: #fff;
  --header: #111113;
  --header-text: #fff;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(15, 18, 22, .12);
  --max: 1280px;
  --side: 280px;
  --bar: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --font: "Segoe UI", "Source Sans 3", "Noto Sans", "DejaVu Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--red); color: #fff;
  padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--header); color: var(--header-text);
  padding-top: var(--safe-top);
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.topbar-inner {
  max-width: calc(var(--max) + var(--side));
  margin: 0 auto;
  height: var(--bar);
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
}
.icon-btn {
  background: transparent; border: 0; color: inherit;
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center; flex: 0 0 auto;
}
.icon-btn:hover, .icon-btn:focus-visible { background: rgba(255,255,255,.1); outline: none; }
.menu-icon, .menu-icon:before, .menu-icon:after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px;
  position: relative; content: "";
}
.menu-icon:before { position: absolute; top: -6px; }
.menu-icon:after { position: absolute; top: 6px; }
.menu-btn { display: none !important; }

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex: 0 0 auto; padding-right: 4px;
  min-width: 0;
}
.brand-mark {
  position: relative;
  display: block;
  height: 40px;
  width: calc(40px * 400 / 102);
  flex: 0 0 auto;
}
.brand-logo, .brand-video {
  height: 40px; width: auto; display: block;
  max-height: 100%;
}
.brand-video {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  object-fit: contain; object-position: left center;
  background: transparent;
  opacity: 0;
  transition: opacity .7s ease;
}
.brand-video.is-on { opacity: 1; }
.brand-sub {
  font-size: .72rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: #c8c8c8; line-height: 1;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .brand-video { display: none !important; }
}
.scan-btn { color: #fff; }
.scan-btn:hover, .scan-btn:focus-visible { background: rgba(255,255,255,.1); }

.search {
  flex: 1 1 auto; display: flex; align-items: center;
  background: #1e1e22; border: 1px solid #2c2c32; border-radius: 999px;
  min-width: 0; height: 42px; padding: 0 4px 0 14px;
}
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  color: #fff; outline: none; height: 40px;
}
.search input::placeholder { color: #8b8b93; }
.search-go { color: #ddd; width: 36px; height: 36px; }

.cart-btn {
  position: relative; background: var(--red); color: #fff; border: 0;
  height: 42px; min-width: 42px; padding: 0 12px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-btn:hover { background: var(--red-dark); }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  background: #fff; color: var(--red); font-size: 11px; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 99px;
  display: grid; place-items: center; padding: 0 4px;
}

.demo-banner {
  background: #fff3cd; color: #5c4a12; font-size: .8rem;
  text-align: center; padding: 6px 12px; border-bottom: 1px solid #efe0a8;
}

/* Layout */
.layout {
  flex: 1; display: grid;
  grid-template-columns: var(--side) 1fr;
  max-width: calc(var(--max) + var(--side));
  margin: 0 auto; width: 100%;
  align-items: start;
}
.sidebar {
  position: sticky; top: calc(var(--bar) + 29px);
  height: calc(100vh - var(--bar) - 29px);
  overflow: auto; background: #fff;
  border-right: 1px solid var(--line); padding: 16px 10px 32px;
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 10px 12px;
}
.close-side { display: none; color: var(--ink); font-size: 1.6rem; }
.cat-nav { display: flex; flex-direction: column; gap: 2px; }
.cat-btn {
  display: flex; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-size: .92rem;
}
.cat-btn:hover, .cat-btn:focus-visible { background: #f3f4f6; }
.cat-btn.active { background: #fde8eb; color: var(--red-dark); font-weight: 700; }
.cat-btn .n { color: var(--muted); font-size: .78rem; font-weight: 600; }
.cat-btn.active .n { color: var(--red); }

.main { padding: 16px 20px 48px; min-width: 0; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin-bottom: 14px;
}
.filters { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: .9rem; cursor: pointer; user-select: none;
}
.chip:has(input:checked) { border-color: var(--red); background: #fde8eb; color: var(--red-dark); font-weight: 650; }
.chip input { accent-color: var(--red); }
.result-meta { margin: 0 0 0 auto; color: var(--muted); font-size: .88rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: #d0d3d8; }
.card-img {
  aspect-ratio: 1; background: #fafafa; display: grid; place-items: center;
  padding: 10px; position: relative;
}
.card-img img {
  width: 100%; height: 100%; object-fit: contain;
}
.ph {
  width: 64%; height: 64%; background:
    repeating-linear-gradient(-45deg, #eee, #eee 8px, #f6f6f6 8px, #f6f6f6 16px);
  border-radius: 8px;
}
.badges { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.badge {
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 999px; color: #fff;
}
.badge-a { background: var(--red); }
.badge-n { background: #0f7a4a; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sku { font-size: .75rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.card h3 {
  margin: 0; font-size: .95rem; line-height: 1.3; font-weight: 650;
  min-height: 2.5em;
}
.price { margin-top: auto; padding-top: 6px; }
.price-now { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.price-vat { font-size: .82rem; color: var(--muted); }
.price-box { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.price-note { font-size: .7rem; color: var(--muted); }
.card-actions {
  display: flex; gap: 8px; align-items: center; margin-top: 8px;
}
.qty {
  width: 72px; height: 38px; border: 1px solid var(--line); border-radius: 8px;
  text-align: center; padding: 0 6px; background: #fff;
}
.add {
  flex: 1; height: 38px; border: 0; border-radius: 8px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: .88rem;
}
.add:hover { background: #000; }
.add:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }

/* Cart drawer */
.drawer, .modal {
  position: fixed; inset: 0; z-index: 60;
}
.drawer {
  left: auto; width: min(420px, 100%); background: #fff;
  box-shadow: -8px 0 32px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
}
.drawer-head, .modal-card .drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.drawer-head h2, .modal-card h2 { margin: 0; font-size: 1.1rem; }
.drawer-head .icon-btn, .modal-card .icon-btn { color: var(--ink); font-size: 1.6rem; }
.drawer-body { flex: 1; overflow: auto; padding: 12px 16px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 14px 16px 18px; background: #fff; }
.cart-line {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center;
}
.cart-line img { width: 56px; height: 56px; object-fit: contain; background: #fafafa; border-radius: 8px; }
.cart-line h4 { margin: 0 0 2px; font-size: .88rem; }
.cart-line .meta { color: var(--muted); font-size: .78rem; }
.line-total { font-weight: 700; }
.remove { border: 0; background: none; color: var(--red); font-size: .78rem; padding: 0; }
.totals { margin: 0 0 12px; }
.totals .row { display: flex; justify-content: space-between; margin: 4px 0; }
.totals .grand { font-size: 1.1rem; font-weight: 800; margin-top: 8px; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.btn {
  display: inline-flex; justify-content: center; align-items: center;
  height: 44px; border-radius: 10px; font-weight: 700; text-decoration: none; border: 0;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: #f3f4f6; color: var(--ink); }
.cart-empty { color: var(--muted); text-align: center; padding: 32px 8px; }

.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50;
}

/* Settings modal */
.modal {
  display: grid; place-items: center; background: rgba(0,0,0,.4);
}
.modal[hidden], .drawer[hidden], .backdrop[hidden] { display: none !important; }
.modal-card {
  width: min(420px, calc(100% - 24px)); background: #fff; border-radius: 16px;
  box-shadow: var(--shadow);
}
.modal-body { padding: 16px 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 650; }
.field-row { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.field-row input {
  width: 100px; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
}
.check { display: flex; align-items: center; gap: 8px; }
.hint { margin: 0; font-size: .82rem; color: var(--muted); }

.site-foot {
  background: #fff; border-top: 1px solid var(--line);
  padding: 18px 20px 28px; color: var(--ink-2); font-size: .85rem; line-height: 1.5;
  text-align: center;
}

/* Mobile */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar, .close-side { display: none !important; }
  .brand { flex-direction: column; align-items: flex-start; gap: 1px; padding-right: 2px; }
  .brand-mark { height: 28px; width: calc(28px * 400 / 102); }
  .brand-logo, .brand-video { height: 28px; }
  .brand-sub { display: block; font-size: .52rem; letter-spacing: .12em; }
  .main { padding: 8px 10px 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card h3 { font-size: .86rem; min-height: 2.4em; }
  .price-now { font-size: 1rem; }
  .topbar-inner { gap: 6px; padding: 0 8px; }
  .search { height: 38px; padding-left: 10px; flex: 1 1 auto; min-width: 0; }
  .search input { font-size: .86rem; min-width: 0; }
  .search input::placeholder { font-size: .78rem; }
  .search-go { display: none; }
  .filters { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .chip, .filters .chip-btn { flex: 0 0 auto; }
  .result-meta { margin-left: 0; width: 100%; }
  .drawer { width: 100%; }
  .toolbar { position: sticky; top: calc(var(--bar) + var(--safe-top)); z-index: 25;
    background: var(--bg); padding: 6px 0 4px; margin: 0 0 6px; }
  .cat-chips { display: flex; }
}
@media (max-width: 400px) {
  .qty { width: 58px; }
  .icon-btn, .scan-btn { width: 38px; height: 38px; }
  .cart-btn { min-width: 38px; height: 38px; padding: 0 8px; }
}

/* Animated logo splash (once per session) */
.splash {
  position: fixed; inset: 0; z-index: 80;
  background: #050505; display: grid; place-items: center;
}
.splash[hidden] { display: none !important; }
.splash video {
  width: min(920px, 100%); height: min(520px, 100%);
  object-fit: contain; background: #000;
}
.splash-skip {
  position: absolute; right: 16px; bottom: 16px;
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 8px 16px; font-weight: 650; letter-spacing: .04em;
  text-transform: uppercase; font-size: .75rem;
}
.splash-skip:hover, .splash-skip:focus-visible { background: var(--red); border-color: var(--red); outline: none; }
@media (max-width: 860px) {
  .splash { display: none !important; }
}

/* Sticky category chips (mobile; also usable as a compact row) */
.cat-chips {
  display: none;
  gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 0 10px; margin: 0 0 6px;
  scrollbar-width: none;
  position: sticky; top: calc(var(--bar) + var(--safe-top) + 52px);
  z-index: 24; background: var(--bg);
}
@media (max-width: 860px) {
  .cat-chips { display: flex; }
}
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chips .chip-btn {
  flex: 0 0 auto; white-space: nowrap;
}
.chip-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 12px; font-size: .9rem; cursor: pointer;
}
.chip-btn.active, .chip-btn[aria-pressed="true"] {
  border-color: var(--red); background: #fde8eb; color: var(--red-dark); font-weight: 650;
}
.card { cursor: pointer; }
.card-actions { cursor: default; }

/* 1-column large cards */
.grid.grid-large {
  grid-template-columns: 1fr !important;
}
.grid.grid-large .card {
  flex-direction: row; align-items: stretch;
}
.grid.grid-large .card-img {
  width: 44%; min-width: 140px; aspect-ratio: 1; flex: 0 0 44%;
}
.grid.grid-large .card-body { padding: 14px 16px; }
.grid.grid-large .card h3 { font-size: 1.15rem; min-height: 0; }
.grid.grid-large .price-now { font-size: 1.45rem; }
@media (max-width: 860px) {
  .grid.grid-large .card { flex-direction: column; }
  .grid.grid-large .card-img { width: 100%; flex-basis: auto; aspect-ratio: 1.05; min-height: 220px; }
}

/* Showroom / prezentacija */
body.mode-showroom .demo-banner,
body.mode-showroom .site-foot { display: none; }
body.mode-showroom .card-img { background: #fff; }
body.mode-showroom.hide-prices .price,
body.mode-showroom.hide-prices .pv-price { visibility: hidden; }
body.mode-showroom .toolbar { top: calc(var(--bar) + var(--safe-top)); }

/* Full-screen product view */
.product-view {
  position: fixed; inset: 0; z-index: 70;
  background: #fff; display: flex; flex-direction: column;
  padding-top: var(--safe-top);
}
.product-view[hidden] { display: none !important; }
.pv-close {
  position: absolute; top: calc(8px + var(--safe-top)); right: 8px;
  z-index: 2; background: rgba(0,0,0,.55); color: #fff; font-size: 1.6rem;
  width: 44px; height: 44px; border-radius: 50%;
}
.pv-nav {
  position: absolute; top: 28%; z-index: 2;
  width: 44px; height: 64px; border: 0; border-radius: 12px;
  background: rgba(0,0,0,.4); color: #fff; font-size: 2rem; line-height: 1;
}
.pv-prev { left: 6px; }
.pv-next { right: 6px; }
.pv-stage {
  flex: 1 1 auto; min-height: 42vh; max-height: 58vh;
  display: grid; place-items: center; background: #f6f6f6; touch-action: pan-y;
}
.pv-stage img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.pv-body { padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.pv-info h1 { margin: 0 0 6px; font-size: 1.25rem; line-height: 1.3; }
.pv-meta { color: var(--muted); font-size: .92rem; margin: 0 0 8px; }
.pv-info .price-now { font-size: 1.7rem; }
.pv-counter { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: .85rem; }
.pv-actions { display: flex; gap: 8px; margin-top: 12px; }
.pv-actions .qty { height: 46px; width: 80px; }
.pv-actions .add { height: 46px; font-size: 1rem; }

/* Barcode scanner */
.scanner {
  position: fixed; inset: 0; z-index: 75;
  background: rgba(0,0,0,.55); display: grid; place-items: end center;
  padding: 12px;
}
.scanner[hidden] { display: none !important; }
.scanner-card {
  width: min(520px, 100%); background: #fff; border-radius: 16px 16px 12px 12px;
  overflow: hidden; box-shadow: var(--shadow);
  margin-bottom: env(safe-area-inset-bottom, 0px);
}
.scanner-view {
  position: relative; background: #000; aspect-ratio: 4/3;
}
.scanner-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame {
  position: absolute; inset: 18% 12%;
  border: 2px solid #fff; border-radius: 12px; box-shadow: 0 0 0 80px rgba(0,0,0,.25);
  pointer-events: none;
}
.scanner-tools { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.scanner-msg { margin: 0; font-weight: 650; min-height: 1.3em; }
.scanner-msg.ok { color: #0f7a4a; }
.scanner-msg.err { color: var(--red); }
@media (min-width: 861px) {
  .scanner { place-items: center; }
  .scanner-card { border-radius: 16px; }
}

[hidden] { display: none !important; }

/* Compact mobile list */
.grid.grid-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.grid.grid-list .card {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 0;
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  min-height: 0;
}
.grid.grid-list .card-img {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  aspect-ratio: auto;
  min-height: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.grid.grid-list .card-img img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  padding: 2px;
}
.grid.grid-list .badges {
  top: 2px; left: 2px; gap: 2px;
}
.grid.grid-list .badge {
  font-size: .55rem; padding: 1px 4px;
}
.grid.grid-list .card-body {
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title price"
    "sku   actions";
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.grid.grid-list .card h3 {
  grid-area: title;
  font-size: .86rem;
  line-height: 1.25;
  min-height: 0;
  max-height: 2.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
}
.grid.grid-list .sku {
  grid-area: sku;
  font-size: .7rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grid.grid-list .price {
  grid-area: price;
  margin: 0;
  padding: 0;
  text-align: right;
  align-self: start;
}
.grid.grid-list .price-now {
  font-size: .82rem;
  font-weight: 600;
  color: #3a3a3a;
  letter-spacing: 0;
}
.grid.grid-list .card-family .price-now { font-weight: 550; color: #4a4a4a; }
.grid.grid-list .price-note,
.grid.grid-list .price-vat,
.grid.grid-list .price-box { display: none; }
.grid.grid-list .card-actions {
  grid-area: actions;
  margin: 0;
  justify-content: flex-end;
  gap: 6px;
}
.grid.grid-list .qty {
  height: 32px;
  width: 50px;
  font-size: .85rem;
}
.grid.grid-list .add {
  height: 32px;
  font-size: .78rem;
  padding: 0 8px;
  white-space: nowrap;
}
@media (min-width: 861px) {
  .grid.grid-list { max-width: 720px; }
}

/* Family cards */
.card-family { cursor: pointer; }
.card-family .sku { color: var(--red-dark); font-weight: 650; }

/* Family sheet */
.family-view {
  position: fixed; inset: 0; z-index: 72;
  background: #fff; display: flex; flex-direction: column;
  padding-top: var(--safe-top);
}
.family-view[hidden] { display: none !important; }
.fv-top {
  position: relative;
  padding: 12px 52px 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.fv-close {
  position: absolute; top: 8px; right: 8px;
  width: 44px; height: 44px; font-size: 1.6rem;
}
.fv-hero { display: flex; gap: 12px; align-items: center; }
.fv-hero img {
  width: 88px; height: 88px; object-fit: contain; flex: 0 0 88px;
  background: #f6f6f6; border-radius: 10px;
}
.fv-hero h1 { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.25; }
.fv-meta { margin: 0; color: var(--muted); font-size: .9rem; }
.fv-list { flex: 1; overflow: auto; padding: 0 0 calc(16px + env(safe-area-inset-bottom, 0px)); }
.fv-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "spec prices"
    "codes prices"
    "actions actions";
  gap: 2px 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.fv-row.is-hit { background: #fde8eb; outline: 2px solid var(--red); outline-offset: -2px; }
.fv-spec { grid-area: spec; font-weight: 650; font-size: .95rem; }
.fv-codes { grid-area: codes; color: var(--muted); font-size: .78rem; }
.fv-prices { grid-area: prices; text-align: right; }
.fv-prices .price-now { font-size: .95rem; font-weight: 650; }
.fv-prices .price-box { font-size: .72rem; color: var(--muted); }
.fv-actions { grid-area: actions; margin-top: 6px; justify-content: flex-end; }
.fv-actions .qty { height: 34px; width: 56px; }
.fv-actions .add { height: 34px; font-size: .8rem; padding: 0 10px; }

/* Assistant — bottom-right, below header controls */
.assist {
  position: fixed;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  pointer-events: none;
}
.assist-fab, .assist-teaser, .assist-panel { pointer-events: auto; }
.assist-fab {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 999px;
  background: var(--red); color: #fff;
  padding: 8px 12px 8px 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  font-weight: 650; font-size: .85rem;
  cursor: pointer;
}
.assist-fab-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: grid; place-items: center; font-size: 1rem; font-weight: 800;
}
.assist-teaser {
  width: min(260px, calc(100vw - 24px));
  background: #fff; color: var(--ink);
  border-radius: 14px; padding: 12px 12px 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  animation: assist-pop .45s ease;
}
.assist-teaser p { margin: 0 0 8px; font-size: .92rem; }
.assist-teaser-actions { display: flex; gap: 6px; align-items: center; }
.assist-teaser .btn { height: 36px; font-size: .82rem; }
@keyframes assist-pop {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.assist-panel {
  position: fixed;
  right: 12px;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 16px));
  max-height: min(70vh, 560px);
  background: #fff; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 46;
}
.assist-panel[hidden] { display: none !important; }
.assist-chips {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px;
  scrollbar-width: none; border-bottom: 1px solid var(--line);
}
.assist-chips::-webkit-scrollbar { display: none; }
.assist-log { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.assist-msg { max-width: 100%; font-size: .9rem; }
.assist-msg.bot { background: #f4f4f6; border-radius: 12px 12px 12px 4px; padding: 8px 10px; }
.assist-msg.user { align-self: flex-end; background: #fde8eb; border-radius: 12px 12px 4px 12px; padding: 8px 10px; }
.assist-hits { display: flex; flex-direction: column; gap: 0; margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.assist-hit {
  display: flex; gap: 8px; align-items: center;
  padding: 8px; border-top: 1px solid var(--line);
  cursor: pointer; text-align: left; background: #fff;
  border-left: 0; border-right: 0; border-bottom: 0; width: 100%;
}
.assist-hits .assist-hit:first-child { border-top: 0; }
.assist-hit img { width: 48px; height: 48px; object-fit: contain; flex: 0 0 48px; }
.assist-hit-body { flex: 1; min-width: 0; }
.assist-hit .nm { font-weight: 650; font-size: .82rem; line-height: 1.2; }
.assist-hit .meta { font-size: .72rem; color: var(--muted); }
.assist-hit .pr { font-size: .8rem; font-weight: 600; }
.assist-hit .add { height: 32px; font-size: .72rem; padding: 0 8px; flex: 0 0 auto; }
.assist-form { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
.assist-form input {
  flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
}
.assist-note { margin: 0; padding: 0 12px 8px; font-size: .7rem; color: var(--muted); }
@media (max-width: 860px) {
  .assist-fab-label { display: none; }
  .assist-fab { padding: 8px; }
  .assist-panel {
    right: 8px; left: 8px; width: auto;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- B2B demo ---------- */
.shop-bar {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  max-width: calc(var(--max) + var(--side));
  margin: 0 auto; width: 100%;
}
.shop-current {
  flex: 1; min-width: 0; text-align: left;
  background: none; border: 0; padding: 4px 0;
  display: flex; flex-direction: column; gap: 1px;
}
.shop-name { font-weight: 700; font-size: .95rem; }
.shop-meta { color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-tools-btn { height: 36px; padding: 0 12px; flex: 0 0 auto; font-size: .85rem; }

.promo-banner {
  background: #fde8eb; color: #7a1020;
  border-bottom: 1px solid #f5c5cc;
  text-align: center;
}
.promo-link {
  background: none; border: 0; color: inherit;
  width: 100%; padding: 8px 12px; font-weight: 700; font-size: .85rem;
  text-align: center;
}
.season-banner {
  background: #eef6ff; color: #1d3a5c;
  border-bottom: 1px solid #cfe0f4;
  padding: 8px 12px;
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
}
.season-text { font-size: .85rem; flex: 1 1 200px; }
.season-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.season-acts .btn { height: 34px; padding: 0 10px; font-size: .8rem; }

.price-was { color: var(--muted); font-weight: 500; margin-right: 6px; }
.price-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 4px; }
.price-tags span {
  font-size: .68rem; font-weight: 600; color: #7a1020;
  background: #fde8eb; border-radius: 999px; padding: 1px 7px;
}
.stock-wrap { margin: 2px 0 4px; }
.stock-pill {
  display: inline-block; font-size: .7rem; font-weight: 600;
  border-radius: 999px; padding: 2px 7px;
}
.stock-pill em { font-style: normal; font-weight: 500; opacity: .75; }
.stock-pill.is-ok { background: #e7f6ea; color: #1c6b2e; }
.stock-pill.is-wait { background: #fff4dd; color: #8a5a00; }
.carton-tog {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .75rem; color: var(--ink-2); font-weight: 600;
  white-space: nowrap; margin-top: 2px;
}
.carton-tog input { accent-color: var(--red); }
.carton-hint { color: #8a5a00; font-size: .75rem; margin: 4px 0 2px; }
.card-actions .carton-tog { width: 100%; }

.linkish {
  background: none; border: 0; padding: 0; color: var(--red-dark);
  font-weight: 700; font-size: .8rem; text-decoration: underline;
  cursor: pointer; display: inline;
}
.shelf-links { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; }

.cart-b2b { margin-bottom: 12px; }
.cart-b2b-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.deliv { margin: 0 0 10px; }
.deliv-label { font-size: .8rem; color: var(--ink-2); margin-bottom: 6px; }
.deliv-bar { height: 8px; background: #eceef1; border-radius: 99px; overflow: hidden; }
.deliv-bar i { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.credit-box { font-size: .8rem; background: #f6f7f9; border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; }
.credit-box.is-over { background: #fde8eb; }
.credit-warn { color: #9b1226; display: block; margin-top: 6px; }

.example-note { font-size: .78rem; color: var(--muted); margin: 0 0 12px; }
.example-note.pad { padding: 0 16px 14px; }
.muted { color: var(--muted); }

.sheet {
  position: fixed; inset: 0; z-index: 77;
  background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet[hidden], .b2b-page[hidden], .b2b-toast[hidden] { display: none !important; }
.sheet-card {
  width: min(480px, 100%);
  max-height: min(86vh, 640px);
  background: #fff; border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sheet-body { overflow: auto; padding: 8px 16px 20px; }
.shop-pick, .tools-item {
  display: flex; flex-direction: column; gap: 2px;
  width: 100%; text-align: left; background: none;
  border: 0; border-bottom: 1px solid var(--line);
  padding: 12px 4px; font-size: .95rem;
}
.shop-pick span, .tools-item span { color: var(--muted); font-size: .8rem; }
.shop-pick.is-on { background: #fde8eb; margin: 0 -8px; padding-left: 12px; padding-right: 12px; border-radius: 8px; border-bottom-color: transparent; }

.b2b-page {
  position: fixed; inset: 0; z-index: 78;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: auto;
}
.b2b-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; padding-top: calc(10px + var(--safe-top));
  background: #fff; border-bottom: 1px solid var(--line);
}
.b2b-head h1 { margin: 0; font-size: 1.1rem; flex: 1; }
.b2b-head .icon-btn { color: var(--ink); font-size: 1.6rem; }
.b2b-body { padding: 14px 14px 80px; max-width: 720px; width: 100%; margin: 0 auto; }
body.b2b-page-open { overflow: hidden; }

.b2b-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin: 0 0 12px;
}
.b2b-card h3 { margin: 0 0 8px; font-size: 1rem; }
.b2b-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.b2b-acts .btn { padding: 0 12px; }
.field-label { display: block; font-weight: 700; font-size: .82rem; margin: 0 0 6px; }
textarea, #adminPin {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; background: #fff;
}
#adminPin { max-width: 200px; height: 44px; margin-bottom: 8px; }
.err { color: var(--red); font-size: .85rem; min-height: 1.2em; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.kv-list, .top-list, .season-list, .quick-list { list-style: none; margin: 0; padding: 0; }
.kv-list li, .top-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.season-list li, .quick-list li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.quick-list li.bad { color: #9b1226; }
.season-cal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.season-cal-item {
  background: #f6f7f9; border-radius: 10px; padding: 10px;
  display: flex; flex-direction: column; gap: 4px; font-size: .82rem;
}
.season-cal-item.is-on { background: #eef6ff; outline: 1px solid #8eb4d8; }
.order-d { border-bottom: 1px solid var(--line); padding: 8px 0; }
.order-d ul { margin: 8px 0; padding-left: 18px; font-size: .85rem; }
.inv-row, .proc-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.inv-amt, .proc-q { text-align: right; }
.inv-overdue { background: #fff6f6; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.promo-hero { background: #fde8eb; border-color: #f5c5cc; font-weight: 700; }
.news-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.news-item time { font-size: .75rem; color: var(--muted); }
.news-item h4 { margin: 2px 0 4px; }
.shelf-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.camp-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.camp-row p { margin: 2px 0; }

.b2b-toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 90; max-width: min(420px, calc(100% - 24px));
  background: #1b1c1e; color: #fff; border-radius: 10px;
  padding: 10px 14px; font-size: .85rem; box-shadow: var(--shadow);
}

@media (min-width: 861px) {
  .sheet { align-items: center; }
  .sheet-card { border-radius: 16px; }
  .season-cal { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 860px) {
  .grid.grid-list .card-actions .carton-tog { font-size: .7rem; }
  .assist { bottom: 16px; } /* keep clear of toast when possible */
}

@media (max-width: 860px) {
  .drawer-foot { max-height: 47%; overflow: auto; padding: 10px 12px 14px; }
  .drawer-body { min-height: 32%; }
  .drawer-foot .btn { height: 38px; font-size: .82rem; }
  .cart-b2b-acts, .drawer-foot .actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  }
  .cart-b2b-acts { margin-top: 8px; }
  .cart-b2b-acts #cartPdf { grid-column: 1 / -1; }
  .drawer-foot .example-note { margin: 6px 0 0; font-size: .72rem; }
  .credit-box { margin: 0 0 6px; padding: 6px 8px; }
  .deliv { margin: 0 0 8px; }
  .cart-line { align-items: start; padding: 8px 0; }
  .cart-line h4 { font-size: .84rem; }
}
