/* ===================================
   Aurora Restaurant - Design System
   Premium Mobile-First Ordering UI
   =================================== */

/* --- CSS Variables / Design Tokens --- */
:root {
  /* Colors - Refined warm palette */
  --color-bg: #faf9f7;
  --color-bg-elevated: #ffffff;
  --color-bg-subtle: #f5f3f0;
  --color-bg-muted: #eae7e2;
  
  --color-text: #1a1714;
  --color-text-secondary: #6b635a;
  --color-text-muted: #9c9488;
  --color-text-inverse: #ffffff;
  
  --color-primary: #8b7355;
  --color-primary-hover: #7a6549;
  --color-primary-light: rgba(139, 115, 85, 0.1);
  
  --color-accent: #2d5a47;
  --color-accent-hover: #244939;
  --color-accent-light: rgba(45, 90, 71, 0.1);
  
  --color-border: rgba(26, 23, 20, 0.08);
  --color-border-strong: rgba(26, 23, 20, 0.15);
  
  --color-success: #2d5a47;
  --color-warning: #c4841d;
  --color-error: #b54242;
  
  --color-overlay: rgba(26, 23, 20, 0.5);
  
  /* Typography */
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  
  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(26, 23, 20, 0.04);
  --shadow-md: 0 4px 12px rgba(26, 23, 20, 0.08);
  --shadow-lg: 0 8px 24px rgba(26, 23, 20, 0.12);
  --shadow-xl: 0 16px 48px rgba(26, 23, 20, 0.16);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* Layout */
  --header-height: 64px;
  --bottom-nav-height: 72px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

input {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

/* --- Utility Classes --- */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Loading Screen --- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg);
}

.loading-content {
  text-align: center;
}

.loading-logo {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-6);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* --- App Container --- */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--space-5);
  max-width: 640px;
  margin: 0 auto;
}

.brand-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.header-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.table-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.table-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.session-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-bg-subtle);
  border-radius: var(--radius-full);
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* --- Buffet Banner --- */
.buffet-banner {
  background: linear-gradient(135deg, var(--color-accent) 0%, #3d7a60 100%);
  padding: var(--space-3) var(--space-5);
}

.buffet-banner-content {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 640px;
  margin: 0 auto;
}

.buffet-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: var(--color-text-inverse);
}

.buffet-banner-text {
  display: flex;
  flex-direction: column;
}

.buffet-banner-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-inverse);
}

.buffet-banner-package {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.8);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-5);
}

.section {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  margin-bottom: var(--space-6);
  text-align: center;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* --- Order Type Selection --- */
.order-type-cards {
  display: grid;
  gap: var(--space-4);
}

.order-type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-8) var(--space-6);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: center;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.order-type-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.order-type-card:active {
  transform: translateY(0);
}

.order-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background-color: var(--color-primary-light);
  border-radius: var(--radius-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.order-type-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.order-type-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.order-type-cta {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
}

/* --- Menu Section --- */
.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text);
  transition: background-color var(--transition-fast);
}

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

.menu-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
}

.menu-header-spacer {
  width: 40px;
}

/* --- Search --- */
.search-container {
  margin-bottom: var(--space-5);
}

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

.search-icon {
  position: absolute;
  left: var(--space-4);
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: calc(var(--space-4) + 18px + var(--space-3));
  background-color: var(--color-bg-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-input:focus {
  background-color: var(--color-bg-elevated);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.clear-search {
  position: absolute;
  right: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.clear-search:hover {
  background-color: var(--color-bg-muted);
  color: var(--color-text);
}

/* --- Categories --- */
.categories-scroll {
  margin: 0 calc(var(--space-5) * -1);
  padding: 0 var(--space-5);
  margin-bottom: var(--space-5);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.categories-list {
  display: flex;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
}

.category-btn {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.category-btn:hover {
  border-color: var(--color-border-strong);
}

.category-btn.active {
  background-color: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-text-inverse);
}

/* --- Menu Items --- */
.menu-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.menu-items {
  display: grid;
  gap: var(--space-4);
}

.menu-item-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.menu-item-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.menu-item-image {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-bg-subtle);
}

.menu-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-item-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.menu-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.menu-item-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-item-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-item-price {
  margin-top: auto;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-primary);
}

.menu-item-unavailable {
  opacity: 0.5;
  pointer-events: none;
}

.menu-item-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background-color: var(--color-error);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-inverse);
}

/* Category Section Headers */
.category-section {
  margin-bottom: var(--space-6);
}

.category-section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

/* --- Buffet Packages --- */
.buffet-packages {
  display: grid;
  gap: var(--space-5);
}

.buffet-package-card {
  position: relative;
  padding: var(--space-6);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
}

.buffet-package-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.buffet-package-card.popular {
  border-color: var(--color-accent);
}

.buffet-package-badge {
  position: absolute;
  top: calc(var(--space-4) * -1);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-1) var(--space-4);
  background-color: var(--color-accent);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-inverse);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.buffet-package-header {
  text-align: center;
  margin-bottom: var(--space-4);
}

