/* ==========================================
   1. CORE VARIABLES & BASE STYLES
   ========================================== */
:root {
  /* Default Colors (Cafe Theme default) */
  --store-primary: #854d0e; /* Brown */
  --store-primary-rgb: 133, 77, 14;
  --store-accent: #eab308; /* Yellow */
  --store-bg: #fafaf9;
  --store-card-bg: #ffffff;
  --store-text: #1c1917;
  --store-text-muted: #78716c;
  --store-border: #e7e5e4;
  --store-overlay: rgba(0, 0, 0, 0.4);

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);

  color-scheme: light dark;
}

/* Theme Override: Burger Shop (Street Food) */
body.theme-burger {
  --store-primary: #dc2626; /* Vibrant Red */
  --store-primary-rgb: 220, 38, 38;
  --store-accent: #eab308; /* Yellow */
  --store-bg: #fef2f2;
  --store-card-bg: #ffffff;
  --store-text: #450a0a;
  --store-text-muted: #991b1b;
  --store-border: #fee2e2;
}

/* Theme Override: Pizza & Cocktails (Elegant Dark Emerald) */
body.theme-pizza {
  --store-primary: #10b981; /* Emerald */
  --store-primary-rgb: 16, 185, 129;
  --store-accent: #f59e0b; /* Amber Gold */
  --store-bg: #090d16;
  --store-card-bg: #111827;
  --store-text: #f3f4f6;
  --store-text-muted: #9ca3af;
  --store-border: #1f2937;
}

/* General Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--store-bg);
  color: var(--store-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--store-text);
}

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

/* Custom horizontal scroller helper */
.scroller {
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none; /* Hide scrollbars in mobile view */
}
.scroller::-webkit-scrollbar {
  display: none;
}

/* ==========================================
   2. MOBILE HEADER
   ========================================== */
.menu-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--store-card-bg);
  border-bottom: 1px solid var(--store-border);
  box-shadow: var(--shadow-sm);
  padding: 16px 16px 8px 16px;
}

.menu-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.store-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: rgba(var(--store-primary-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--store-primary);
  flex-shrink: 0;
}

.store-logo svg {
  width: 28px;
  height: 28px;
}

.store-brand h1 {
  font-size: 1.15rem;
  line-height: 1.2;
}

.store-brand p {
  font-size: 0.75rem;
  color: var(--store-text-muted);
}

.lang-toggle {
  padding: 6px 12px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  background-color: var(--store-border);
  color: var(--store-text);
  border: none;
  cursor: pointer;
}

.store-info-bar {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--store-border);
  scrollbar-width: none;
}
.store-info-bar::-webkit-scrollbar {
  display: none;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.725rem;
  color: var(--store-text-muted);
  background-color: var(--store-bg);
  padding: 4px 8px;
  border-radius: 50px;
  flex-shrink: 0;
  border: 1px solid var(--store-border);
}

.info-item svg {
  width: 14px;
  height: 14px;
  color: var(--store-primary);
}

/* Search Box */
.menu-search-wrapper {
  margin-bottom: 12px;
}

.search-box {
  position: relative;
  margin-bottom: 10px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--store-border);
  background-color: var(--store-bg);
  color: var(--store-text);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--store-primary);
  background-color: var(--store-card-bg);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--store-text-muted);
}

/* Dietary Filters */
.dietary-filters {
  display: flex;
  gap: 8px;
}

.diet-btn {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--store-border);
  background-color: var(--store-card-bg);
  color: var(--store-text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.diet-btn.active {
  background-color: var(--store-primary);
  color: #fff;
  border-color: var(--store-primary);
}

/* Categories Scroller */
.categories-nav {
  display: flex;
  gap: 8px;
  padding: 4px 0;
}

.category-tab {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--store-text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.category-tab.active {
  background-color: rgba(var(--store-primary-rgb), 0.1);
  color: var(--store-primary);
  border-color: rgba(var(--store-primary-rgb), 0.2);
}

/* ==========================================
   3. MENU ITEMS CONTAINER
   ========================================== */
.menu-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.category-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.category-title {
  font-size: 1.15rem;
  font-weight: 800;
  border-left: 4px solid var(--store-primary);
  padding-left: 8px;
  margin-bottom: 4px;
  text-transform: capitalize;
}

.items-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-item-card {
  display: flex;
  padding: 14px;
  background-color: var(--store-card-bg);
  border: 1px solid var(--store-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  gap: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.menu-item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(var(--store-primary-rgb), 0.2);
}

.menu-item-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.menu-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
  gap: 8px;
}

.menu-item-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.menu-item-price {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--store-primary);
  white-space: nowrap;
}

.menu-item-desc {
  font-size: 0.775rem;
  color: var(--store-text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
  /* limit to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-item-tags {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.diet-tag {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.diet-tag.vegan {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.diet-tag.gf {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

/* Item Image on card */
.menu-item-image {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: var(--store-border);
  flex-shrink: 0;
}

/* No results state */
.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--store-text-muted);
}

.no-results svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px auto;
  color: var(--store-border);
}

/* ==========================================
   4. OPTION DIALOG (POPUP)
   ========================================== */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--store-overlay);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end; /* Slides up from bottom */
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.dialog-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.dialog-card {
  width: 100%;
  max-width: 450px;
  max-height: 85vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
  background-color: var(--store-card-bg);
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  position: relative;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.dialog-overlay.active .dialog-card {
  transform: translateY(0);
}

.dialog-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--store-bg);
  border: 1px solid var(--store-border);
  color: var(--store-text);
  font-size: 1.5rem;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.dialog-body {
  padding: 24px;
  overflow-y: auto;
}

.dialog-body h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  padding-right: 32px;
}

.dialog-body p {
  font-size: 0.85rem;
  color: var(--store-text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Options selectors styling */
.dialog-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.option-group-title {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--store-text-muted);
}

.option-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--store-border);
  border-radius: var(--radius-sm);
  background-color: var(--store-bg);
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.option-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
}

.option-choice input {
  accent-color: var(--store-primary);
}

.option-choice:hover {
  border-color: var(--store-primary);
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--store-border);
  padding: 16px 24px 24px 24px;
  background-color: var(--store-card-bg);
}

.dialog-price {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--store-primary);
}

.btn-primary {
  background-color: var(--store-primary);
  color: #fff;
  padding: 12px 24px;
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(var(--store-primary-rgb), 0.25);
  transition: var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(var(--store-primary-rgb), 0.35);
}
