/* B-EASY — till layout. Loaded last.
   1. The order list always keeps a good share of the cart; the totals and
      payment part scrolls on its own when the screen is short.
   2. Categories: one row along the top on every screen, can be dragged into your own order.
   3. Product tiles are smaller, so more fit on the screen. */

/* ── 1. Order list room ─────────────────────────────────────── */
#cartList { flex: 1 1 auto; min-height: max(190px, 42%); }
#cartTotals { flex: 0 1 auto; padding-top: 12px !important; padding-bottom: 12px !important; }
#cartTotals > * + * { margin-top: 10px !important; }
#cartTotals #total { font-size: 28px !important; }
#cartTotals #payMethods > *, #cartTotals #cashCcy > * { min-height: 0 !important; height: 42px !important; padding-top: 0 !important; padding-bottom: 0 !important; }
#cartPanel #completeSale { height: 52px; }
#cartPanel #completeSale + *, #cartPanel .pb-4.pt-3 { padding-top: 10px; padding-bottom: 12px; }

/* ── 2. Categories: one row along the top on every screen (computer too, no
   side column). They wrap onto a second line instead of scrolling sideways,
   so every category is always visible. Press and hold a category, then drag
   it where you want it. ── */
#catalogBody { display: block !important; }
#categories, #categories.bx-rail {
  position: static !important; display: flex !important; flex-direction: row !important;
  flex-wrap: wrap !important; overflow: visible !important; max-height: none !important;
  gap: 8px !important; margin: 0 0 14px !important;
}
#categories .bx-chip, #categories.bx-rail .bx-chip {
  flex: 0 0 auto; width: auto !important; flex-direction: row !important; display: inline-flex !important;
  align-items: center; padding: 0 14px !important; height: 40px !important; gap: 8px !important;
  font-size: 13.5px !important; white-space: nowrap !important; border-radius: 999px !important;
}
#categories .bx-ico, #categories.bx-rail .bx-ico { width: 24px !important; height: 24px !important; font-size: 11px !important; flex: 0 0 auto; }
#categories .bx-chip { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#categories .bx-chip.cat-lift { transform: scale(1.06); box-shadow: 0 10px 26px -8px rgba(0,0,0,.8), 0 0 0 2px rgb(var(--brand, 201 168 106) / .7) !important; z-index: 5; position: relative; }
#categories.cat-dragging { cursor: grabbing; }