.buffet-package-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.buffet-package-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.buffet-package-price {
  text-align: center;
  margin-bottom: var(--space-5);
}

.buffet-package-amount {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-primary);
}

.buffet-package-unit {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.buffet-package-features {
  list-style: none;
  margin-bottom: var(--space-5);
}

.buffet-package-features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.buffet-package-features li::before {
  content: '✓';
  flex-shrink: 0;
  color: var(--color-success);
  font-weight: 600;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary-light);
}

.buffet-package-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* ---- Buffet Confirm Modal ---- */
.buffet-confirm-content {
  padding: 0 var(--space-2) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.buffet-confirm-pkg-header {
  text-align: center;
  padding-top: var(--space-2);
}

.buffet-confirm-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-3);
  background: linear-gradient(135deg, #f5ede0, #e8d5b5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.buffet-confirm-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.buffet-confirm-pkg-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.buffet-confirm-badges {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.buffet-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background-color: #f0eae0;
  color: #7a5c38;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #e0d0b5;
}

.buffet-badge-green {
  background-color: #e8f5e9;
  color: #2e7d32;
  border-color: #c8e6c9;
}

/* Price info table */
.buffet-confirm-price-info {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.buffet-confirm-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.buffet-confirm-price-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.buffet-price-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.buffet-price-sublabel {
  font-size: 11px;
  color: var(--color-text-muted);
}

.buffet-price-tag {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  background: #f5ede0;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.buffet-price-tag-child {
  background: #e8f5e9;
  color: #2e7d32;
}

.buffet-free-note {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  text-align: center;
}

/* Guest count selectors */
.buffet-guest-selectors {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.buffet-guest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
}

.buffet-guest-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-secondary);
}

.buffet-guest-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.buffet-guest-note {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
}

.buffet-qty-selector {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.buffet-qty-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border-strong);
  color: var(--color-text);
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0;
}

.buffet-qty-btn:hover {
  background: var(--color-border);
}

.buffet-qty-btn-plus {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.buffet-qty-btn-plus:hover {
  background: var(--color-primary-dark, #5a3e28);
}

.buffet-qty-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  min-width: 28px;
  text-align: center;
}

/* Total summary box */
.buffet-confirm-total-box {
  background: linear-gradient(135deg, #3d2710 0%, #5c3d1e 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  color: white;
}

.buffet-total-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.buffet-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.buffet-total-row-label {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.75);
}

.buffet-total-row-val {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.9);
  font-weight: 500;
}

.buffet-total-divider {
  height: 1px;
  background: rgba(255,255,255,0.2);
  margin-bottom: var(--space-3);
}

.buffet-grand-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.buffet-grand-total-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.buffet-grand-total-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: #f5d49e;
  font-family: var(--font-display);
}

.buffet-total-note {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-top: var(--space-2);
}

/* Confirm action row */
.buffet-confirm-actions {
  display: flex;
  gap: var(--space-3);
}

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--color-border-strong);
  color: var(--color-text-secondary);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  background: var(--color-border);
}

/* ---- Buffet Menu Modal ---- */
.buffet-menu-detail-content {
  padding: var(--space-2) 0;
}

.buffet-menu-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
  max-height: 60vh;
  overflow-y: auto;
  padding: var(--space-2) 0;
}

.buffet-menu-items-list::-webkit-scrollbar {
  width: 4px;
}

.buffet-menu-items-list::-webkit-scrollbar-thumb {
  background-color: var(--color-border-strong);
  border-radius: var(--radius-full);
}

/* --- Cart Section --- */
.cart-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cart-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.cart-item-image {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-bg-subtle);
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.cart-item-price {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-primary);
}

.cart-item-price-buffet {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-free {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-success);
}

