/**
 * MMMenu - Main Stylesheet (Core)
 * Mobile-first, Material Design-inspired
 *
 * This file contains core styles, variables, reset, buttons, and layout utilities.
 * Component-specific and section-specific styles are in separate files.
 */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */

:root {
  /* Colors (reference accent-colors.css for themeable colors) */
  --text-primary: #212121;
  --text-secondary: #616161;
  /* Improved from #757575 for better contrast */
  --text-disabled: #9e9e9e;
  --text-inverse: #ffffff;

  --background-color: #fafafa;
  --surface-color: #ffffff;
  --divider-color: #e0e0e0;

  /* Semantic colors (WCAG AA compliant) */
  --error-color: #d32f2f;
  --error-bg: #ffebee;
  --success-color: #2e7d32;
  /* Improved from #388e3c for better contrast */
  --success-bg: #e8f5e9;
  --warning-color: #f57c00;
  --warning-bg: #fff3e0;
  --info-color: #0277bd;
  /* Improved from #0288d1 for better contrast */
  --info-bg: #e1f5fe;

  /* Button colors */
  --btn-primary-bg: var(--accent-color, #1976d2);
  --btn-primary-text: #ffffff;
  --btn-primary-hover: var(--accent-color-dark, #1565c0);
  --btn-secondary-bg: #f5f5f5;
  --btn-secondary-text: #424242;
  /* Improved contrast */
  --btn-secondary-hover: #eeeeee;
  --btn-text-hover: rgba(0, 0, 0, 0.08);

  /* Focus ring (for accessibility) */
  --focus-ring: 0 0 0 3px rgba(25, 118, 210, 0.3);
  --focus-ring-error: 0 0 0 3px rgba(211, 47, 47, 0.3);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;

  /* Modal-specific spacing tokens (8/16/24/32px scale per FR8) */
  --modal-spacing-xs: 8px;
  --modal-spacing-sm: 16px;
  --modal-spacing-md: 24px;
  --modal-spacing-lg: 32px;
  --modal-header-height: 56px;
  --modal-header-height-mobile: 48px;
  --separator-color: rgba(0, 0, 0, 0.12);

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-round: 50%;

  /* Shadows (Material Design elevation) */
  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-2: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
  --shadow-3: 0 10px 20px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.10);
  --shadow-4: 0 14px 28px rgba(0, 0, 0, 0.20), 0 5px 10px rgba(0, 0, 0, 0.15);
  --shadow-5: 0 19px 38px rgba(0, 0, 0, 0.25), 0 7px 15px rgba(0, 0, 0, 0.18);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-family-base: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;

  /* Z-index layers */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-tooltip: 1060;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family, var(--font-family-base));
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Smooth transitions for theme changes */
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Add transition to all elements for smooth theme switching */
* {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-duration: var(--transition-normal);
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Exclude animations and transforms from global transition */
*:not([class*="animate"]):not([class*="product-card"]) {
  transition-property: background-color, border-color, color, fill, stroke, box-shadow;
}

/* ============================================================================
   ACCESSIBILITY - SCREEN READER ONLY
   ============================================================================ */

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

/* When focused, sr-only-focusable becomes visible again */
.sr-only-focusable:focus,
.sr-only-focusable:focus-visible {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: var(--spacing-sm) var(--spacing-md);
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  z-index: var(--z-tooltip, 1060);
  background: var(--primary-color, #1976d2);
  color: var(--primary-contrast, #ffffff);
  font-size: var(--font-size-base);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-3);
  border-radius: 0 0 var(--radius-md) 0;
}

/* ============================================================================
   ACCESSIBILITY - FOCUS RINGS
   ============================================================================ */

/* Focus-visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary-color, #1976d2);
  outline-offset: 2px;
}

/* Remove default outline only for mouse clicks, not keyboard */
*:focus:not(:focus-visible) {
  outline: none;
}

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

/* ============================================================================
   SHARED BUTTON CLASSES (DX Improvement)
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 10px 20px;
  border: none;
  border-radius: var(--btn-radius, var(--radius-md));
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary button */
.btn-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: var(--shadow-1);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--btn-primary-hover);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  box-shadow: var(--shadow-1);
  transform: translateY(0);
}

/* Secondary button */
.btn-secondary {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid var(--divider-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--btn-secondary-hover);
  border-color: var(--text-secondary);
}

/* Text button (no background) */
.btn-text {
  background-color: transparent;
  color: var(--accent-color, #1976d2);
  padding: 8px 16px;
}

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

/* Icon button - 44px minimum for WCAG touch target */
.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-round);
}

