/* ============================================================================
 * Customer SPA — order.khide.in
 * Mobile-first design system. Single stylesheet, hand-rolled (no framework).
 * ============================================================================ */

:root {
  --primary: #FF6B35;
  --primary-dark: #E55A2B;
  --primary-light: #FFE5D8;
  --secondary: #2E5BFF;
  --success: #00C896;
  --warning: #FFAA00;
  --danger: #E74C3C;
  --info: #3498DB;

  --bg: #FFFFFF;
  --bg-soft: #F7F8FA;
  --bg-elevated: #FFFFFF;

  --text: #1A1A1A;
  --text-soft: #4A4A4A;
  --text-muted: #8A8A8A;
  --text-on-primary: #FFFFFF;

  --border: #E5E7EB;
  --border-strong: #D1D5DB;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.16);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --app-bar-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: transparent;
  color: inherit;
  outline: none;
}

a {
  color: var(--primary);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ----------------------------------------------------------------------------
 * Layout — app bar + main shell
 * ---------------------------------------------------------------------------- */

.app-bar {
  height: var(--app-bar-h);
  background: var(--primary);
  color: var(--text-on-primary);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.app-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  position: relative;
  transition: background 0.15s ease;
}
.icon-button:hover, .icon-button:focus-visible {
  background: rgba(255,255,255,0.15);
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--bg);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

#app-root {
  min-height: calc(100vh - var(--app-bar-h));
  padding-bottom: 88px; /* room for cart pill / fixed actions */
}

/* ----------------------------------------------------------------------------
 * Drawer
 * ---------------------------------------------------------------------------- */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}
.drawer[aria-hidden="false"] {
  pointer-events: auto;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer[aria-hidden="false"] .drawer-backdrop {
  opacity: 1;
}

.drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.drawer[aria-hidden="false"] .drawer-panel {
  transform: translateX(0);
}

.drawer-auth {
  background: var(--primary);
  color: var(--text-on-primary);
  padding: 24px 20px 20px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
}

.drawer-auth-name {
  font-size: 18px;
  font-weight: 600;
}
.drawer-auth-email {
  font-size: 14px;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-google-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
}

.drawer-nav {
  flex: 1;
  padding: 12px 0;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  width: 100%;
  text-align: left;
  font-size: 15px;
  color: var(--text);
  transition: background 0.15s ease;
}
.drawer-item:hover, .drawer-item:focus-visible {
  background: var(--bg-soft);
}

.drawer-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

/* ----------------------------------------------------------------------------
 * Loading / empty / error states
 * ---------------------------------------------------------------------------- */

.view-loading,
.view-empty,
.view-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-soft);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-emoji {
  font-size: 56px;
  margin-bottom: 16px;
}

.view-error h2,
.view-empty h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

/* ----------------------------------------------------------------------------
 * Containers
 * ---------------------------------------------------------------------------- */

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 16px 16px 8px;
}

/* ----------------------------------------------------------------------------
 * Buttons
 * ---------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.15s ease;
  min-height: 44px;
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: var(--text-on-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) { background: var(--bg-soft); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
}
.btn-ghost:hover:not(:disabled) { background: var(--primary-light); }

.btn-danger {
  background: var(--danger);
  color: var(--text-on-primary);
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 8px;
}

/* ----------------------------------------------------------------------------
 * Forms
 * ---------------------------------------------------------------------------- */

.field {
  display: block;
  margin-bottom: 14px;
}
.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 6px;
}
.field-required::after {
  content: ' *';
  color: var(--danger);
}
.field-input,
.field-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 16px;
  transition: border-color 0.15s ease;
}
.field-input:focus,
.field-textarea:focus {
  border-color: var(--primary);
}
.field-textarea {
  min-height: 80px;
  resize: vertical;
}
.field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}
.field-help {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}
.radio-card:hover { border-color: var(--primary); }
.radio-card input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.radio-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ----------------------------------------------------------------------------
 * Mode selection cards
 * ---------------------------------------------------------------------------- */

