/* GSmart Restaurant — shared mobile-first tokens & touch patterns */
:root {
  --touch-min: 44px;
  --sheet-radius: 16px;
  --sheet-max-h: 92dvh;
  --chip-gap: 8px;
}

/* Touch targets */
.ab,
.btn-chip,
.bpri,
.bsv,
.btn-pay,
.btn-print,
.btn-back,
.floor-actions button,
.floor-actions a,
.mia,
.kds-action,
.kds-btn,
.cart-fab,
.cart-sheet-btn,
.seg-ctrl button,
.staff-demo-role,
.panel-footer-sticky button,
.panel-footer-sticky .bpri {
  min-height: var(--touch-min);
}

/* Horizontal scroll chips with snap */
.summary,
.sc-row,
.cat-filter,
.tabs,
.dash-tabnav-scroll,
.walk-scroll {
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.summary::-webkit-scrollbar,
.sc-row::-webkit-scrollbar,
.cat-filter::-webkit-scrollbar { display: none; }

.summary .sc,
.sc-row > *,
.cat-filter .cat-pill {
  scroll-snap-align: start;
}

.summary .sc {
  min-height: var(--touch-min);
  min-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Fade hint on scroll edges */
.scroll-fade-wrap {
  position: relative;
}
.scroll-fade-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--sf, #111827));
}

/* Bottom sheet panels */
.pn,
.panel {
  display: flex;
  flex-direction: column;
}

.pb,
.panel-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.panel-footer-sticky,
.panel-actions-sticky {
  flex-shrink: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--bd, rgba(255,255,255,.08));
  background: var(--sf, #111827);
  position: sticky;
  bottom: 0;
  z-index: 5;
}

.panel-footer-sticky .am,
.panel-actions-sticky .am {
  margin: 0;
}

.panel-footer-sticky .bsv,
.panel-footer-sticky .bpri {
  width: 100%;
  font-size: 15px;
  font-weight: 800;
}

.add-cart-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gn, #22c55e);
  margin-top: 6px;
}

/* Cart FAB + bottom sheet (guest menu) */
.cart-fab {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  z-index: 150;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  font-size: 22px;
}

.cart-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.cart-sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 201;
  max-height: var(--sheet-max-h);
  background: var(--sf, #111827);
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  transform: translateY(110%);
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cart-sheet.open { transform: translateY(0); }

.cart-sheet-head {
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--bd, rgba(255,255,255,.08));
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
}
.cart-sheet-foot {
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--bd, rgba(255,255,255,.08));
}

/* Segmented control (collection type) */
.seg-ctrl {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.seg-ctrl button {
  flex: 1;
  min-width: calc(50% - 6px);
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid var(--bd, rgba(255,255,255,.12));
  background: var(--sf2, rgba(255,255,255,.04));
  color: var(--tx2, #94a3b8);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.seg-ctrl button.active {
  background: var(--in, #6366f1);
  border-color: var(--in, #6366f1);
  color: #fff;
}

/* KDS mobile */
@media (max-width: 768px) {
  .serial-list .order-card {
    width: 100%;
  }
  .kds-action,
  .kds-btn,
  .order-card .btn-start,
  .order-card .btn-ready {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
    font-weight: 800;
  }
  .dashboard-container {
    padding: 16px 12px 80px !important;
  }
  .order-card {
    font-size: 15px;
    line-height: 1.5;
  }
  .order-card .item-row {
    padding: 8px 0;
  }
}

/* Table grid — narrow phones */
@media (max-width: 480px) {
  .tg,
  .table-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .tc .tb,
  .tcard .status-badge {
    font-size: 11px !important;
  }
}

/* Cashier shift strip stack */
@media (max-width: 480px) {
  .cash-strip {
    grid-template-columns: 1fr 1fr !important;
  }
  .cash-strip .cash-pill:nth-child(3),
  .cash-strip .cash-pill:nth-child(4) {
    grid-column: span 1;
  }
}

/* Walk / takeaway horizontal scroll */
.walk-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 12px 8px;
  -webkit-overflow-scrolling: touch;
}
.walk-scroll .walk-card {
  flex: 0 0 min(260px, 78vw);
}

/* UPI / receipt modals — sticky confirm */
.upi-sticky-foot,
.receipt-sticky-foot {
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: inherit;
}
.upi-sticky-foot .bpri,
.receipt-sticky-foot .btn-pay {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
}

/* Prebook timeline */
.prebook-timeline {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}
.prebook-timeline li {
  position: relative;
  padding: 12px 12px 12px 36px;
  border-left: 2px solid var(--bd, rgba(255,255,255,.12));
  margin-left: 10px;
  font-size: 14px;
  color: var(--tx2, #94a3b8);
}
.prebook-timeline li.done {
  color: var(--tx, #f1f5f9);
  font-weight: 600;
}
.prebook-timeline li::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bd, #475569);
}
.prebook-timeline li.done::before {
  background: var(--gn, #22c55e);
}

/* Staff login demo roles */
.staff-demo-roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.staff-demo-role {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid var(--bd, rgba(255,255,255,.12));
  background: var(--sf2, rgba(255,255,255,.04));
  text-decoration: none;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

/* Admin mobile */
@media (max-width: 768px) {
  .dash-launch a {
    min-height: 88px !important;
    padding: 14px !important;
  }
  .dash-tabnav-scroll {
    overflow-x: auto;
    flex-wrap: nowrap !important;
  }
  .settings-accordion summary {
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
  }
  .chart-mobile-wrap {
    height: 220px;
    position: relative;
  }
}
