:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #212529;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* ============ HEADER ============ */
.header {
  background: var(--primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 8px;
}

.header-title { font-size: 1.2rem; font-weight: 700; }
.header-subtitle { font-size: 0.75rem; opacity: 0.9; }

.lang-switcher {
  display: flex;
  gap: 4px;
}

.lang-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

.lang-btn.active { background: white; color: var(--primary); font-weight: 600; }
.lang-btn:hover:not(.active) { background: rgba(255,255,255,0.35); }

.header-info {
  background: rgba(0,0,0,0.2);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-boxes {
  display: flex;
  gap: 8px;
  flex: 1;
}

.info-box {
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 5px 10px;
  text-align: center;
  min-width: 80px;
}

.info-box-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.7rem;
  opacity: 0.85;
  font-weight: 500;
  color: white;
}

.info-box-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  margin-top: 1px;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; flex-shrink: 0; }
.status-dot.closed { background: #f87171; }

/* ============ CATEGORY TABS ============ */
.category-tabs {
  background: white;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  display: flex;
  padding: 0 12px;
  scrollbar-width: none;
  gap: 4px;
}

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

.cat-tab {
  white-space: nowrap;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  font-weight: 500;
}

.cat-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ============ MAIN CONTENT ============ */
main { padding: 16px; padding-bottom: 120px; max-width: 600px; margin: 0 auto; }

/* ============ PRODUCT GRID ============ */
.category-section { margin-bottom: 28px; }
.category-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.product-grid { display: flex; flex-direction: column; gap: 10px; }

.product-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

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

.product-img {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f0f0;
}

.product-img-placeholder {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ff6b6b22, #ffa50022);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

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

.product-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text);
}

.product-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}

.add-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}
.add-btn:active { transform: scale(0.9); background: var(--primary-dark); }

.popular-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ff9f43;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: white;
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-title { font-weight: 700; font-size: 1.1rem; }

.modal-close {
  background: var(--bg);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body { padding: 16px; }

.modal-product-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: #f0f0f0;
}

.modal-product-img-placeholder {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ff6b6b22, #ffa50022);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  margin-bottom: 12px;
}

.modal-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.modal-price { font-size: 1.4rem; font-weight: 700; color: var(--primary); margin-bottom: 16px; }

.ingredients-title { font-weight: 600; margin-bottom: 10px; font-size: 0.9rem; color: var(--text-muted); }

.ingredient-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.ingredient-item:last-child { border-bottom: none; }

.onion-item {
  background: rgba(255, 200, 0, 0.08);
  border-radius: 8px;
  padding: 10px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border) !important;
}

.ingredient-cb { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.ingredient-name { font-size: 0.95rem; }

.modal-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: white;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:active { background: var(--primary-dark); transform: scale(0.99); }

/* ============ CART BUTTON ============ */
.cart-fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 28px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 150;
  transition: transform 0.2s;
  display: none;
}

.cart-fab.visible { display: flex; }
.cart-fab:active { transform: scale(0.96); }

.cart-count {
  background: white;
  color: var(--primary);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ============ CART PANEL ============ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-panel {
  background: white;
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-overlay.open .cart-panel { transform: translateY(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.cart-title { font-weight: 700; font-size: 1.1rem; }

.cart-items { flex: 1; overflow-y: auto; padding: 12px 16px; }

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child { border-bottom: none; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: 0.95rem; }
.cart-item-removed { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.cart-item-ingredients { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; margin-bottom: 2px; }
.ing-tag { font-size: 0.72rem; padding: 2px 7px; border-radius: 20px; font-weight: 500; }
.ing-kept { background: #d1fae5; color: #065f46; }
.ing-removed { background: #fee2e2; color: #991b1b; }
.cart-item-price { font-weight: 600; color: var(--primary); margin-top: 4px; }

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.qty-btn:active { background: var(--border); }
.qty-num { font-weight: 600; min-width: 20px; text-align: center; }

.cart-footer {
  padding: 16px;
  border-top: 2px solid var(--border);
  background: white;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 700;
}

.min-order-warn {
  background: #fff3cd;
  border: 1.5px solid #ffc107;
  color: #7a4f00;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 10px;
  line-height: 1.5;
  display: none;
}

.min-order-warn.show { display: block; }

.min-order-banner {
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  color: #7a4f00;
  text-align: center;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1px;
}

/* ============ ORDER MODAL ============ */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  resize: none;
}
.form-input:focus { outline: none; border-color: var(--primary); }
.form-input.error { border-color: #dc3545; }

/* ============ HEADER ICON BUTTONS ============ */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, opacity 0.2s;
  flex-shrink: 0;
}
.header-icon-btn:active { transform: scale(0.9); }
.header-icon-btn.wa-header { background: #25d366; }
.header-icon-btn.map-header { background: #ff8c00; }

/* ============ MAPS SECTION ============ */
.maps-section { padding: 16px; }
.maps-section iframe {
  width: 100%;
  height: 200px;
  border-radius: var(--radius);
  border: none;
}

/* ============ EMPTY CART ============ */
.empty-cart {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-cart-icon { font-size: 3rem; margin-bottom: 10px; }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #212529;
  color: white;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.88rem;
  opacity: 0;
  transition: all 0.3s;
  z-index: 500;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ CALL BTN ============ */
.header-icon-btn.call-header { background: #22c55e; }


.map-dir-btn {
  display: block; text-align: center; color: white; text-decoration: none;
  padding: 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.95rem;
  transition: opacity 0.15s;
}
.map-dir-btn:active { opacity: 0.85; }

/* ============ ORDER HISTORY ============ */
.history-title { font-weight: 700; font-size: 0.88rem; color: var(--text-muted); margin-bottom: 8px; }
.history-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 6px; cursor: pointer;
  transition: background 0.15s;
}
.history-item:hover { background: #f8f8f8; }
.history-date { font-size: 0.72rem; color: var(--text-muted); }
.history-items { font-size: 0.82rem; font-weight: 500; margin: 2px 0; }
.history-total { font-size: 0.78rem; color: var(--primary); font-weight: 600; }

/* ============ SIZE OPTIONS ============ */
.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.size-btn {
  border: 2px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.size-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  font-weight: 600;
}

/* ============ RESPONSIVE ============ */
@media (min-width: 600px) {
  .product-grid { display: grid; grid-template-columns: 1fr 1fr; }
  main { padding: 20px; }
}