.mode-grid {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.mode-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.mode-card:hover, .mode-card:focus-visible {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.mode-card-icon {
  font-size: 36px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mode-card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 2px;
}
.mode-card-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------------------
 * Dine-in PIN entry
 * ---------------------------------------------------------------------------- */

.pin-page {
  padding: 32px 24px;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}
.pin-page h2 {
  font-size: 22px;
  margin-bottom: 8px;
}
.pin-page p {
  color: var(--text-soft);
  margin-bottom: 24px;
}
.pin-input {
  width: 200px;
  margin: 0 auto 16px;
  padding: 16px;
  font-size: 28px;
  text-align: center;
  letter-spacing: 0.5em;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: monospace;
}
.pin-input:focus { border-color: var(--primary); }

/* ----------------------------------------------------------------------------
 * Menu view
 * ---------------------------------------------------------------------------- */

.menu-sticky {
  position: sticky;
  top: var(--app-bar-h);
  z-index: 6;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.menu-header {
  padding: 12px 16px;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.category-tabs {
  display: flex;
  gap: 8px;
  padding: 4px 16px 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.category-tab.active {
  background: var(--primary);
  color: var(--text-on-primary);
  border-color: var(--primary);
}

.category-section {
  padding: 0 16px;
}
.category-section h2 {
  font-size: 18px;
  font-weight: 700;
  padding: 16px 0 8px;
}

.menu-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.menu-item-info { flex: 1; min-width: 0; }
.menu-item-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}
.menu-item-oos {
  font-size: 13px;
  color: var(--text-muted);
}
.menu-item-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
.menu-item-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.menu-item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.menu-item-veg-mark {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid #2E7D32;
  position: relative;
  margin-right: 6px;
  vertical-align: middle;
}
.menu-item-veg-mark::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #2E7D32;
}
.menu-item-veg-mark.nonveg {
  border-color: #C62828;
}
.menu-item-veg-mark.nonveg::after {
  background: #C62828;
}

.menu-item-image {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-soft);
  flex-shrink: 0;
  cursor: pointer;
}
/* In the right-hand actions cell, controls are centered — drop the inline top margin. */
.menu-item-actions .add-btn,
.menu-item-actions .qty-control {
  margin-top: 0;
}
.img-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.img-preview-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 6px;
}
.qty-control button {
  width: 32px;
  height: 32px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qty-control span {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--primary-dark);
}

.add-btn {
  padding: 6px 16px;
  background: var(--bg);
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  margin-top: 6px;
}

/* ----------------------------------------------------------------------------
 * Cart pill (floating)
 * ---------------------------------------------------------------------------- */

.cart-pill {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  z-index: 8;
  max-width: 688px;
  margin: 0 auto;
}
.cart-pill button {
  width: 100%;
  background: var(--primary);
  color: var(--text-on-primary);
  padding: 14px 18px;
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cart-pill-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ----------------------------------------------------------------------------
 * Cart view
 * ---------------------------------------------------------------------------- */

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  align-items: center;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 14px;
  font-weight: 600;
}
.cart-item-price {
  font-size: 13px;
  color: var(--text-muted);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}
.summary-row-total {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 12px;
  font-size: 16px;
  font-weight: 700;
}

/* ----------------------------------------------------------------------------
 * Ongoing order view
 * ---------------------------------------------------------------------------- */

.status-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-on-primary);
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  margin: 16px;
  text-align: center;
}
.status-hero-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
}
.status-hero-title {
  font-size: 24px;
  font-weight: 700;
  margin: 4px 0;
}
.status-hero-token {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0;
  line-height: 1;
}
.status-hero-sub {
  font-size: 14px;
  opacity: 0.95;
}

