:root {
  --primary: #E65100;
  --primary-light: #FF8A50;
  --primary-dark: #AC1900;
  --accent: #FF6F00;
  --bg: #FFF8F0;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-light: #666;
  --border: #F0E6DC;
  --success: #2E7D32;
  --danger: #C62828;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 14px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 80px;
}

.header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 18px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 15px rgba(230,81,0,0.3);
}

.header-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.header .subtitle {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}

.cart-btn {
  position: relative;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
}

.cart-btn:hover { background: rgba(255,255,255,0.3); }

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary);
  display: none;
}

.cart-badge.show { display: flex; }

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

.search-bar {
  padding: 14px 0;
}

.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%23999' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") 14px center no-repeat;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus { border-color: var(--primary); }

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.tab-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  background: var(--card);
  color: var(--text-light);
  border: 1.5px solid var(--border);
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.menu-section {
  margin-bottom: 24px;
}

.menu-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.menu-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.menu-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

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

.menu-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.veg-dot {
  width: 10px;
  height: 10px;
  border: 1.5px solid #2E7D32;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.veg-dot::after {
  content: '';
  width: 5px;
  height: 5px;
  background: #2E7D32;
  border-radius: 50%;
}

.menu-info .desc {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-info .price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.menu-info .price::before { content: '₹'; }

.popular-badge {
  background: #FFF3E0;
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

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

.qty-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

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

.qty-num {
  font-size: 16px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* Cart Overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

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

.cart-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

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

.cart-header h2 { font-size: 18px; }

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

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

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

.cart-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.cart-empty .emoji { font-size: 48px; margin-bottom: 12px; }

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

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

.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 14px; font-weight: 600; }
.cart-item-info .price { font-size: 14px; color: var(--primary); font-weight: 600; }

.cart-footer {
  padding: 16px 20px;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}

.checkout-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.checkout-btn:hover { background: var(--primary-dark); }
.checkout-btn:disabled { background: #ccc; cursor: not-allowed; }

/* Checkout Page */
.page {
  display: none;
  padding: 20px 0;
}

.page.active { display: block; }

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  background: var(--card);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
}

.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.payment-opt {
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.payment-opt.selected {
  border-color: var(--primary);
  background: #FFF3E0;
}

.payment-opt .icon { font-size: 24px; margin-bottom: 4px; }
.payment-opt .label { font-size: 13px; font-weight: 600; }

.upi-section {
  display: none;
  text-align: center;
  padding: 20px;
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.upi-section.show { display: block; }

.upi-section h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.upi-section .upi-id {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.qr-placeholder {
  width: 180px;
  height: 180px;
  margin: 0 auto 10px;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-light);
}

.summary-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.summary-card h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 2px solid var(--border);
}

.place-order-btn {
  width: 100%;
  padding: 16px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 10px;
}

.place-order-btn:hover { background: #1B5E20; }

/* Order Confirmation */
.confirmation {
  text-align: center;
  padding: 40px 20px;
}

.confirmation .check-circle {
  width: 80px;
  height: 80px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 36px;
  color: white;
  animation: pop 0.5s ease;
}

@keyframes pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.confirmation h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.confirmation .order-id {
  font-size: 16px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 6px;
}

.confirmation .note {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.5;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: #25D366;
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  margin-bottom: 12px;
}

.whatsapp-btn:hover { background: #128C7E; }

.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

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

/* Mobile Responsive */
@media (max-width: 480px) {
  .header h1 { font-size: 17px; }
  .menu-card { padding: 12px; gap: 10px; }
  .cart-panel { max-width: 100%; }
}

/* Loading Spinner */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

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

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

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.no-results .emoji { font-size: 40px; margin-bottom: 8px; }

/* ---------------- DELIVERY POPUP ---------------- */
.delivery-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.delivery-popup-overlay.show { display: flex; }

.delivery-popup {
  background: var(--card);
  border-radius: 20px;
  max-width: 360px;
  width: 100%;
  padding: 30px 24px 22px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: popstar 0.35s ease;
}

@keyframes popstar {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.popup-badge {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 10px;
}

.delivery-popup h2 {
  font-size: 24px;
  color: var(--text);
  margin-bottom: 4px;
}

.popup-tag {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.popup-features {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 18px;
}

.popup-feature {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 5px 0;
}

.popup-order-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(230,81,0,0.35);
  transition: transform 0.15s;
}

.popup-order-btn:active { transform: scale(0.97); }

.popup-skip {
  width: 100%;
  background: transparent;
  color: var(--text-light);
  border: none;
  padding: 10px 0 0;
  font-size: 13px;
  cursor: pointer;
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f1ebe3;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  color: #888;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------------- UPI PAY BUTTON ---------------- */
.upi-pay-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  text-decoration: none;
  text-align: center;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(230,81,0,0.35);
}
.upi-pay-btn:active { transform: scale(0.97); }
