:root {
  --bg: #fdfbf7;
  --card: #ffffff;
  --yellow: #fbbf24;
  --yellow-dark: #f59e0b;
  --red: #ef4444;
  --text: #1f2937;
  --text-light: #6b7280;
  --shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
  --radius-card: 16px;
  --radius-banner: 24px;
  --radius-btn: 12px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; }
.hidden { display: none !important; }

/* ---------- Kiosk overlay ---------- */
.kiosk-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: linear-gradient(135deg, var(--yellow-dark), var(--yellow));
  display: flex; align-items: center; justify-content: center;
  color: white; text-align: center; cursor: pointer;
}
.kiosk-content h1 { font-size: 3rem; margin-bottom: 1rem; }
.kiosk-content p { font-size: 1.3rem; font-weight: 600; line-height: 1.6; }

/* ---------- App shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr 340px;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--card);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #f0ede6;
}
.brand { display: flex; align-items: center; gap: 8px; margin-bottom: 32px; padding: 0 8px; }
.brand-icon { font-size: 1.8rem; }
.brand-name { font-weight: 800; font-size: 1.1rem; }
.side-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 999px;
  font-weight: 600; color: var(--text-light);
  transition: background 0.2s, color 0.2s;
}
.nav-item:hover { background: #fef9ec; }
.nav-item.active { background: var(--yellow); color: white; }
.promo-card {
  background: linear-gradient(135deg, var(--yellow), var(--yellow-dark));
  border-radius: var(--radius-card);
  padding: 20px; color: white; font-weight: 600; margin-top: 16px;
}

/* ---------- Main area ---------- */
.main-area { padding: 24px 32px; overflow-y: auto; }
.topbar { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.search-bar {
  padding: 12px 18px; border-radius: 999px; border: 1px solid #eee;
  background: var(--card); box-shadow: var(--shadow); min-width: 220px;
}
.lang-toggle {
  background: var(--card); border-radius: 999px; padding: 10px 16px;
  font-weight: 700; box-shadow: var(--shadow); color: var(--yellow-dark);
}

.hero-banner {
  background: linear-gradient(120deg, var(--yellow), var(--yellow-dark));
  border-radius: var(--radius-banner);
  padding: 32px; color: white;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px;
}
.hero-text h1 { font-size: 1.8rem; margin-bottom: 8px; }
.hero-text p { opacity: 0.95; }
.hero-emoji { font-size: 3rem; }

.category-row {
  display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 28px;
}
.category-card {
  min-width: 100px; background: var(--card); border-radius: var(--radius-card);
  box-shadow: var(--shadow); padding: 16px; text-align: center;
  font-weight: 600; font-size: 0.85rem; cursor: pointer; flex-shrink: 0;
  transition: transform 0.15s;
}
.category-card:hover { transform: translateY(-2px); }
.category-card .cat-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.category-card.active { background: var(--yellow); color: white; }

.products-section h3 { margin-bottom: 16px; font-size: 1.2rem; }
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.loading-text { color: var(--text-light); grid-column: 1/-1; }

.product-card {
  background: var(--card); border-radius: var(--radius-card);
  box-shadow: var(--shadow); overflow: hidden; position: relative;
  display: flex; flex-direction: column;
}
.product-card img { width: 100%; height: 130px; object-fit: cover; }
.product-info { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-info h4 { font-size: 0.95rem; margin-bottom: 4px; }
.product-info p { font-size: 0.78rem; color: var(--text-light); flex: 1; margin-bottom: 8px; }
.product-footer { display: flex; justify-content: space-between; align-items: center; }
.product-price { font-weight: 800; color: var(--yellow-dark); }
.add-btn {
  background: var(--yellow); color: white; width: 34px; height: 34px;
  border-radius: 50%; font-size: 1.2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.unavailable-tag {
  position: absolute; top: 10px; left: 10px; background: var(--red); color: white;
  font-size: 0.7rem; padding: 4px 8px; border-radius: 999px; font-weight: 700;
}

/* ---------- Cart panel ---------- */
.cart-panel {
  background: var(--card); border-left: 1px solid #f0ede6;
  padding: 24px; display: flex; flex-direction: column;
}
.cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.address-badge {
  background: #fef3d5; color: var(--yellow-dark); font-size: 0.72rem;
  padding: 6px 12px; border-radius: 999px; font-weight: 700;
}
.cart-items { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.empty-cart { color: var(--text-light); text-align: center; margin-top: 40px; font-size: 0.9rem; }
.cart-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cart-item-info { flex: 1; }
.cart-item-info h5 { font-size: 0.85rem; }
.cart-item-info span { font-size: 0.75rem; color: var(--text-light); }
.cart-item-qty { display: flex; align-items: center; gap: 6px; }
.cart-item-qty button {
  background: #f2f2f2; width: 22px; height: 22px; border-radius: 50%; font-weight: 700;
}
.cart-summary { border-top: 1px solid #eee; padding-top: 16px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-light); }
.summary-row.total { font-weight: 800; color: var(--text); font-size: 1.05rem; }
.checkout-btn {
  width: 100%; background: var(--yellow); color: white; font-weight: 700;
  padding: 14px; border-radius: var(--radius-btn); margin-top: 12px; font-size: 1rem;
}
.close-modal-btn {
  width: 100%; background: transparent; color: var(--text-light); font-weight: 600;
  padding: 12px; margin-top: 8px;
}

/* ---------- Mobile cart bar ---------- */
.mobile-cart-bar {
  position: fixed; bottom: 16px; left: 16px; right: 16px;
  background: var(--yellow-dark); color: white; border-radius: 999px;
  padding: 16px 24px; display: flex; justify-content: space-between; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 50;
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-sheet {
  background: white; border-radius: 24px 24px 0 0; width: 100%; max-width: 480px;
  padding: 28px; max-height: 90vh; overflow-y: auto;
}
.modal-handle { width: 40px; height: 5px; background: #ddd; border-radius: 999px; margin: 0 auto 16px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-btn); border: 1px solid #e5e5e5;
  font-size: 0.9rem;
}
.checkbox-group { display: flex; align-items: flex-start; gap: 8px; }
.checkbox-group input { width: auto; }
.checkbox-group label { font-size: 0.78rem; color: var(--text-light); }

.tracking-sheet { text-align: center; }
.spinner {
  width: 44px; height: 44px; margin: 0 auto 16px;
  border: 4px solid #f0ede6; border-top-color: var(--yellow-dark);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.options-hero { margin-bottom: 16px; }
.options-hero-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; display: block; margin-bottom: 10px; }
.options-hero-info { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.options-hero-info h3 { margin: 0; font-size: 1.15rem; }
.options-hero-price { font-weight: 800; color: var(--red); font-size: 1.05rem; white-space: nowrap; }

.option-group { margin-bottom: 20px; }
.option-group h4 { font-size: 1rem; font-weight: 800; margin-bottom: 2px; color: #222; }
.option-group .required-tag { color: var(--red); font-size: 0.75rem; font-weight: 700; margin-left: 6px; }
.option-group-component { border-left: 3px solid var(--red); padding-left: 10px; }
.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 0.72rem; font-weight: 700;
  margin-right: 7px; vertical-align: middle;
}
.option-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border: 1px solid #eee; border-radius: 10px; margin-bottom: 8px; cursor: pointer;
}
.option-row.selected { border-color: var(--yellow-dark); background: #fef9ec; }
.option-row .modifier { color: var(--text-light); font-size: 0.8rem; }

.order-history-card {
  background: #fafafa; border-radius: 12px; padding: 12px; margin-top: 10px; font-size: 0.85rem;
}
.order-history-card .oh-status { font-weight: 700; color: var(--yellow-dark); }
.progress-track { display: flex; justify-content: space-between; margin: 24px 0; }
.progress-step { flex: 1; opacity: 0.35; font-size: 0.75rem; font-weight: 600; }
.progress-step span { font-size: 1.6rem; display: block; }
.progress-step.active { opacity: 1; color: var(--yellow-dark); }

/* ---------- Responsive: Tablet / Kiosk ---------- */
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    flex-direction: row; align-items: center; padding: 12px 16px; overflow-x: auto;
    border-right: none; border-bottom: 1px solid #f0ede6;
  }
  .brand { margin-bottom: 0; }
  .side-nav { flex-direction: row; flex: none; }
  .nav-item { padding: 10px 14px; white-space: nowrap; min-height: 48px; }
  .promo-card { display: none; }
  .cart-panel { display: none; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .mobile-cart-bar.show { display: flex; }
}

/* ---------- Responsive: Mobile ---------- */
@media (max-width: 767px) {
  .main-area { padding: 16px; padding-bottom: 100px; }
  .sidebar { display: none; }
  .hero-banner { flex-direction: column; text-align: center; gap: 12px; padding: 24px; }
  .hero-text h1 { font-size: 1.4rem; }
  .topbar { flex-direction: column; align-items: stretch; }
  .search-bar { width: 100%; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card img { height: 100px; }
  .modal-sheet { max-width: 100%; }
}

/* ---------- Print (80mm receipts) ---------- */
@media print {
  body * { visibility: hidden; }
  .receipt, .receipt * { visibility: visible; }
  .receipt {
    position: absolute; top: 0; left: 0; width: 80mm; font-family: monospace;
    font-size: 12px; padding: 4mm;
  }
  .invoice-line { display: flex; justify-content: space-between; gap: 8px; }
  .invoice-line-total { margin-bottom: 4px; font-style: italic; }
  .invoice-opt { font-size: 0.9em; opacity: 0.85; }
}

/* === Added: sidebar category images, option customizer pills === */
.nav-cat-icon {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover; display: inline-block;
}
.cat-icon-img {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 8px;
}

/* 3-per-row grid of option boxes, matching the reference app's product page */
.pill-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.option-pill {
  padding: 10px 6px; border-radius: 10px; border: 1px solid #ddd; background: #fff;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center;
  text-align: center; min-height: 56px;
}
.option-pill.selected { background: #fff5f0; color: var(--red); border-color: var(--red); border-width: 2px; }
.option-pill .modifier { font-size: 0.75rem; color: var(--red); font-weight: 700; }
.option-pill.selected .modifier { color: var(--red); }
.option-group-subtitle { font-size: 0.78rem; color: var(--red); font-weight: 600; margin: 0 0 8px; }
@media (max-width: 480px) { .pill-row { grid-template-columns: repeat(3, 1fr); gap: 6px; } .option-pill { font-size: 0.72rem; padding: 8px 4px; min-height: 50px; } }
.options-running-total {
  font-weight: 800; font-size: 1.05rem; text-align: center; margin: 12px 0; color: var(--yellow-dark);
}
#confirmOptionsBtn:disabled { cursor: not-allowed; }

/* === Added: Information button, store info modal, admin settings === */
.info-btn {
  width: 100%; margin-top: auto; padding: 12px; border-radius: 12px;
  background: #fef3d5; color: var(--yellow-dark); font-weight: 700;
  font-size: 0.85rem; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.info-btn:hover { background: var(--yellow); color: #fff; }

.info-phones { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.info-phone-link {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--yellow-dark);
  text-decoration: none; font-size: 0.95rem;
}
.info-address {
  font-size: 0.88rem; color: var(--text-light); margin-bottom: 14px; line-height: 1.4;
}
.info-delivery-banner {
  background: var(--yellow); color: #fff; font-weight: 700; font-size: 0.82rem;
  padding: 10px 14px; border-radius: 10px; text-align: center; margin-bottom: 16px;
}
.info-hours-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.info-hours-table th, .info-hours-table td {
  padding: 8px 10px; text-align: left; font-size: 0.82rem; border-bottom: 1px solid #f0f0f0;
}
.info-hours-table th { color: var(--text-light); font-weight: 700; }

/* Admin: Store & Contact Info section */
.settings-form-card { background: white; border-radius: 16px; box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }

/* === Added: Trending dishes row === */
.trending-section { margin-bottom: 20px; }
.trending-section h3 { font-size: 1.05rem; margin-bottom: 10px; }
.trending-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.trending-card {
  position: relative; flex: 0 0 160px; background: white; border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: transform 0.15s;
}
.trending-card:hover { transform: translateY(-2px); }
.trending-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.trending-card-info { padding: 8px 10px; }
.trending-card-info h5 { font-size: 0.82rem; margin: 0 0 4px; line-height: 1.2; }
.trending-price { font-weight: 800; color: var(--yellow-dark); font-size: 0.85rem; }
.trending-badge {
  position: absolute; top: 6px; left: 6px; background: var(--yellow); color: #fff;
  font-size: 0.75rem; padding: 2px 6px; border-radius: 999px; z-index: 1;
}
