/* Beriozka kassa (POS) — iPad-first. Draait op /pos/*-endpoints (device-sessie).
   Palet/opzet uit de kassa-demo; CSP-safe (geen inline styles). */

:root{
  --ink:#14110f; --paper:#faf8f5; --line:#e7e1d8; --muted:#8a8178;
  --accent:#14110f; --accent-fg:#fff; --ok:#2e7d54; --sale:#b23b2e;
  --card:#fff; --radius:14px;
}
*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0; background:var(--paper); color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased; overflow:hidden;
}
.hidden{ display:none !important; }

/* ── Activatie / losgekoppeld-scherm ── */
.pos-gate{ position:fixed; inset:0; display:flex; align-items:center; justify-content:center; padding:24px; background:var(--paper); z-index:40; }
.pos-gate-card{ background:var(--card); border:1px solid var(--line); border-radius:20px; width:min(460px,100%); padding:36px 30px; text-align:center; box-shadow:0 20px 50px rgba(20,17,15,.08); }
.pos-gate-card h1{ font-size:24px; margin:0 0 6px; }
.pos-gate-card p{ color:var(--muted); font-size:15px; margin:0 0 18px; }
.pos-gate-card input{ width:100%; border:1px solid var(--line); border-radius:10px; padding:13px 14px; font-size:15px; font-family:inherit; outline:none; margin-bottom:12px; }
.pos-gate-msg{ min-height:20px; font-size:14px; margin:6px 0 0; }
.pos-gate-msg.err{ color:var(--sale); }

/* ── Layout: catalogus | verkoop ── */
.pos{ display:grid; grid-template-columns:1fr clamp(340px, 32%, 420px); height:100vh; }
@media (max-width:820px){ .pos{ grid-template-columns:1fr; } .pos-sale{ display:none; } }

/* ── Catalogus ── */
.pos-catalog{ display:flex; flex-direction:column; min-height:0; padding:16px 16px 0; }
.pos-cat-head{ display:flex; align-items:center; gap:16px; margin-bottom:12px; }
.pos-brand{ font-size:22px; font-weight:600; color:var(--ink); white-space:nowrap; }
.pos-brand span{ color:var(--muted); font-size:13px; font-weight:400; margin-left:6px; }
/* Brand + kassa-id verticaal gestapeld: de id staat klein ONDER 'Beriozka · kassa'. */
.pos-brandwrap{ display:flex; flex-direction:column; gap:2px; }
.pos-devid{ color:var(--muted); font-size:11px; font-weight:400; letter-spacing:.03em; white-space:nowrap; }
.pos-devid:empty{ display:none; }
.pos-search{ flex:1; display:flex; align-items:center; gap:8px; background:var(--card); border:1px solid var(--line); border-radius:999px; padding:0 14px; }
.pos-search input{ flex:1; border:none; background:none; padding:11px 0; font-size:15px; font-family:inherit; outline:none; }

/* Afdelingstabs (Req 13): snelle grove navigatie boven het grid. Horizontaal scrollbaar
   op smal scherm; de actieve tab in accentkleur. */
.pos-tabs{ display:flex; gap:8px; margin-bottom:12px; overflow-x:auto; -webkit-overflow-scrolling:touch; padding-bottom:2px; }
.pos-tab{ flex:0 0 auto; border:1px solid var(--line); background:var(--card); color:var(--ink); font-family:inherit; font-size:14px; padding:8px 16px; border-radius:999px; cursor:pointer; white-space:nowrap; transition:background .12s ease, color .12s ease, border-color .12s ease; }
.pos-tab:hover{ border-color:var(--muted); }
.pos-tab.active{ background:var(--accent); color:var(--accent-fg); border-color:var(--accent); }

