/* POS-specific additions on top of shared-theme. Uses the same CSS variables.
 *
 * tables.html and cashier.html are written mobile-first: the unqualified
 * rules below target a phone in a waiter's/cashier's hand (base case), and
 * @media (min-width: 768px) rules layer on the roomier tablet/desktop
 * layout. Admin-only pages (menu/users/reports/dashboard) just inherit the
 * desktop-ish defaults further down and aren't tuned for phones.
 */

:root {
  --tap-min: 44px; /* minimum comfortable touch target (iOS/Android HIG) */
}

/* ---------------------------------------------------------------------- */
/* Tables grid (mobile-first: 3 compact columns, grows to roomier cards)   */
/* ---------------------------------------------------------------------- */
.table-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.table-cell {
  border: 2px solid var(--brand-border); border-radius: var(--brand-radius-lg);
  background: var(--brand-card-bg); padding: 14px 6px; text-align: center; cursor: pointer;
  min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: box-shadow .15s ease, transform .15s ease;
}
.table-cell:active { transform: scale(0.97); }
.table-cell:hover { box-shadow: var(--brand-shadow); }
.table-cell .num { font-size: 1.3rem; font-weight: 700; color: var(--brand-heading); }
.table-cell .status { font-size: .72rem; margin-top: 2px; }
.table-cell.free { border-color: var(--brand-success); }
.table-cell.occupied { border-color: var(--brand-accent-600); background: var(--brand-soft-warning-bg); }

@media (min-width: 768px) {
  .table-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
  .table-cell { padding: 14px 10px; min-height: auto; }
  .table-cell .num { font-size: 1.4rem; }
}

/* ---------------------------------------------------------------------- */
/* Menu grid (mobile-first: 2 big tappable cards, grows into a denser grid)*/
/* ---------------------------------------------------------------------- */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.menu-card {
  border: 1px solid var(--brand-border); border-radius: var(--brand-radius-lg); background: var(--brand-card-bg);
  padding: 14px 12px; cursor: pointer; transition: box-shadow .15s ease, transform .15s ease;
  min-height: var(--tap-min); display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.menu-card:active { transform: scale(0.97); }
.menu-card:hover { box-shadow: var(--brand-shadow); }
.menu-card .name { font-weight: 600; color: var(--brand-heading); font-size: .95rem; }
.menu-card .price { color: var(--brand-text-muted); font-size: .85rem; }
.menu-card .type-badge { font-size: .65rem; align-self: flex-start; }

@media (min-width: 768px) {
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .menu-card { padding: 12px; min-height: auto; }
}

/* Category tabs: horizontally scrollable strip on phones so they never wrap
   and eat vertical space; becomes a normal pill row once there's room. */
.category-tabs-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -1rem;
  padding: 0 1rem;
}
.category-tabs-scroll::-webkit-scrollbar { display: none; }
.category-tabs-scroll .nav-pills { flex-wrap: nowrap; }
.category-tabs-scroll .nav-link {
  white-space: nowrap;
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
}
@media (min-width: 768px) {
  .category-tabs-scroll { margin: 0; padding: 0; overflow-x: visible; }
  .category-tabs-scroll .nav-pills { flex-wrap: wrap; }
}

.bill-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--brand-border-soft); }
.bill-line:last-child { border-bottom: none; }
.bill-line .muted { color: var(--brand-text-muted); font-size: .8rem; }

.split-portion { border: 1px solid var(--brand-border); border-radius: var(--brand-radius); padding: 10px; margin-bottom: 8px; }

.order-card { border: 1px solid var(--brand-border); border-radius: var(--brand-radius-lg); background: var(--brand-card-bg); padding: 14px; margin-bottom: 12px; min-height: var(--tap-min); }
.order-card .hd { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }

.kg-amount-toggle .btn.active { background: var(--brand-primary); color: #fff; }
.kg-amount-toggle .btn { min-height: var(--tap-min); }

/* ---------------------------------------------------------------------- */
/* Bill panel: on phones/tablets (<lg) it's a slide-up bottom sheet opened
   from the sticky order bar; on desktop (>=lg) it's just the normal column
   content, no fixed positioning, always visible. Plain CSS + openBillPanel/
   closeBillPanel() in tables.html — see note there on why not Bootstrap's
   offcanvas component. */
/* ---------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .bill-panel {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1060;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform .3s ease;
    border-radius: 16px 16px 0 0;
    box-shadow: var(--brand-shadow-lg);
    overflow-y: auto;
    background: var(--brand-card-bg);
  }
  .bill-panel.show { transform: translateY(0); }
  .bill-panel .card-body { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .bill-panel-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(11,20,55,0.5);
    z-index: 1055;
  }
  .bill-panel-backdrop.show { display: block; }
  body.bill-panel-open { overflow: hidden; }
}
@media (min-width: 992px) {
  .bill-panel .card { border: 1px solid var(--brand-border); box-shadow: none; }
}

/* Sticky order bar: the always-visible "N items · Total — tap to view"
   strip that sits above the bottom sheet trigger on phones. */
.mobile-order-bar {
  position: sticky;
  bottom: 0.75rem;
  margin-top: 1rem;
  background: var(--brand-primary);
  color: #fff;
  border-radius: var(--brand-radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--brand-shadow-lg);
  cursor: pointer;
  min-height: 56px;
  z-index: 10;
}
.mobile-order-bar .count { font-weight: 600; font-size: 0.95rem; }
.mobile-order-bar .hint { font-size: 0.72rem; opacity: 0.8; }
.mobile-order-bar .total { font-weight: 700; font-size: 1.15rem; }

/* Quick-amount chips (fast phone input for kg / birr amounts, cash tender). */
.quick-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip-btn {
  border: 1px solid var(--brand-border);
  background: var(--brand-soft-primary-bg);
  color: var(--brand-soft-primary-fg);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 38px;
  flex: 1 1 auto;
  text-align: center;
}
.chip-btn:active { transform: scale(0.96); }

/* Bigger, thumb-friendly form controls on the screens staff carry around. */
#orderView .form-control,
#orderView .btn,
#cashierStage .form-control,
#cashierStage .btn {
  min-height: var(--tap-min);
}
