/* EatDee Web Order - Mobile-First & Mobile-Friendly Styles */
:root {
  /* EatDee Brand Palette (Synchronized with EatDee POS Android App) */
  --brand-primary: #4A7C59;        /* Warm Forest Green */
  --brand-primary-dark: #366143;   /* Deep Forest Green */
  --brand-primary-light: #6BA882;  /* Soft Leaf Green */
  --brand-accent: #F4A835;         /* Warm Amber Gold */
  --brand-accent-dark: #D98D1A;
  --brand-cream: #F5E6C8;          /* Warm Cream */
  --brand-dark: #141A13;

  --primary: #4A7C59;
  --primary-hover: #366143;
  --primary-light: #EAF4EE;
  --primary-border: #C6DEC9;
  
  --accent: #F4A835;
  --accent-hover: #D98D1A;
  --accent-light: #FDF6E8;

  --success: #4A7C59;
  --success-light: #EAF4EE;
  --danger: #C0524A;
  --danger-light: #FDF2F1;
  --warning: #F4A835;
  --warning-light: #FFF9EE;
  
  --bg-main: #F7F5F0;             /* Warm organic paper tone matching POS */
  --bg-card: #FFFFFF;
  --bg-subtle: #ECEAE3;           /* POS chip/divider tone */
  --text-main: #1A201A;           /* Deep dark green-black text */
  --text-muted: #6B7260;          /* Secondary muted olive gray */
  --text-light: #8E9685;
  --border: #E0DCD4;              /* Warm divider */
  --border-focus: #4A7C59;

  --shadow-sm: 0 1px 3px 0 rgb(26 32 26 / 0.06);
  --shadow-md: 0 4px 6px -1px rgb(26 32 26 / 0.08), 0 2px 4px -2px rgb(26 32 26 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(26 32 26 / 0.1), 0 4px 6px -4px rgb(26 32 26 / 0.08);
  --shadow-xl: 0 20px 25px -5px rgb(26 32 26 / 0.12), 0 8px 10px -6px rgb(26 32 26 / 0.08);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-sheet: 24px;
  --radius-full: 9999px;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: calc(100px + var(--safe-bottom));
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  touch-action: manipulation;
  cursor: pointer;
  border: none;
  outline: none;
}

button:active {
  transform: scale(0.97);
}

/* Container */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 14px;
}

/* ==================== APP HEADER (MOBILE FIRST) ==================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 8px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(74, 124, 89, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  white-space: nowrap;
}

/* Branch Pill inside brand group */
.branch-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
  transition: var(--transition);
  white-space: nowrap;
}

.branch-pill-btn .chevron {
  font-size: 8px;
  opacity: 0.7;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Table Pill */
.table-pill-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background-color: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  transition: var(--transition);
  min-height: 34px;
  white-space: nowrap;
}

.table-pill-btn .chevron {
  font-size: 8px;
  opacity: 0.7;
}

/* Icon Buttons */
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: #ffffff;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}

.icon-btn:hover {
  background-color: var(--bg-subtle);
}

.auth-icon-btn.logged-in {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.badge-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--success);
  border: 1.5px solid #ffffff;
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
}

/* Mobile Quick Context Strip */
.mobile-context-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 8px;
  border-top: 1px dashed #f1f5f9;
  font-size: 12px;
}

.mobile-context-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  cursor: pointer;
  min-width: 0;
}

.mobile-context-left b {
  color: var(--primary);
  font-weight: 700;
}

.status-indicator-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #15803d;
  background-color: #ecfdf5;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.status-indicator-mini .indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
}

/* ==================== SHOP BANNER (MOBILE CARD) ==================== */
.shop-banner {
  padding: 10px 0 6px;
}

