/* ═══════════════════════════════════════════════════════════
   PIXEL BLACK RESTAURANT ERP — POS BILLING CSS
   Styles for the main billing / POS screen
   ═══════════════════════════════════════════════════════════ */

/* ── SHELL ── */
.pos-shell {
  display: flex;
  height: calc(100vh - var(--header-h) - 38px);
  overflow: hidden;
}

/* ════════════════ CATEGORY PANEL (Left) ════════════════ */
.cat-panel {
  width: var(--cat-w);
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.cat-panel-head {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cat-panel-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cat-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  transition: 0.15s;
  border-left: 3px solid transparent;
  position: relative;
}
.cat-item:hover {
  background: var(--bg);
  color: var(--t1);
}
.cat-item.active {
  background: var(--green-lt);
  border-left-color: var(--green);
  color: var(--green);
}
.cat-item-icon { font-size: 1rem; flex-shrink: 0; }
.cat-item-name { font-size: 0.75rem; font-weight: 600; flex: 1; line-height: 1.2; }
.cat-item-count {
  font-size: 0.58rem; font-weight: 700;
  background: var(--bg); color: var(--t4);
  border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 99px;
  min-width: 20px; text-align: center;
  flex-shrink: 0;
}
.cat-item.active .cat-item-count {
  background: var(--green-dim); color: var(--green); border-color: var(--green-glow);
}

.cat-panel-footer {
  padding: 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.cat-add-btn {
  width: 100%; height: 30px;
  background: var(--bg); border: 1px dashed var(--border-md);
  border-radius: var(--radius); color: var(--t3); font-size: 0.692rem;
  font-weight: 600; cursor: pointer; transition: 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.cat-add-btn:hover { border-color: var(--green); color: var(--green); background: var(--green-lt); }

/* ════════════════ PRODUCT AREA (Centre) ════════════════ */
.product-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--bg);
}

.product-toolbar {
  height: 44px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
}

.prod-search-wrap { flex: 1; max-width: 280px; position: relative; }
.prod-search {
  width: 100%; height: 28px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 0 8px 0 26px;
  font-size: 0.75rem; color: var(--t1);
  transition: 0.15s;
}
.prod-search:focus { border-color: var(--green); background: #fff; }
.prod-search::placeholder { color: var(--t4); }
.prod-search-icon { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--t4); }

.filter-pills { display: flex; gap: 4px; }
.filter-pill {
  height: 24px; padding: 0 10px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 0.65rem; font-weight: 600; color: var(--t3);
  cursor: pointer; transition: 0.15s; white-space: nowrap;
  display: flex; align-items: center; gap: 3px;
}
.filter-pill:hover { border-color: var(--green); color: var(--green); }
.filter-pill.active { background: var(--green); border-color: var(--green); color: #fff; }

.items-count {
  margin-left: auto;
  font-size: 0.65rem; color: var(--t4); font-weight: 500;
}

.product-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

/* ── PRODUCT CARD ── */
.prod-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 10px 0;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  user-select: none;
  box-shadow: var(--shadow-sm);
}
.prod-card:hover {
  border-color: var(--green);
  box-shadow: 0 4px 14px rgba(0,166,81,0.14);
  transform: translateY(-2px);
}
.prod-card:active { transform: scale(0.97) translateY(0); }
.prod-card.in-cart {
  border-color: var(--green);
  background: var(--green-lt);
}
.prod-card.oos {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.7);
}

/* Veg/Non-Veg indicator on card */
.prod-veg-ind {
  position: absolute;
  top: 8px; left: 8px;
}

/* Qty badge (top right) */
.prod-qty-badge {
  position: absolute;
  top: 6px; right: 6px;
  min-width: 20px; height: 20px; border-radius: 99px;
  background: var(--green); color: #fff;
  font-size: 0.62rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  opacity: 0; transform: scale(0.7);
  transition: 0.15s;
}
.prod-card.in-cart .prod-qty-badge { opacity: 1; transform: scale(1); }

.prod-emoji { font-size: 2.4rem; margin: 4px 0 8px; display: block; }
.prod-name {
  font-size: 0.72rem; font-weight: 700; color: var(--t1);
  line-height: 1.3; margin-bottom: 3px; width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.prod-price { font-size: 0.85rem; font-weight: 800; color: var(--green); margin-bottom: 3px; }
.prod-stock { font-size: 0.6rem; color: var(--t4); margin-bottom: 4px; }
.prod-stock.low { color: var(--gold); font-weight: 700; }
.prod-stock.oos-txt { color: var(--red); font-weight: 700; }

.prod-add-strip {
  width: calc(100% + 20px); margin: 0 -10px;
  padding: 6px 0;
  background: var(--green); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  text-align: center;
  transform: translateY(100%);
  transition: 0.15s;
}
.prod-card:hover .prod-add-strip { transform: translateY(0); }

/* Empty state */
.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--t4);
}
.grid-empty-icon { font-size: 2.5rem; margin-bottom: 10px; opacity: 0.5; }
.grid-empty-txt { font-size: 0.85rem; font-weight: 600; }