.price-original {
  font-size: 11px;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.cart-item-remove-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffebee;
  color: #d32f2f;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cart-item-remove-btn:hover {
  background-color: #ffcdd2;
  color: #b71c1c;
}

.cart-item-remove-btn svg {
  display: block;
}

.cart-item-remove {
  padding: var(--space-1);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.cart-item-remove:hover {
  color: var(--color-error);
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1);
  background-color: var(--color-bg-subtle);
  border-radius: var(--radius-md);
}

.quantity-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  transition: background-color var(--transition-fast);
}

.quantity-btn:hover {
  background-color: var(--color-bg-muted);
}

.quantity-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.quantity-value {
  min-width: 28px;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.cart-summary {
  padding: var(--space-4);
  background-color: var(--color-bg-subtle);
  border-radius: var(--radius-lg);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-total-label {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.cart-total-amount {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}

/* --- Orders Section --- */
.orders-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.session-summary-card {
  padding: var(--space-5);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.session-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.session-summary-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.payment-status {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.payment-status.unpaid {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.payment-status.pending {
  background-color: rgba(196, 132, 29, 0.1);
  color: var(--color-warning);
}

.payment-status.paid {
  background-color: var(--color-accent-light);
  color: var(--color-accent);
}

.session-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.order-card {
  padding: var(--space-4);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.order-card-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.order-id {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.order-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.order-status {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
}

.order-status.pending {
  background-color: rgba(196, 132, 29, 0.1);
  color: var(--color-warning);
}

.order-status.preparing {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.order-status.served {
  background-color: var(--color-accent-light);
  color: var(--color-accent);
}

.order-status.cancelled {
  background-color: rgba(181, 66, 66, 0.1);
  color: var(--color-error);
}

.order-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.order-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
}

.order-item-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.order-item-meta {
  display: flex;
  flex-direction: column;
}

.order-item-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 var(--space-2);
  background-color: var(--color-bg-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.order-item-name {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.order-item-status {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.order-item-status.delivered {
  color: var(--color-success);
}

.order-item-price {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.order-total-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.order-total-amount {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin-bottom: var(--space-5);
  background-color: var(--color-bg-subtle);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}

.empty-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.empty-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: var(--space-1);
  height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
  padding-bottom: var(--safe-area-bottom);
  background-color: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
}

.nav-item {
  flex: 1;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.nav-item:hover {
  color: var(--color-text-secondary);
}

.nav-item.active {
  color: var(--color-primary);
}

.nav-icon-wrapper {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-inverse);
}

.nav-label {
  font-size: var(--text-xs);
  font-weight: 500;
}

/* --- Sticky CTAs --- */
.cart-cta,
.payment-cta {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
  left: 0;
  right: 0;
  z-index: 99;
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(to top, var(--color-bg) 80%, transparent);
}

.cart-cta .btn,
.payment-cta .btn {
  display: flex;
  width: min(640px, 100%);
  margin: 0 auto;
}

.cart-cta-total {
  margin-left: var(--space-2);
  padding-left: var(--space-2);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

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

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-text-inverse);
}

.btn-accent:hover {
  background-color: var(--color-accent-hover);
}

.btn-outline {
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
}

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

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Modals --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background-color: var(--color-overlay);
  animation: fadeIn 0.2s ease;
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--color-bg-elevated);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 36px;
  height: 4px;
  margin: var(--space-3) auto;
  background-color: var(--color-bg-muted);
  border-radius: var(--radius-full);
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  z-index: 10;
}

.modal-close:hover {
  background-color: var(--color-bg-subtle);
  color: var(--color-text);
}

/* Food Modal */
.food-modal-content {
  padding: 0 var(--space-5) calc(var(--space-6) + var(--safe-area-bottom));
}

.food-modal-image {
  width: calc(100% + var(--space-5) * 2);
  height: 200px;
  margin: 0 calc(var(--space-5) * -1) var(--space-5);
  background-color: var(--color-bg-subtle);
  overflow: hidden;
}

.food-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.food-modal-info {
  margin-bottom: var(--space-6);
}

.food-modal-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.food-modal-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.food-modal-price {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
}

.food-modal-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.food-modal-actions .quantity-selector {
  background-color: var(--color-bg-subtle);
  padding: var(--space-2);
}

.food-modal-actions .quantity-btn {
  width: 36px;
  height: 36px;
}

.food-modal-actions .quantity-value {
  min-width: 40px;
  font-size: var(--text-base);
}

.food-modal-actions .btn {
  flex: 1;
}

/* Buffet Confirm Modal */
.buffet-confirm-content {
  padding: var(--space-6) var(--space-5) calc(var(--space-6) + var(--safe-area-bottom));
  text-align: center;
}

.buffet-confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-5);
  background-color: var(--color-accent-light);
  border-radius: var(--radius-full);
  color: var(--color-accent);
}

.buffet-confirm-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-5);
}

.buffet-confirm-details {
  padding: var(--space-4);
  background-color: var(--color-bg-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  text-align: left;
}

.buffet-confirm-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
}

.buffet-confirm-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.buffet-confirm-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

/* Payment Modal */
.payment-modal-content {
  padding: var(--space-6) var(--space-5) calc(var(--space-6) + var(--safe-area-bottom));
  text-align: center;
}

.payment-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-5);
  background-color: var(--color-accent-light);
  border-radius: var(--radius-full);
  color: var(--color-accent);
}

.payment-modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-5);
}