.shop-banner-card {
  background: linear-gradient(135deg, #EAF4EE 0%, #FAF8F2 60%, #F5E6C8 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.shop-main-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.shop-headline {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.shop-sub {
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background-color: #ffffff;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.banner-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

/* ==================== STICKY SEARCH & CATEGORY NAV ==================== */
.category-nav-wrapper {
  position: sticky;
  top: 92px; /* Positioned below sticky header */
  z-index: 35;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.search-section {
  padding: 8px 0 6px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 36px;
  background-color: var(--bg-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.18);
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 13px;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
}

.clear-search-btn.visible {
  display: flex;
}

/* Category Horizontal Scroll */
.category-nav {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0 10px;
  gap: 6px;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: 36px;
}

.category-tab.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(74, 124, 89, 0.35);
}

/* ==================== PRODUCTS SECTION (MOBILE FIRST) ==================== */
.products-section {
  padding: 14px 0 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-count-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Mobile Food Cards Grid: 1 Column on Mobile */
.products-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Modern Horizontal Food Card (GrabFood / ShopeeFood style) */
.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.product-card:active {
  background-color: #fafaf9;
  border-color: #cbd5e1;
}

.product-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
  line-height: 1.3;
}

.product-category-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.product-options-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.option-tag {
  font-size: 10px;
  padding: 1px 5px;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: 4px;
}

.product-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  margin-top: 2px;
}

/* Right side of card: Image & Add button */
.product-card-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.product-emoji-box {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  border: 1px solid var(--border);
}

.add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 12px;
  background-color: var(--primary);
  color: #ffffff;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  transition: var(--transition);
  min-height: 30px;
}