/* ════════════════ BILLING PANEL (Right) ════════════════ */
.bill-panel {
  width: var(--bill-w);
  background: #fff;
  border-left: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

/* Bill header */
.bill-header {
  background: var(--green);
  padding: 8px 10px;
  flex-shrink: 0;
}
.bill-header-row1 {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;
}
.bill-no { font-size: 0.9rem; font-weight: 800; color: #fff; }
.bill-actions { display: flex; gap: 5px; }
.bill-hdr-btn {
  height: 22px; padding: 0 8px;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3);
  border-radius: 5px; color: #fff; font-size: 0.6rem; font-weight: 700;
  cursor: pointer; transition: 0.15s;
}
.bill-hdr-btn:hover { background: rgba(255,255,255,0.28); }

.bill-header-row2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.bill-meta-item {
  background: rgba(0,0,0,0.12);
  border-radius: 5px; padding: 4px 8px;
  display: flex; flex-direction: column; gap: 1px;
}
.bmi-label { font-size: 0.58rem; color: rgba(255,255,255,0.65); text-transform: uppercase; letter-spacing: 0.4px; }
.bmi-val { font-size: 0.75rem; font-weight: 700; color: #fff; }

.bill-header-row3 {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 5px; margin-top: 5px;
}
.order-type-grp { display: flex; gap: 3px; }
.ot-btn {
  height: 24px; padding: 0 8px;
  border-radius: 5px; font-size: 0.65rem; font-weight: 700;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.75); cursor: pointer; transition: 0.15s;
}
.ot-btn.active { background: #fff; color: var(--green); border-color: #fff; }
.ot-btn:hover:not(.active) { background: rgba(255,255,255,0.22); color: #fff; }

/* Customer row */
.bill-cust-row {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 5px; flex-shrink: 0;
}

/* Order ledger (items) */
.bill-items-area {
  flex: 1; overflow-y: auto; min-height: 0;
}

.bill-ledger-head {
  display: grid;
  grid-template-columns: 20px 1fr 68px 60px 22px;
  gap: 4px;
  padding: 5px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 1;
}
.blh-cell {
  font-size: 0.58rem; font-weight: 700; color: var(--t3);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.blh-cell.right { text-align: right; }
.blh-cell.center { text-align: center; }

.bill-item-row {
  display: grid;
  grid-template-columns: 20px 1fr 68px 60px 22px;
  gap: 4px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: 0.1s;
}
.bill-item-row:hover { background: #FAFBFC; }
.bill-item-row:last-child { border-bottom: none; }

.bi-sno { font-size: 0.62rem; font-weight: 600; color: var(--t4); }
.bi-name-wrap { min-width: 0; }
.bi-name { font-size: 0.72rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bi-rate { font-size: 0.6rem; color: var(--t3); }

.bi-qty-ctrl { display: flex; align-items: center; gap: 3px; justify-content: center; }
.bi-qty-btn {
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--t2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: 0.12s; flex-shrink: 0;
}
.bi-qty-btn:hover { background: var(--green); border-color: var(--green); color: #fff; }
.bi-qty-num { font-size: 0.75rem; font-weight: 800; min-width: 18px; text-align: center; }

.bi-amt { font-size: 0.75rem; font-weight: 700; text-align: right; color: var(--t1); }
.bi-del {
  color: var(--red); font-size: 12px; cursor: pointer;
  opacity: 0.35; transition: 0.12s; text-align: center;
}
.bi-del:hover { opacity: 1; }

.bill-empty {
  text-align: center; padding: 30px 14px; color: var(--t4);
}
.bill-empty-icon { font-size: 2rem; opacity: 0.4; margin-bottom: 7px; }
.bill-empty-txt { font-size: 0.75rem; font-weight: 600; }
.bill-empty-sub { font-size: 0.65rem; margin-top: 3px; }

/* Discount row */
.bill-disc-row {
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.disc-label { font-size: 0.68rem; font-weight: 600; color: var(--t2); white-space: nowrap; }
.disc-in { flex: 1; height: 26px; border-radius: 5px; }
.disc-sel { height: 26px; width: 72px; border-radius: 5px; flex-shrink: 0; }

/* Totals */
.bill-totals {
  padding: 8px 10px;
  background: #FAFBFC;
  border-top: 1.5px solid var(--border);
  flex-shrink: 0;
}
.tot-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.72rem; margin-bottom: 4px; color: var(--t2);
}
.tot-row .tot-val { font-weight: 700; color: var(--t1); }
.tot-row.disc .tot-val { color: var(--green); }
.tot-row.roundoff .tot-val { color: var(--t3); }

.tot-grand-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 7px; margin-top: 4px;
  border-top: 1.5px dashed var(--border-md);
}
.tgr-label { font-size: 0.95rem; font-weight: 800; color: var(--t1); }
.tgr-val   { font-size: 1.1rem; font-weight: 900; color: var(--green); }

/* Cash tender */
.bill-cash-row {
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  background: var(--green-lt);
}
.cash-label { font-size: 0.68rem; font-weight: 700; color: var(--green); white-space: nowrap; }
.cash-in {
  flex: 1; height: 28px; border-radius: 6px;
  border: 1.5px solid var(--green); background: #fff;
  padding: 0 8px; font-size: 0.82rem; font-weight: 700; color: var(--t1);
}
.cash-in:focus { outline: none; border-color: var(--green-dk); }
.cash-balance { font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.cash-balance.give { color: var(--red); }
.cash-balance.change { color: var(--green); }

/* Payment Mode */
.bill-pay-row {
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  display: flex; gap: 5px; flex-shrink: 0;
}
.pm-btn {
  flex: 1; height: 30px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 0.65rem; font-weight: 700; color: var(--t3);
  cursor: pointer; transition: 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.pm-btn:hover { border-color: var(--green); color: var(--green); }
.pm-btn.active { background: var(--green); border-color: var(--green); color: #fff; }

/* Action buttons */
.bill-action-row {
  padding: 8px; border-top: 1.5px solid var(--border);
  display: flex; gap: 6px; flex-shrink: 0;
  background: #fff;
}
.action-hold {
  height: 38px; border-radius: 7px; padding: 0 10px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--t2); font-size: 0.72rem; font-weight: 700;
  cursor: pointer; transition: 0.15s;
  display: flex; align-items: center; gap: 4px;
}
.action-hold:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-lt); }

.action-kot {
  height: 38px; border-radius: 7px; padding: 0 10px;
  background: var(--orange-lt); border: 1.5px solid var(--orange);
  color: var(--orange); font-size: 0.75rem; font-weight: 700;
  cursor: pointer; transition: 0.15s;
  display: flex; align-items: center; gap: 4px; flex: 1;
}
.action-kot:hover { background: var(--orange); color: #fff; }

.action-settle {
  height: 38px; border-radius: 7px; padding: 0 14px;
  background: var(--green); border: none;
  color: #fff; font-size: 0.85rem; font-weight: 800;
  cursor: pointer; transition: 0.15s;
  display: flex; align-items: center; gap: 5px; flex: 2;
  box-shadow: 0 3px 10px rgba(0,166,81,0.28);
}
.action-settle:hover { background: var(--green-dk); box-shadow: 0 5px 16px rgba(0,166,81,0.38); }
.action-settle:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ════════════ RECEIPT MODAL ════════════ */
.receipt-modal-box { max-width: 360px; }
.receipt-header {
  background: var(--green);
  padding: 22px 20px; text-align: center;
}
.receipt-success-icon { font-size: 3rem; }
.receipt-title { font-size: 1.1rem; font-weight: 800; color: #fff; margin-top: 4px; }
.receipt-subtitle { font-size: 0.69rem; color: rgba(255,255,255,0.75); margin-top: 2px; }

.receipt-shop { text-align: center; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed var(--border-md); }
.receipt-shop-name { font-size: 0.95rem; font-weight: 800; }
.receipt-shop-info { font-size: 0.64rem; color: var(--t3); margin-top: 2px; }

.receipt-item { display: flex; justify-content: space-between; font-size: 0.72rem; padding: 3px 0; }
.ri-name { flex: 1; color: var(--t2); }
.ri-qty  { color: var(--t3); min-width: 26px; text-align: center; }
.ri-amt  { font-weight: 700; min-width: 58px; text-align: right; }

.receipt-totals {
  background: var(--bg); border-radius: var(--radius);
  padding: 10px 12px; margin-top: 8px;
}
.rt-row { display: flex; justify-content: space-between; font-size: 0.72rem; margin-bottom: 4px; color: var(--t2); }
.rt-row .rtv { font-weight: 700; color: var(--t1); }
.rt-grand { font-size: 0.9rem; font-weight: 900; color: var(--green); border-top: 1px solid var(--border); padding-top: 6px; margin-top: 4px; }

.receipt-thank { text-align: center; font-size: 0.65rem; color: var(--t3); margin-top: 10px; line-height: 1.5; }