.payment-modal-info {
  padding: var(--space-4);
  background-color: var(--color-bg-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.payment-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payment-info-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.payment-info-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}

.payment-modal-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-5);
}

.sepay-qr-image {
  width: 220px;
  height: 220px;
  object-fit: contain;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 8px;
  border: 1px solid var(--color-border);
}

.sepay-pay-link {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: underline;
}

.sepay-qr-raw {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  word-break: break-all;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: calc(100% - var(--space-8));
  max-width: 400px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background-color: var(--color-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  color: var(--color-text-inverse);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast.toast-out {
  animation: toastOut 0.2s ease forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.toast-icon.success {
  color: #4ade80;
}

.toast-icon.error {
  color: #f87171;
}

.toast-icon.info {
  color: #60a5fa;
}

.toast-message {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 500;
}

/* --- Loading States --- */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-subtle) 25%, var(--color-bg-muted) 50%, var(--color-bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-card {
  height: 100px;
  border-radius: var(--radius-lg);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .header {
    height: auto;
  }

  .header-content {
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
  }

  .header-info {
    width: 100%;
    justify-content: space-between;
  }

  .table-info {
    align-items: flex-start;
  }
}

@media (min-width: 640px) {
  .order-type-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .menu-items {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-sheet {
    margin: auto;
    border-radius: var(--radius-2xl);
    max-height: 85vh;
  }
}

@media (min-width: 1024px) {
  .main-content {
    max-width: 960px;
  }
  
  .menu-items {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .buffet-packages {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Self-service Buffet Model 1 Styles */
.menu-item-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--color-primary);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.price-included {
  color: var(--color-success);
  font-weight: 700;
  font-size: 0.9em;
}

.food-modal-self-service {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background-color: #f0f7f0;
  border: 1px solid #c8e6c9;
  border-radius: var(--radius-lg);
}

.self-service-message {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #2e7d32;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
}

.self-service-message svg {
  flex-shrink: 0;
  color: #4caf50;
}

/* Buffet Invoice V2 Styles */
.order-card-buffet {
  border: 2px solid var(--color-primary) !important;
  background: linear-gradient(to bottom right, #ffffff, #fffdf8) !important;
  box-shadow: 0 4px 20px rgba(186, 155, 114, 0.12) !important;
}

.order-card-buffet .order-id {
  color: var(--color-primary);
  font-weight: 800;
}

.order-card-header .order-status.active {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.buffet-order-details {
  padding: var(--space-4) 0;
  border-top: 1px dashed var(--color-border);
  border-bottom: 1px dashed var(--color-border);
  margin: var(--space-4) 0;
}

.buffet-pkg-main {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.buffet-pkg-icon {
  width: 48px;
  height: 48px;
  background-color: #fcf6ec;
  color: var(--color-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f2e4d0;
}

.buffet-pkg-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.buffet-guest-pills {
  display: flex;
  gap: 8px;
}

.guest-pill {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.guest-pill.adults {
  background-color: #e8eaf6;
  color: #3f51b5;
}

.guest-pill.children {
  background-color: #f3e5f5;
  color: #9c27b0;
}

.buffet-expiry-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #fff9f0;
  color: #d84315;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #ffeecc;
}

.order-card-buffet-food {
  opacity: 0.85;
  border-style: dotted;
  background-color: #fafafa;
}