.pos-grid{ flex:1; overflow-y:auto; display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); grid-auto-rows:max-content; gap:14px; padding:4px 2px 18px; align-content:start; }
.pos-card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; cursor:pointer; text-align:left; padding:0; font-family:inherit; transition:transform .05s ease, box-shadow .15s ease; }
.pos-card:active{ transform:scale(.97); }
.pos-card:hover{ box-shadow:0 6px 18px rgba(20,17,15,.1); }
.pos-card-img{ position:relative; aspect-ratio:1/1; background:#f0ece6; }
.pos-card-img img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
/* Productloze tegel: nette placeholder i.p.v. een leeg vlak. */
.pos-card-img.noimg{ display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:11px; letter-spacing:.06em; text-transform:uppercase; }
.pos-card-badge{ position:absolute; top:8px; left:8px; background:var(--sale); color:#fff; font-size:11px; font-weight:600; padding:2px 7px; border-radius:999px; }
.pos-card-info{ padding:9px 10px 11px; }
.pos-card-name{ font-size:13px; line-height:1.25; margin:0 0 3px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:2.3em; }
.pos-card-sub{ font-size:11px; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); margin-bottom:3px; }
.pos-card-price{ font-size:14px; font-weight:600; }
.pos-card-price .was{ color:var(--muted); text-decoration:line-through; font-weight:400; margin-right:5px; font-size:12px; }
.pos-card-price .now{ color:var(--sale); }
.pos-card-out .pos-card-img{ opacity:.45; }
.pos-empty{ color:var(--muted); font-size:14px; text-align:center; margin:auto 0; }

/* ── Verkoop / mandje ── */
.pos-sale{ background:var(--card); border-left:1px solid var(--line); display:flex; flex-direction:column; min-height:0; padding:16px; }
.pos-sale-head{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:4px; }
.pos-sale-head h1{ font-size:22px; font-weight:600; margin:0; }
.pos-clear{ border:none; background:none; color:var(--muted); font-family:inherit; font-size:13px; cursor:pointer; text-decoration:underline; }
.pos-loc{ font-size:12px; color:var(--muted); margin:0 0 10px; }

.pos-lines{ list-style:none; margin:0; padding:0; flex:1; overflow-y:auto; }
.pos-line{ display:grid; grid-template-columns:1fr auto; gap:2px 10px; padding:11px 0; border-bottom:1px solid var(--line); }
.pos-line-name{ font-size:14px; }
.pos-line-sub{ font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.pos-line-price{ font-size:14px; font-weight:600; text-align:right; }
.pos-line-qty{ display:flex; align-items:center; gap:10px; margin-top:6px; }
.pos-qty-btn{ width:30px; height:30px; border:1px solid var(--line); background:var(--paper); border-radius:8px; font-size:18px; line-height:1; cursor:pointer; color:var(--ink); }
.pos-qty-val{ min-width:22px; text-align:center; font-size:15px; }
.pos-line-rm{ border:none; background:none; color:var(--muted); font-size:12px; cursor:pointer; text-decoration:underline; margin-left:auto; }

.pos-totals{ border-top:2px solid var(--ink); padding-top:12px; margin-top:4px; }
.pos-row{ display:flex; justify-content:space-between; font-size:15px; margin:5px 0; }
.pos-row-muted{ color:var(--muted); font-size:13px; }
.pos-row-total{ font-size:20px; font-weight:600; margin-top:8px; }

/* verkoper + klant regels boven de betaalknoppen */
.pos-meta{ display:grid; gap:8px; margin-top:12px; }
.pos-meta-row{ display:flex; align-items:center; gap:8px; font-size:13px; }
.pos-meta-row label{ color:var(--muted); flex:none; min-width:64px; }
.pos-meta-row select, .pos-meta-row input{ flex:1; border:1px solid var(--line); border-radius:8px; padding:8px 10px; font-size:14px; font-family:inherit; background:var(--card); outline:none; }
.pos-meta-cust{ font-size:13px; }
.pos-meta-cust .linked{ color:var(--ok); }
.pos-link-btn{ border:none; background:none; color:var(--ink); text-decoration:underline; font-size:13px; cursor:pointer; font-family:inherit; padding:0; }

.pos-pay{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }
.pos-btn{ padding:16px; font-size:16px; font-family:inherit; font-weight:600; border-radius:12px; border:1px solid transparent; cursor:pointer; }
.pos-btn:disabled{ opacity:.4; cursor:not-allowed; }
.pos-btn-primary{ background:var(--ink); color:#fff; }
.pos-btn-ghost{ background:var(--card); color:var(--ink); border-color:var(--line); }
.pos-btn-wide{ grid-column:1 / -1; }

/* ── Modal (betaling / bon / klant) ── */
.pos-modal{ position:fixed; inset:0; background:rgba(20,17,15,.55); display:flex; align-items:center; justify-content:center; z-index:60; padding:20px; }
.pos-modal-card{ background:var(--card); border-radius:20px; width:min(440px,100%); max-height:90vh; overflow-y:auto; padding:30px 26px; text-align:center; box-shadow:0 24px 60px rgba(0,0,0,.3); }
.pos-modal-icon{ width:64px; height:64px; margin:0 auto 16px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:30px; }
.pos-done{ background:#e6f2ec; color:var(--ok); }
.pos-modal h2{ font-size:24px; font-weight:600; margin:0 0 6px; }
.pos-modal p{ color:var(--muted); font-size:15px; margin:0 0 4px; }
.pos-modal-amount{ font-size:30px; font-weight:600; color:var(--ink); margin:10px 0 18px; }
.pos-modal-actions{ display:grid; gap:10px; margin-top:20px; }
.pos-modal-msg{ min-height:18px; font-size:13px; }
.pos-modal-msg.err{ color:var(--sale); }
.pos-ordernr{ font-size:13px; color:var(--muted); margin-top:8px; }
.pos-modal input{ width:100%; border:1px solid var(--line); border-radius:10px; padding:12px 13px; font-size:15px; font-family:inherit; outline:none; margin-bottom:10px; }
.pos-cust-hit{ display:flex; justify-content:space-between; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--line); font-size:14px; text-align:left; cursor:pointer; }
.pos-cust-hit:hover{ color:var(--accent); }

/* variant-picker (product met meerdere varianten) */
.pos-variants{ display:grid; gap:8px; text-align:left; margin-top:6px; }
.pos-variant{ display:flex; justify-content:space-between; align-items:center; gap:10px; border:1px solid var(--line); border-radius:10px; padding:12px 14px; background:var(--card); font-size:15px; font-family:inherit; cursor:pointer; }
.pos-variant:hover{ border-color:var(--ink); }
.pos-variant:disabled{ opacity:.4; cursor:not-allowed; }
.pos-variant .v-avail{ font-size:12px; color:var(--muted); }
/* Bon in een overlay op het kassascherm (afdrukken + terug naar kassa). */
.pos-receipt-ov{ position:fixed; inset:0; background:#fff; display:flex; flex-direction:column; z-index:70; }
.pos-receipt-bar{ display:flex; gap:10px; padding:12px 16px; border-bottom:1px solid #e6dfd6; background:var(--card); }
.pos-receipt-frame{ flex:1; width:100%; border:0; }