.status-hero.pending  { background: linear-gradient(135deg, #B71C1C, #E53935); }
.status-hero.placed   { background: linear-gradient(135deg, var(--info), #1E88E5); }
.status-hero.preparing { background: linear-gradient(135deg, var(--warning), #FB8C00); }
.status-hero.ready    { background: linear-gradient(135deg, var(--success), #00897B); }
.status-hero.served   { background: linear-gradient(135deg, #6A1B9A, #8E24AA); }
.status-hero.paid     { background: linear-gradient(135deg, var(--success), #2E7D32); }
.status-hero.rejected { background: linear-gradient(135deg, #455A64, #607D8B); }

.action-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 16px;
}

.upi-pay-card {
  background: var(--primary-light);
  border: 1px dashed var(--primary);
  padding: 16px;
  border-radius: var(--radius-md);
  margin: 0 16px 16px;
  text-align: center;
}
.upi-pay-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
}
.upi-pay-card p {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 12px;
}

/* ----------------------------------------------------------------------------
 * Order history
 * ---------------------------------------------------------------------------- */

.history-item {
  background: var(--bg);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}
.history-item:hover { transform: translateX(2px); box-shadow: var(--shadow-md); }

.history-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.history-item-name {
  font-size: 14px;
  font-weight: 600;
  margin: 2px 0;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-badge.pending  { background: #FFEBEE; color: #B71C1C; }
.status-badge.placed   { background: #E3F2FD; color: #1565C0; }
.status-badge.preparing { background: #FFF3E0; color: #E65100; }
.status-badge.ready    { background: #E0F2F1; color: #00695C; }
.status-badge.served   { background: #F3E5F5; color: #6A1B9A; }
.status-badge.paid     { background: #E8F5E9; color: #2E7D32; }
.status-badge.rejected { background: #ECEFF1; color: #455A64; }

/* ----------------------------------------------------------------------------
 * Dine-in session orders list
 * ---------------------------------------------------------------------------- */

.session-order-card {
  margin-bottom: 12px;
}
.session-order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.session-order-title {
  font-size: 15px;
  font-weight: 700;
}
.session-order-time {
  font-size: 12px;
  margin-top: 2px;
}
.session-grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  background: var(--primary-light);
}

/* ----------------------------------------------------------------------------
 * Pay Bill by UPI (Phase 3)
 * ---------------------------------------------------------------------------- */

.pay-bill-card {
  border: 1px solid var(--primary);
  background: var(--primary-light);
}

.pay-bill-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

/* Space stacked buttons (Retry above Waiting for approval). */
.pay-bill-card .btn + .btn {
  margin-top: 8px;
}

.pay-bill-label {
  font-size: 14px;
  color: var(--text-muted, #6b7280);
}

.pay-bill-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.pay-bill-note {
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
}

/* ----------------------------------------------------------------------------
 * Toast
 * ---------------------------------------------------------------------------- */

#toast-container {
  position: fixed;
  top: calc(var(--app-bar-h) + 12px);
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  gap: 8px;
  padding: 0 12px;
}

.toast {
  background: var(--text);
  color: var(--text-on-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  max-width: 100%;
  pointer-events: auto;
  animation: toast-in 0.25s ease;
}
.toast.error   { background: var(--danger); }
.toast.success { background: var(--success); }
.toast.info    { background: var(--info); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------------------------
 * Modal
 * ---------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-panel {
  background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  animation: slide-up 0.25s ease;
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}
.modal-body { margin-bottom: 16px; color: var(--text-soft); }

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
  .modal-panel { border-radius: var(--radius-lg); margin: 16px; }
}

/* ----------------------------------------------------------------------------
 * "Pay using" UPI app chooser (bottom sheet)
 * ---------------------------------------------------------------------------- */

.upi-chooser-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in 0.2s ease;
}

.upi-chooser-sheet {
  background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  padding: 20px;
  padding-bottom: calc(16px + var(--safe-bottom));
  animation: slide-up 0.25s ease;
}

.upi-chooser-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.upi-chooser-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.upi-chooser-label { text-align: center; }
.upi-chooser-ico { display: inline-flex; width: 26px; height: 26px; flex-shrink: 0; }
.upi-chooser-ico svg { width: 26px; height: 26px; display: block; }
.upi-chooser-rec { font-size: 12px; font-weight: 500; color: var(--text-muted); }

.upi-chooser-btn:active { background: var(--bg-soft); }

.upi-chooser-btn-other {
  color: var(--text-soft);
  font-weight: 500;
}

.upi-chooser-cancel {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-top: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.upi-chooser-btn-qr {
  color: var(--primary-dark);
  border-color: var(--primary);
}

.upi-qr-sheet { text-align: center; }

.upi-qr-img {
  display: block;
  width: 240px;
  max-width: 80vw;
  height: auto;
  margin: 4px auto 12px;
  padding: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  image-rendering: pixelated;
}

.upi-qr-note {
  font-size: 13px;
  margin-bottom: 12px;
}

@media (min-width: 640px) {
  .upi-chooser-overlay { align-items: center; }
  .upi-chooser-sheet { border-radius: var(--radius-lg); margin: 16px; }
}

/* ----------------------------------------------------------------------------
 * Misc
 * ---------------------------------------------------------------------------- */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }

[hidden] { display: none !important; }

/* Closed-for-online-orders banner (Pick Up / Delivery outside service hours) */
.closed-banner {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: center;
}
.closed-banner-title {
  font-weight: 700;
  color: var(--primary-dark);
}
.closed-banner-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-soft);
}

/* "Staff is on the way" confirmation (fixed pill near the top, auto-dismiss ~90s) */
.staff-onway-banner {
  position: fixed;
  top: calc(var(--app-bar-h, 56px) + 8px);
  left: 50%;
  transform: translate(-50%, -16px);
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  background: #16a34a;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}
.staff-onway-banner.show { opacity: 1; transform: translate(-50%, 0); }
.staff-onway-text { font-weight: 700; font-size: 14px; }
.staff-onway-close {
  background: rgba(255, 255, 255, 0.22);
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  :root { --app-bar-h: 64px; }
  .app-title { font-size: 20px; }
}