.btn-icon .material-icons {
  font-size: 24px;
}

/* Button sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: var(--font-size-lg);
}

/* Button with loading state */
.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: btn-spin 0.6s linear infinite;
  color: var(--btn-primary-text);
}

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

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

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

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

a:hover {
  color: var(--primary-dark);
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
}

.main-content {
  flex: 1;
  background: var(--gradient-subtle);
  position: relative;
}

/* Add subtle pattern overlay for visual interest */
.main-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(var(--primary-rgb), 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(var(--secondary-rgb), 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.main-content>* {
  position: relative;
  z-index: 1;
}

/* ============================================================================
   BANNERS
   ============================================================================ */

/* .ordering-disabled-banner styles are inline or handled by .sticky-header-group context */

/* ============================================================================
   LOADING & EMPTY STATES
   ============================================================================ */

.loading-state,
.empty-state {
  text-align: center;
  padding: var(--spacing-xxl) var(--spacing-lg);
  color: var(--text-secondary);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--divider-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--spacing-md);
}

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

.empty-icon {
  font-size: 64px;
  color: var(--divider-color);
  display: block;
  margin-bottom: var(--spacing-md);
}

/* ============================================================================
   DARK THEME
   ============================================================================ */

.dark-theme {
  /* Improved contrast for WCAG AA */
  --text-primary: #f5f5f5;
  /* Improved from #e0e0e0 */
  --text-secondary: #b8b8b8;
  /* Improved from #b0b0b0 */
  --text-disabled: #808080;
  /* Improved from #757575 */
  --text-inverse: #121212;

  --background-color: #121212;
  --surface-color: #1e1e1e;
  --divider-color: #3a3a3a;
  /* Improved from #2e2e2e */

  /* Button colors for dark mode */
  --btn-secondary-bg: #2a2a2a;
  --btn-secondary-text: #e8e8e8;
  --btn-secondary-hover: #353535;

  /* Focus ring for dark mode */
  --focus-ring: 0 0 0 3px rgba(66, 165, 245, 0.4);

  /* Semantic colors adjusted for dark mode */
  --error-bg: #3a1616;
  --success-bg: #1b3620;
  --warning-bg: #3d2816;
  --info-bg: #142938;

  /* Darker shadows for dark mode */
  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 3px 6px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.6);
  --shadow-3: 0 10px 20px rgba(0, 0, 0, 0.6), 0 3px 6px rgba(0, 0, 0, 0.7);
  --shadow-4: 0 14px 28px rgba(0, 0, 0, 0.7), 0 5px 10px rgba(0, 0, 0, 0.8);
  --shadow-5: 0 19px 38px rgba(0, 0, 0, 0.8), 0 7px 15px rgba(0, 0, 0, 0.9);

  /* Modal separator for dark mode (white 12% instead of black 12%) */
  --separator-color: rgba(255, 255, 255, 0.12);
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Skip to main content link - visible styles handled by .sr-only-focusable:focus */
.skip-link:focus,
.skip-link:focus-visible {
  outline: 2px solid var(--primary-contrast, #ffffff);
  outline-offset: -2px;
}

/* Reduced motion - disable animations for users who prefer it */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Windows High Contrast Mode support */
@media (forced-colors: active) {
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-text,
  .btn-icon {
    border: 1px solid ButtonText;
  }

  .btn-primary {
    background: ButtonFace;
    color: ButtonText;
  }

  .btn:disabled {
    opacity: 1;
    color: GrayText;
    border-color: GrayText;
  }

  *:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }

  .sr-only-focusable:focus {
    background: Highlight;
    color: HighlightText;
  }

  .spinner {
    border-color: ButtonText;
    border-top-color: Highlight;
  }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {

  .app-header,
  .categories-nav,
  .filters-section,
  .floating-cart,
  .search-section {
    display: none;
  }

  .product-card {
    break-inside: avoid;
  }
}

/* ============================================================================
   ORDER FLOW WIZARD (Module 2 - Online Ordering)
   ============================================================================ */

/* Overlay */
.c-order-flow-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Modal */
.c-order-flow-modal {
  background: var(--surface-color, #fff);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* Header */
.c-order-flow-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider-color, #e0e0e0);
  gap: 8px;
}

.c-order-flow-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  text-align: center;
}

.c-order-flow-back-btn,
.c-order-flow-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  color: var(--text-secondary, #616161);
  display: flex;
  align-items: center;
  justify-content: center;
}

.c-order-flow-back-btn:hover,
.c-order-flow-close-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* Content */
.c-order-flow-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}

/* Footer */
.c-order-flow-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--divider-color, #e0e0e0);
  display: flex;
  justify-content: flex-end;
}