.add-btn.has-options {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 42px;
  margin-bottom: 8px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

/* ==================== FLOATING MOBILE CART BAR ==================== */
.floating-cart-bar {
  position: fixed;
  bottom: calc(12px + var(--safe-bottom));
  left: 0;
  right: 0;
  z-index: 50;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
  transform: translateY(140%);
  opacity: 0;
}

.floating-cart-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cart-bar-inner {
  max-width: 500px;
  margin: 0 auto;
  padding: 0 12px;
}

.cart-bar-card {
  background: linear-gradient(135deg, #1A281E 0%, #2A3F31 100%);
  color: #ffffff;
  border-radius: var(--radius-full);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 25px rgba(26, 40, 30, 0.38);
  cursor: pointer;
  transition: var(--transition);
  min-height: 52px;
}

.cart-bar-card:active {
  transform: scale(0.98);
}

.cart-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-bar-badge {
  background-color: var(--accent);
  color: #141A13;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(244, 168, 53, 0.4);
}

.cart-bar-text h4 {
  font-size: 14px;
  font-weight: 800;
}

.cart-bar-text p {
  font-size: 11px;
  color: #94a3b8;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-bar-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ==================== MOBILE BOTTOM SHEETS & MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: flex-end; /* Mobile Bottom Sheet */
  justify-content: center;
  padding: 0;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background-color: #ffffff;
  width: 100%;
  max-width: 540px;
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-xl);
  padding-bottom: var(--safe-bottom);
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-sheet {
    border-radius: 24px 24px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    max-height: 90vh !important;
  }
  .sheet-drag-handle {
    display: block !important;
  }
}

.modal-backdrop.open .modal-sheet {
  transform: translateY(0);
}

/* Drag Handle Bar for native mobile feel */
.sheet-drag-handle {
  width: 36px;
  height: 4px;
  background-color: #cbd5e1;
  border-radius: var(--radius-full);
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.close-modal-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
}

.close-modal-btn:hover {
  background-color: #e2e8f0;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background-color: #ffffff;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Custom Dish Header */
.custom-dish-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.custom-dish-emoji {
  font-size: 38px;
  width: 58px;
  height: 58px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-dish-info h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.custom-dish-info p {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  margin-top: 1px;
}

.modal-form-group {
  margin-bottom: 16px;
}

.modal-form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.label-sub {
  font-size: 11px;
  font-weight: normal;
  color: var(--text-muted);
}

/* Option Chips (Touch Targets >= 44px) */
.options-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-chip {
  padding: 10px 16px;
  background-color: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}

.option-chip.selected {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.quick-notes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.quick-note-chip {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background-color: #ffffff;
  border: 1px dashed var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  min-height: 32px;
}

.quick-note-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.custom-textarea {
  width: 100%;
  height: 64px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 13px;
  resize: none;
  outline: none;
  transition: var(--transition);
}

.custom-textarea:focus {
  border-color: var(--primary);
}

/* Quantity Stepper Row */
.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stepper-label {
  font-weight: 700;
  font-size: 14px;
}

.quantity-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background-color: #ffffff;
  overflow: hidden;
}

.stepper-btn {
  width: 42px;
  height: 42px;
  background: none;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.stepper-btn:active {
  background-color: var(--bg-subtle);
  color: var(--primary);
}

.stepper-value {
  min-width: 36px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
}

/* Primary CTA Button (Mobile Thumb Friendly >= 48px) */
.btn-primary {
  width: 100%;
  height: 50px;
  background-color: var(--primary);
  color: #ffffff;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.btn-primary:active {
  background-color: var(--primary-hover);
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  height: 50px;
  padding: 0 18px;
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-secondary:active {
  background-color: #e2e8f0;
}

/* ==================== CART SHEET & ORDER TYPE ==================== */
.order-type-switch {
  display: flex;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  margin-bottom: 14px;
}

.order-type-btn {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition);
  min-height: 40px;
}

.order-type-btn.active {
  background-color: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.cart-table-info-box {
  background-color: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.table-info-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-label {
  font-size: 12px;
  color: var(--text-muted);
}

.table-name {
  font-weight: 800;
  color: var(--primary);
  font-size: 14px;
}

.change-table-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: underline;
  background: none;
  padding: 4px 6px;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.cart-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  gap: 10px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.cart-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.cart-item-tag {
  font-size: 10px;
  padding: 1px 5px;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: 4px;
}

.cart-item-note {
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
  font-style: italic;
}

.cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cart-item-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.cart-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background-color: #ffffff;
}

.cart-stepper button {
  width: 28px;
  height: 28px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-stepper span {
  min-width: 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

/* Voucher Form */
.voucher-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.voucher-input {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.voucher-input:focus {
  border-color: var(--primary);
}

.voucher-apply-btn {
  height: 42px;
  padding: 0 16px;
  background-color: var(--text-main);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.voucher-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--success-light);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 12px;
  color: #15803d;
  font-weight: 700;
}

.remove-voucher-btn {
  background: none;
  color: var(--danger);
  font-size: 16px;
  padding: 0 4px;
}

/* Bill Summary */
.bill-summary {
  background-color: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.bill-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.bill-row.total-row {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.bill-row.total-row .total-amount {
  color: var(--primary);
  font-size: 18px;
}

/* ==================== TABLES MODAL GRID ==================== */
.modal-sub-tip {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.tables-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 360px) {
  .tables-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.table-card-btn {
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background-color: #ffffff;
  text-align: center;
  transition: var(--transition);
}

.table-card-btn.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.table-card-btn .table-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

.table-card-btn .table-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.table-card-btn .table-status {
  font-size: 10px;
  font-weight: 700;
  margin-top: 2px;
}

.status-available { color: var(--success); }
.status-occupied { color: var(--danger); }
.status-reserved { color: var(--warning); }

/* ==================== BRANCH SELECTION ==================== */
.branch-selection-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.branch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background-color: #ffffff;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.branch-card.active {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.branch-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.branch-card-icon {
  font-size: 22px;
  width: 40px;
  height: 40px;
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.branch-card-text h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.branch-card-text p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.branch-card-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: transparent;
}

.branch-card.active .branch-card-check {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* User Profile & Auth Modal */
.user-profile-box {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.user-profile-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}

.user-text h4 {
  font-size: 13px;
  font-weight: 800;
  color: #1e3a8a;
}

.user-text p {
  font-size: 11px;
  color: #3b82f6;
}

.btn-logout {
  padding: 5px 10px;
  background-color: #ffffff;
  border: 1px solid #93c5fd;
  color: #dc2626;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.branch-callout-box {
  background-color: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-main);
}

/* ==================== ORDER SUCCESS & LIVE TRACKING ==================== */
.success-view {
  text-align: center;
  padding: 16px 8px;
}

.success-icon-badge {
  width: 60px;
  height: 60px;
  background-color: var(--success-light);
  border: 2px solid var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
  animation: bounce-in 0.4s ease;
}

@keyframes bounce-in {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.success-order-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2px;
}

.success-table-tag {
  display: inline-block;
  padding: 3px 10px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.success-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.order-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 20px 0 16px;
  padding: 0 8px;
}

.order-timeline::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 20px;
  right: 20px;
  height: 2px;
  background-color: var(--border);
  z-index: 1;
}

.timeline-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.timeline-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

.timeline-step.completed .timeline-dot {
  background-color: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.timeline-step.active .timeline-dot {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.2);
}

.timeline-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.timeline-step.active .timeline-label {
  color: var(--primary);
}

.success-order-summary-box {
  background-color: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: left;
  margin: 14px 0;
}

.summary-box-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}

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

/* ==================== TOAST & SPINNERS ==================== */
.toast-container {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  width: 90%;
  max-width: 360px;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slide-toast 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.toast-success { background: #065f46; border-left: 4px solid #10b981; }
.toast.toast-error { background: #991b1b; border-left: 4px solid #ef4444; }
.toast.toast-info { background: #1e293b; border-left: 4px solid #38bdf8; }

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

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== DESKTOP & TABLET ENHANCEMENTS (min-width: 641px) ==================== */
@media (min-width: 641px) {
  .header-inner {
    height: 64px;
  }

  .brand-title {
    font-size: 17px;
  }

  .branch-pill-btn {
    font-size: 12px;
    padding: 3px 10px;
  }

  .category-nav-wrapper {
    top: 96px;
  }

  /* 2 Columns on Tablet / Desktop */
  .products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* Modal becomes centered popup dialog on desktop */
  .modal-backdrop {
    align-items: center;
    padding: 24px;
  }

  .modal-sheet {
    border-radius: var(--radius-lg);
    max-height: 82vh;
    transform: scale(0.95);
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .sheet-drag-handle {
    display: none;
  }

  .modal-backdrop.open .modal-sheet {
    transform: scale(1);
  }
}


/* ==================== ORDERS REVIEW STYLES ==================== */
.orders-review-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-review-card {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}

.order-review-card:active {
  background-color: #fafaf9;
  border-color: #cbd5e1;
}

.order-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.order-review-id {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

.order-review-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.order-review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

.order-review-total {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.order-review-action {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Status Filter Pill Active */
.quick-note-chip.active-filter {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

/* ==================== MANDATORY LOGIN & AUTH SELECTORS ==================== */
.login-required-banner {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 10px 14px;
  border-radius: var(--radius-md, 12px);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.auth-branch-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.auth-branch-selector::-webkit-scrollbar {
  display: none;
}

.auth-branch-chip {
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #ffffff);
  color: var(--text-muted, #64748b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.auth-branch-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.auth-branch-chip.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(74, 124, 89, 0.3);
}

/* Khi modal ở chế độ bắt buộc, không cho đóng */
.modal-backdrop.is-mandatory #authCloseModalBtn {
  display: none !important;
}
.modal-backdrop.is-mandatory .sheet-drag-handle {
  opacity: 0.3;
}

/* Empty state khi chưa đăng nhập */
.require-login-box {
  background: #ffffff;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg, 16px);
  padding: 48px 24px;
  text-align: center;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.require-login-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.require-login-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}
.require-login-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto 20px;
  line-height: 1.5;
}