/* ── 3. Smaller product tiles ───────────────────────────────── */
#grid { gap: 10px !important; }
#grid > .tile { padding: 8px !important; }
#grid .bx-tile-ph { aspect-ratio: 4 / 3; margin-bottom: 6px !important; }
#grid .bx-price { font-size: 15px !important; }
@media (min-width: 560px) and (max-width: 1023.98px) { #grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }
@media (min-width: 1024px) { #grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (min-width: 1400px) { #grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }
@media (min-width: 1700px) { #grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; } }
@media (max-width: 559.98px) {
  #grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
  #grid > .tile { padding: 6px !important; border-radius: 14px !important; }
  #grid > .tile p.text-\[13\.5px\] { font-size: 12.5px !important; }
  #grid .bx-price { font-size: 14px !important; }
  #grid .tile .text-\[11px\] { font-size: 10px !important; }
}

/* Sales log: pick any From – To dates */
.log-dates{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;width:100%}
.log-dates label{display:flex;flex-direction:column;gap:4px;flex:1 1 130px;min-width:0}
.log-dates span{font-size:11.5px;color:rgba(255,255,255,.5)}
.log-dates input{height:40px;width:100%;background:#000;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:8px;padding:0 10px;font-size:16px;color:inherit;color-scheme:dark}
.log-dates button{flex:0 0 auto}
#logModal h3, #logModal #packBtn, #logModal #logMonth, #logModal #logRefresh{white-space:nowrap}
@media (max-width:420px){
  #logModal #logCount{display:none}
  #logModal h3 + span + #packBtn{margin-left:auto}
  #logModal h3{font-size:16px}
  #logModal #packBtn, #logModal #logMonth, #logModal #logRefresh{padding:0 7px;font-size:12px}
  #logModal #closeLog{flex:0 0 auto}
  #logModal [aria-label="Sales log"] > div:first-child{gap:6px;padding-left:14px;padding-right:12px}
}

/* Stock count: count here */
.sc-top{position:sticky;top:56px;z-index:1;background:rgb(18,18,23);padding-top:4px;padding-bottom:8px;margin:-4px 0 0}
.sc-row{display:flex;align-items:center;gap:8px;padding:8px 4px;border-bottom:1px solid rgba(255,255,255,.07)}
.sc-row.done{background:rgba(212,175,95,.06)}
.sc-pm{flex:0 0 auto;width:40px;height:40px;border-radius:10px;border:1px solid rgba(255,255,255,.14);font-size:20px;color:rgba(255,255,255,.8)}
.sc-num{flex:0 0 auto;width:64px;height:40px;border-radius:10px;background:#000;border:1px solid rgba(255,255,255,.18);text-align:center;font-size:16px;color:inherit;-moz-appearance:textfield}
.sc-num::-webkit-outer-spin-button,.sc-num::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.sc-row.done .sc-num{border-color:rgba(212,175,95,.6)}

/* Colour and size under the product name on each till card */
.be-var-wrap { margin-top:3px; min-width:0; }
.be-var { display:flex; align-items:center; gap:4px; margin:0; font-size:12px; line-height:1.35; color:var(--bx-mute, rgba(127,127,127,.9)); min-width:0; }
.be-var span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.be-sizes { font-weight:600; letter-spacing:.02em; }
.be-sw { flex:none; width:10px; height:10px; border-radius:50%; box-shadow:0 0 0 1px rgba(127,127,127,.45) inset; }

/* Stock › Select → Delete */
#stockTable.be-selecting [data-edit] { position:relative; padding-left:44px; }
#stockTable .be-tick { position:absolute; left:14px; top:50%; transform:translateY(-50%); width:20px; height:20px; border-radius:6px;
  border:2px solid rgba(127,127,127,.55); display:grid; place-items:center; }
#stockTable .be-picked { background:rgb(var(--brand) / .12) !important; }
#stockTable .be-picked .be-tick { background:rgb(var(--brand)); border-color:rgb(var(--brand)); }
#stockTable .be-picked .be-tick::after { content:""; width:6px; height:10px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg) translate(-1px,-1px); }
#beDelBar { position:fixed; z-index:45; left:50%; transform:translateX(-50%); bottom:calc(16px + env(safe-area-inset-bottom));
  display:flex; align-items:center; gap:6px; flex-wrap:nowrap; justify-content:center; width:max-content; max-width:calc(100vw - 24px);
  padding:10px 12px; border-radius:16px; background:var(--bx-surface, #211838); border:1px solid var(--bx-line, rgba(127,127,127,.25));
  box-shadow:0 12px 40px rgba(8,4,20,.35); }
#beDelBar .be-del-count { font-size:13.5px; font-weight:600; padding:0 4px; white-space:nowrap; }
#beDelBar button { flex:none; }
@media (max-width:420px){ #beDelBar { padding:8px; gap:4px; } #beDelBar .be-del-count { font-size:12.5px; } #beDelBar button { padding:0 10px; font-size:12.5px; } }
.be-del-btn { height:36px; padding:0 16px; border-radius:10px; background:#B4402A; color:#fff; font-weight:600; font-size:13.5px; white-space:nowrap; }
.be-del-btn.h-11 { height:44px; }
.be-del-btn:disabled { opacity:.4; cursor:not-allowed; }
.be-del-ghost { border:1px solid rgba(180,64,42,.5); color:#E07A63; background:transparent; }
html[data-theme=light] .be-del-ghost { color:#B4402A; }
.be-del-ghost:hover { background:rgba(180,64,42,.1); }