.c-order-flow-next-btn {
  min-width: 140px;
}

.c-order-flow-place-order-btn {
  width: 100%;
  font-size: 16px;
  padding: 12px;
}

/* Progress Bar */
.c-order-flow-progress {
  padding: 12px 16px 0;
}

.c-order-flow-progress-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4px;
  background: var(--divider-color, #e0e0e0);
  border-radius: 2px;
}

.c-order-flow-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--accent-color, #1976d2);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.c-order-flow-progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--divider-color, #e0e0e0);
  z-index: 1;
  transition: background 0.3s ease;
}

.c-order-flow-progress-dot.active,
.c-order-flow-progress-dot.completed {
  background: var(--accent-color, #1976d2);
}

/* Step Container */
.c-order-flow-step {
  animation: oflow-fadein 0.2s ease;
}

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

.c-order-flow-step-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
}

.c-order-flow-step-desc {
  color: var(--text-secondary);
  margin: 0 0 16px;
}

/* Mode Selection Cards */
.c-order-flow-mode-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.c-order-flow-mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  border: 2px solid var(--divider-color, #e0e0e0);
  border-radius: 12px;
  background: var(--surface-color, #fff);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}

.c-order-flow-mode-card:hover {
  border-color: var(--accent-color, #1976d2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.c-order-flow-mode-card .material-icons {
  font-size: 40px;
  color: var(--accent-color, #1976d2);
}

.c-order-flow-mode-label {
  font-size: 18px;
  font-weight: 600;
}

.c-order-flow-mode-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.c-order-flow-mode-card--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  border-style: dashed;
}

.c-order-flow-mode-card--disabled .material-icons {
  color: var(--text-secondary, #999);
}

.c-order-flow-mode-card--disabled .c-order-flow-mode-desc {
  font-style: italic;
  color: var(--error-color, #d32f2f);
  opacity: 0.85;
}

/* Form Elements */
.c-order-flow-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.c-order-flow-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.c-order-flow-form-row--triple {
  grid-template-columns: 1fr 1fr 1fr;
}

.c-order-flow-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.c-order-flow-form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.c-order-flow-form-group input,
.c-order-flow-form-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--divider-color, #e0e0e0);
  border-radius: 8px;
  font-size: 15px;
  background: var(--surface-color, #fff);
  color: var(--text-primary);
  font-family: inherit;
}

.c-order-flow-form-group input:focus,
.c-order-flow-form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color, #1976d2);
  box-shadow: var(--focus-ring);
}

.c-order-flow-field-error {
  color: var(--error-color, #d32f2f);
  font-size: 13px;
  margin: 2px 0 0;
}

/* Coverage Check Button */
.c-order-flow-check-coverage {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
}

/* Delivery Coverage Result */
.c-delivery-result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  margin-top: 8px;
}

.c-delivery-result--covered {
  background: var(--success-bg, #e8f5e9);
  color: var(--success-color, #2e7d32);
}

.c-delivery-result--covered .material-icons {
  color: var(--success-color, #2e7d32);
  font-size: 28px;
}

.c-delivery-result--not-covered {
  background: var(--error-bg, #ffebee);
  color: var(--error-color, #d32f2f);
}

.c-delivery-result--not-covered .material-icons {
  color: var(--error-color, #d32f2f);
  font-size: 28px;
}

.c-delivery-result p {
  margin: 4px 0 0;
  font-size: 13px;
}

/* OTP Input */
.c-otp-input-container {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.c-otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  border: 2px solid var(--divider-color, #e0e0e0);
  border-radius: 10px;
  background: var(--surface-color, #fff);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.c-otp-input:focus {
  outline: none;
  border-color: var(--accent-color, #1976d2);
  box-shadow: var(--focus-ring);
}

.c-otp-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.c-otp-actions .btn-primary {
  min-width: 160px;
}

/* Time Slot Grid */
.c-time-slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.c-time-slot-pill {
  padding: 10px 16px;
  border: 1px solid var(--divider-color, #e0e0e0);
  border-radius: 20px;
  background: var(--surface-color, #fff);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.c-time-slot-pill:hover {
  border-color: var(--accent-color, #1976d2);
  background: rgba(25, 118, 210, 0.04);
}

.c-time-slot-pill--selected {
  background: var(--accent-color, #1976d2);
  color: #fff;
  border-color: var(--accent-color, #1976d2);
}

/* Order Summary */
.c-order-summary-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.c-order-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.c-order-type-badge--takeaway {
  background: #e3f2fd;
  color: #1565c0;
}

.c-order-type-badge--delivery {
  background: #fce4ec;
  color: #c62828;
}

.c-order-summary-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.c-order-summary-time .material-icons {
  font-size: 18px;
}

.c-order-summary-address {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.c-order-summary-address .material-icons {
  font-size: 18px;
}

.c-order-summary-items {
  border-top: 1px solid var(--divider-color);
  border-bottom: 1px solid var(--divider-color);
  padding: 8px 0;
  margin-bottom: 12px;
}

.c-order-summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.c-order-summary-item-qty {
  color: var(--text-secondary);
  font-size: 14px;
  min-width: 28px;
}

.c-order-summary-item-name {
  flex: 1;
  font-size: 14px;
}

.c-order-summary-item-price {
  font-size: 14px;
  font-weight: 500;
}

.c-order-summary-totals {
  margin-bottom: 16px;
}

.c-order-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}

.c-order-summary-row--total {
  font-size: 16px;
  font-weight: 700;
  padding-top: 8px;
  border-top: 1px solid var(--divider-color);
  margin-top: 4px;
}

/* Consent in order flow */
.c-order-flow-consent {
  margin-top: 12px;
}

.c-order-flow-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

.c-order-flow-consent-label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

/* Loading within wizard */
.c-order-flow-loading {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.c-order-flow-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 20px 0;
}

/* ============================================================================
   ORDER FLOW - DARK MODE
   ============================================================================ */

.dark-theme .c-order-flow-modal {
  background: var(--surface-color, #1e1e1e);
}

.dark-theme .c-order-flow-mode-card {
  border-color: var(--divider-color, #333);
  background: var(--surface-color, #1e1e1e);
}

.dark-theme .c-order-flow-mode-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.dark-theme .c-otp-input {
  background: var(--surface-color, #1e1e1e);
  border-color: var(--divider-color, #333);
  color: var(--text-primary, #fff);
}

.dark-theme .c-time-slot-pill {
  background: var(--surface-color, #1e1e1e);
  border-color: var(--divider-color, #333);
  color: var(--text-primary, #fff);
}

.dark-theme .c-order-flow-form-group input,
.dark-theme .c-order-flow-form-group textarea {
  background: var(--surface-color, #1e1e1e);
  border-color: var(--divider-color, #333);
  color: var(--text-primary, #fff);
}

/* ============================================================================
   ORDER FLOW - RTL
   ============================================================================ */

[dir="rtl"] .c-order-flow-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .c-order-flow-back-btn .material-icons {
  transform: scaleX(-1);
}

[dir="rtl"] .c-order-flow-footer {
  justify-content: flex-start;
}

[dir="rtl"] .c-otp-input-container {
  direction: ltr;
}

/* ============================================================================
   ORDER FLOW - MOBILE RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
  .c-order-flow-overlay {
    padding: 0;
    align-items: stretch;
  }

  .c-order-flow-modal {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    height: 100vh;
    height: 100dvh;
  }

  .c-order-flow-form-row {
    grid-template-columns: 1fr;
  }

  .c-order-flow-form-row--triple {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .c-otp-input {
    width: 42px;
    height: 50px;
    font-size: 20px;
  }
}

/* ============================================================================
   PAT (Pay at Table) - Customer Styles
   ============================================================================ */

.c-pat-join-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.c-pat-join-modal {
  background: var(--bg-primary, #fff);
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.c-pat-join-modal h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
}

.c-pat-join-modal .c-pat-table-name {
  font-size: 1.1rem;
  color: var(--text-secondary, #666);
  margin-bottom: 24px;
}

.c-pat-form-group {
  margin-bottom: 16px;
  text-align: start;
}

.c-pat-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.c-pat-form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.c-pat-form-group input:focus {
  outline: none;
  border-color: var(--primary-color, #4f46e5);
}

.c-pat-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: var(--primary-color, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.c-pat-btn-primary:hover { opacity: 0.9; }
.c-pat-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.c-pat-otp-container {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
}

.c-pat-otp-container .c-otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
}

.c-pat-otp-container .c-otp-input:focus {
  border-color: var(--primary-color, #4f46e5);
}

.c-pat-join-success {
  padding: 24px 0;
}

.c-pat-join-success .material-icons {
  font-size: 64px;
  color: #22c55e;
}

.c-pat-back-to-menu {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  color: var(--text-secondary, #616161);
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
}
.c-pat-back-to-menu:hover {
  color: var(--text-primary, #212121);
}
.c-pat-back-to-menu .material-icons {
  font-size: 18px;
}

.c-pat-no-session {
  padding: 16px;
  background: #fef3c7;
  border-radius: 10px;
  color: #92400e;
  margin-bottom: 20px;
}

/* ---- Bill View — Bottom Drawer ---- */

.c-pat-bill-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.c-pat-bill-modal {
  background: var(--bg-primary, #fff);
  border-radius: 20px 20px 0 0;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: c-pat-slide-up 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.15);
}

@keyframes c-pat-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Header */
.c-pat-bill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-color, #f0f0f0);
  flex-shrink: 0;
}

.c-pat-bill-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #111);
}

.c-pat-bill-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  color: var(--text-secondary, #666);
  transition: background 0.15s;
}

.c-pat-bill-close:hover {
  background: var(--hover-bg, rgba(0, 0, 0, 0.06));
}

/* Body — scrollable content */
.c-pat-bill-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 24px;
  -webkit-overflow-scrolling: touch;
}

/* Footer — sticky pay button */
.c-pat-bill-footer {
  flex-shrink: 0;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border-color, #f0f0f0);
}

.c-pat-pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--primary-color, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.c-pat-pay-btn:hover { opacity: 0.9; }
.c-pat-pay-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Guest groups ---- */

.c-pat-bill-guest-group {
  margin-bottom: 20px;
}

.c-pat-bill-guest-chip {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-color, #4f46e5);
  background: rgba(79, 70, 229, 0.08);
  margin-bottom: 10px;
}

/* ---- Item rows ---- */

.c-pat-bill-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color, #f0f0f0);
  gap: 12px;
}

.c-pat-bill-item:last-child {
  border-bottom: none;
}

.c-pat-bill-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.c-pat-bill-item-name {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary, #111);
}

.c-pat-bill-item-qty {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #666);
  margin-left: 4px;
}

.c-pat-bill-item-mods {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary, #888);
  line-height: 1.3;
}

.c-pat-bill-item-total {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary, #111);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 1px;
}

/* Voided items */
.c-pat-bill-item--voided .c-pat-bill-item-name,
.c-pat-bill-item--voided .c-pat-bill-item-total {
  text-decoration: line-through;
  opacity: 0.5;
}

.c-pat-bill-voided-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #ef4444;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  text-decoration: none;
}

/* ---- Payments section ---- */

.c-pat-bill-payments {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color, #f0f0f0);
}

.c-pat-bill-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary, #888);
  margin: 0 0 10px;
}

.c-pat-bill-payment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f0fdf4;
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.c-pat-bill-payment-icon {
  font-size: 18px;
  color: #16a34a;
  flex-shrink: 0;
}

.c-pat-bill-payment-name {
  flex: 1;
  color: var(--text-primary, #111);
}

.c-pat-bill-payment-amount {
  font-weight: 600;
  color: #16a34a;
  white-space: nowrap;
}

/* ---- Progress bar ---- */

.c-pat-bill-progress {
  margin: 16px 0 8px;
  height: 8px;
  background: var(--border-color, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
}

.c-pat-bill-progress-bar {
  height: 100%;
  background: #22c55e;
  border-radius: 8px;
  transition: width 0.4s ease;
  min-width: 0;
}

/* ---- Summary ---- */

.c-pat-bill-summary {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 2px solid var(--border-color, #e5e7eb);
}

.c-pat-bill-subtotal,
.c-pat-bill-paid,
.c-pat-bill-remaining {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.92rem;
  color: var(--text-primary, #333);
}

.c-pat-bill-subtotal {
  color: var(--text-secondary, #666);
}

.c-pat-bill-paid {
  color: #16a34a;
}

.c-pat-bill-remaining {
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid var(--border-color, #f0f0f0);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-color, #4f46e5);
}

.c-pat-bill-remaining strong {
  font-size: 1.15rem;
}

/* ---- State displays ---- */

.c-pat-bill-loading,
.c-pat-bill-closed,
.c-pat-bill-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary, #666);
}

.c-pat-bill-loading .material-icons { font-size: 32px; color: var(--primary-color, #4f46e5); }
.c-pat-bill-closed .material-icons { font-size: 48px; color: #22c55e; }
.c-pat-bill-error .material-icons  { font-size: 48px; color: #ef4444; }

/* Session ended overlay */
.c-pat-session-ended-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c-pat-session-ended-content {
  text-align: center;
  color: #fff;
  padding: 32px;
}

.c-pat-session-ended-content .material-icons {
  font-size: 72px;
  color: #22c55e;
  margin-bottom: 16px;
}

.c-pat-session-ended-content h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

/* ---- Pay modal ---- */

.c-pat-pay-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.c-pat-pay-modal {
  background: var(--bg-primary, #fff);
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.c-pat-pay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-color, #f0f0f0);
}

.c-pat-pay-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.c-pat-pay-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  color: var(--text-secondary, #666);
  transition: background 0.15s;
}

.c-pat-pay-close:hover {
  background: var(--hover-bg, rgba(0, 0, 0, 0.06));
}

.c-pat-pay-body {
  padding: 24px;
}

.c-pat-pay-remaining {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(79, 70, 229, 0.06);
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.c-pat-pay-remaining span {
  color: var(--text-secondary, #666);
}

.c-pat-pay-remaining strong {
  font-size: 1.2rem;
  color: var(--primary-color, #4f46e5);
}

.c-pat-pay-full-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  background: var(--primary-color, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.c-pat-pay-full-btn:hover { opacity: 0.9; }
.c-pat-pay-full-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.c-pat-pay-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-secondary, #aaa);
  font-size: 0.82rem;
}

.c-pat-pay-divider::before,
.c-pat-pay-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color, #e5e7eb);
}

.c-pat-pay-custom {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.c-pat-pay-custom label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary, #666);
}

.c-pat-pay-amount-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  font-size: 1.2rem;
  text-align: center;
  font-weight: 700;
  box-sizing: border-box;
  color: var(--text-primary, #111);
  background: var(--bg-primary, #fff);
  transition: border-color 0.15s;
}

.c-pat-pay-amount-input:focus {
  outline: none;
  border-color: var(--primary-color, #4f46e5);
}

.c-pat-pay-custom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  border: 2px solid var(--primary-color, #4f46e5);
  background: transparent;
  color: var(--primary-color, #4f46e5);
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.c-pat-pay-custom-btn:hover {
  background: var(--primary-color, #4f46e5);
  color: #fff;
}

.c-pat-pay-custom-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* SSE status indicator */
.c-pat-sse-status {
  position: fixed;
  bottom: 140px;
  right: 16px;
  z-index: 7999;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.c-pat-sse-status.connected { background: #dcfce7; color: #166534; }
.c-pat-sse-status.reconnecting { background: #fef3c7; color: #92400e; }
.c-pat-sse-status.disconnected { background: #fee2e2; color: #991b1b; }

/* ============================================================================
   PAT - Dark Mode
   ============================================================================ */

.dark-theme .c-pat-join-modal {
  background: var(--surface-color, #1e1e1e);
}

.dark-theme .c-pat-form-group input {
  background: var(--surface-color, #1e1e1e);
  border-color: var(--divider-color, #333);
  color: var(--text-primary, #fff);
}

.dark-theme .c-pat-otp-container .c-otp-input {
  background: var(--surface-color, #1e1e1e);
  border-color: var(--divider-color, #333);
  color: var(--text-primary, #fff);
}

.dark-theme .c-pat-no-session {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.dark-theme .c-pat-bill-modal {
  background: var(--surface-color, #1e1e1e);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.4);
}

.dark-theme .c-pat-bill-header {
  border-bottom-color: var(--divider-color, #333);
}

.dark-theme .c-pat-bill-guest-chip {
  background: rgba(79, 70, 229, 0.15);
  color: #a5b4fc;
}

.dark-theme .c-pat-bill-item {
  border-bottom-color: var(--divider-color, #333);
}

.dark-theme .c-pat-bill-payment {
  background: rgba(16, 185, 129, 0.1);
}

.dark-theme .c-pat-bill-payment-icon { color: #4ade80; }
.dark-theme .c-pat-bill-payment-amount { color: #4ade80; }

.dark-theme .c-pat-bill-progress {
  background: var(--divider-color, #333);
}

.dark-theme .c-pat-bill-summary {
  border-top-color: var(--divider-color, #333);
}

.dark-theme .c-pat-bill-remaining {
  border-top-color: var(--divider-color, #333);
  color: #a5b4fc;
}

.dark-theme .c-pat-bill-footer {
  border-top-color: var(--divider-color, #333);
}

.dark-theme .c-pat-pay-modal {
  background: var(--surface-color, #1e1e1e);
}

.dark-theme .c-pat-pay-header {
  border-bottom-color: var(--divider-color, #333);
}

.dark-theme .c-pat-pay-remaining {
  background: rgba(79, 70, 229, 0.12);
}

.dark-theme .c-pat-pay-remaining strong { color: #a5b4fc; }

.dark-theme .c-pat-pay-amount-input {
  background: var(--surface-color, #1e1e1e);
  border-color: var(--divider-color, #333);
  color: var(--text-primary, #fff);
}

.dark-theme .c-pat-pay-divider {
  color: var(--text-secondary, #888);
}

.dark-theme .c-pat-pay-divider::before,
.dark-theme .c-pat-pay-divider::after {
  background: var(--divider-color, #333);
}

.dark-theme .c-pat-pay-custom-btn {
  border-color: #a5b4fc;
  color: #a5b4fc;
}

.dark-theme .c-pat-pay-custom-btn:hover {
  background: #a5b4fc;
  color: #1e1e1e;
}

/* ============================================================================
   PAT - RTL
   ============================================================================ */


[dir="rtl"] .c-pat-sse-status {
  right: auto;
  left: 16px;
}

[dir="rtl"] .c-pat-bill-item-qty {
  margin-left: 0;
  margin-right: 4px;
}

[dir="rtl"] .c-pat-otp-container {
  direction: ltr;
}

/* ============================================================================
   INTENT PICKER
   ============================================================================ */

.c-intent-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 16px;
}

.c-intent-picker-modal {
  background: var(--surface-color, #fff);
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.c-intent-picker-title {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 20px;
  color: var(--text-primary);
}

.c-intent-picker-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.c-intent-picker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid var(--divider-color, #e0e0e0);
  border-radius: 12px;
  padding: 20px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
  font-family: inherit;
}

.c-intent-picker-card:hover,
.c-intent-picker-card:focus-visible {
  border-color: var(--accent-color, #1976d2);
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.15);
}

.c-intent-picker-card .material-icons {
  font-size: 40px;
  color: var(--accent-color, #1976d2);
  margin-bottom: 8px;
}

.c-intent-picker-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.c-intent-picker-card-desc {
  font-size: 14px;
  color: var(--text-secondary, #616161);
}

.c-intent-picker-browse {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 16px;
  color: var(--text-secondary, #616161);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  padding: 8px;
}

.c-intent-picker-browse:hover {
  color: var(--accent-color, #1976d2);
  text-decoration: underline;
}

/* Dark mode */
.dark-theme .c-intent-picker-modal {
  background: var(--surface-color, #1e1e1e);
}

.dark-theme .c-intent-picker-card {
  border-color: var(--divider-color, #333);
}

.dark-theme .c-intent-picker-card:hover,
.dark-theme .c-intent-picker-card:focus-visible {
  border-color: var(--accent-color, #64b5f6);
  box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.15);
}

/* Mobile full-screen */
@media (max-width: 768px) {
  .c-intent-picker-modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* ============================================================================
   ENTER TABLE CODE VIEW
   ============================================================================ */

.c-enter-table-code-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 20px;
}
.c-enter-table-code-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 40px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.c-enter-table-code-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
}
.c-enter-table-code-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.c-enter-table-code-desc {
  color: var(--text-secondary);
  margin: 0 0 24px;
}
.c-enter-table-code-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 300px;
}
.c-enter-table-code-input {
  padding: 14px 16px;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  font-size: 1.1rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: var(--card-bg, #fff);
  color: var(--text-primary);
}
.c-enter-table-code-input:focus {
  border-color: var(--accent-color, #1976d2);
  outline: none;
}
.c-enter-table-code-submit {
  padding: 14px;
  font-size: 1rem;
}
.c-enter-table-code-back {
  margin-top: 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}
.c-enter-table-code-back:hover {
  color: var(--accent-color, #1976d2);
}

/* Dark theme */
.dark-theme .c-enter-table-code-card {
  background: var(--card-bg, #1e1e1e);
}
.dark-theme .c-enter-table-code-input {
  background: var(--surface-color, #2a2a2a);
  border-color: var(--border-color, #374151);
}

/* VIEW mode: hide ordering UI */
.view-mode .quick-add-btn,
.view-mode #add-to-cart-btn,
.view-mode #floating-cart {
  display: none !important;
}

/* ============================================================================
   CART TABLE-MODE FOOTER
   ============================================================================ */

.c-cart-table-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.c-cart-table-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.c-cart-table-actions .btn {
  width: 100%;
}

/* ============================================================================
   MODE BADGE
   ============================================================================ */

.c-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 16px;
  background: rgba(25, 118, 210, 0.1);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.c-mode-badge-change {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--accent-color, #1976d2);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.c-mode-badge-change:hover {
  text-decoration: underline;
}

.dark-theme .c-mode-badge {
  background: rgba(100, 181, 246, 0.15);
}

/* Demo payment mode inputs */
.c-checkout-demo-input {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 16px;
  padding: 0;
  color: var(--text-primary);
}
.c-checkout-demo-badge {
  color: #f59e0b;
}