/* =============================================
   NAMMA MANE — Customer App Styles
   Warm saffron + earthy green, homely feel
   ============================================= */

:root {
  --saffron: #E85D26;
  --saffron-light: #FF7A45;
  --saffron-pale: #FFF3EE;
  --green: #2D6A4F;
  --green-light: #52B788;
  --cream: #FFFBF5;
  --text: #1A1A1A;
  --text-mid: #555;
  --text-light: #999;
  --border: #EEE;
  --white: #FFFFFF;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
  --radius: 14px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 70px;
  overflow-x: hidden;
}

/* ---- PWA Banner ---- */
.pwa-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--green);
  color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
}
.pwa-banner button { background: rgba(255,255,255,0.2); border: none; color: #fff; padding: 4px 12px; border-radius: 20px; cursor: pointer; font-family: inherit; }
.pwa-banner #pwa-install-btn { background: #fff; color: var(--green); font-weight: 700; }

/* ---- Delivery Bar ---- */
.delivery-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  background: linear-gradient(90deg, var(--saffron), var(--saffron-light));
  color: #fff;
  padding: 12px 16px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}
.delivery-bar-inner { display: flex; align-items: center; justify-content: center; gap: 10px; }
.bike-icon { font-size: 22px; animation: bikeRide 1.5s ease-in-out infinite; }
@keyframes bikeRide {
  0%, 100% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
}

/* ---- Header ---- */
.app-header {
  position: sticky; top: 0; z-index: 800;
  background: var(--white);
  border-bottom: 2px solid var(--saffron-pale);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow);
}
.logo-kannada {
  display: block;
  font-family: 'Yatra One', cursive;
  font-size: 22px;
  color: var(--saffron);
  line-height: 1;
}
.logo-tagline { font-size: 11px; color: var(--text-light); margin-top: 2px; display: block; }

.cart-btn {
  position: relative;
  background: var(--saffron);
  border: none; border-radius: 50%;
  width: 46px; height: 46px;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(232,93,38,0.35);
  transition: transform 0.15s;
}
.cart-btn:active { transform: scale(0.92); }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--green);
  color: #fff; font-size: 11px; font-weight: 800;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ---- Meal Tabs ---- */
.meal-tabs {
  display: flex; overflow-x: auto; gap: 8px;
  padding: 14px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.meal-tabs::-webkit-scrollbar { display: none; }

.meal-tab {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px;
  background: var(--cream);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 10px 18px;
  cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700;
  color: var(--text-mid);
  transition: all 0.2s;
  white-space: nowrap;
}
.meal-tab span:first-child { font-size: 20px; }
.meal-tab small { font-size: 10px; color: var(--text-light); font-weight: 600; }
.meal-tab.active {
  background: var(--saffron-pale);
  border-color: var(--saffron);
  color: var(--saffron);
}
.meal-tab.unavailable { opacity: 0.45; }

/* ---- Meal Notice ---- */
.meal-notice {
  background: #FFF8E1;
  border-left: 4px solid #FFC107;
  padding: 10px 16px;
  font-size: 13px; color: #7B5800;
  margin: 12px 16px;
  border-radius: var(--radius-sm);
}

/* ---- Menu Grid ---- */
.menu-container { padding: 16px; }
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.menu-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.menu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.menu-card.unavailable { opacity: 0.55; pointer-events: none; }

.card-img {
  width: 100%; height: 130px; object-fit: cover;
  background: var(--saffron-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 12px; }
.card-name { font-size: 14px; font-weight: 800; line-height: 1.3; margin-bottom: 4px; }
.card-desc { font-size: 11px; color: var(--text-light); margin-bottom: 8px; line-height: 1.4; }
.card-footer { display: flex; align-items: center; justify-content: space-between; }
.card-price { font-size: 16px; font-weight: 800; color: var(--saffron); }
.veg-badge { font-size: 10px; }
.add-btn {
  background: var(--saffron);
  color: #fff; border: none;
  border-radius: 20px; padding: 6px 14px;
  font-size: 12px; font-weight: 800; cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.add-btn:hover { background: var(--saffron-light); }

.qty-control {
  display: flex; align-items: center; gap: 8px;
}
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--saffron);
  background: transparent; color: var(--saffron);
  font-size: 16px; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.qty-btn:hover { background: var(--saffron); color: #fff; }
.qty-num { font-weight: 800; font-size: 15px; min-width: 18px; text-align: center; }

.unavailable-label {
  font-size: 11px; font-weight: 700;
  color: #C62828; background: #FFEBEE;
  padding: 3px 10px; border-radius: 20px;
}

/* ---- Cart Sidebar ---- */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1100;
}
.cart-sidebar {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(380px, 100vw);
  background: var(--white);
  z-index: 1200;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0, 0.67, 0);
}
.cart-sidebar.open { transform: translateX(0); }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px; border-bottom: 1px solid var(--border);
}
.cart-header h2 { font-size: 20px; font-family: 'Yatra One', cursive; color: var(--saffron); }
.cart-header button { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-mid); }

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

.cart-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.cart-item-name { flex: 1; font-weight: 700; font-size: 14px; }
.cart-item-price { font-weight: 800; color: var(--saffron); font-size: 14px; }

.cart-footer {
  padding: 20px; border-top: 2px solid var(--border);
}
.cart-total {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 18px; font-weight: 800; margin-bottom: 14px;
}
.checkout-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--saffron), var(--saffron-light));
  color: #fff; border: none;
  border-radius: var(--radius); padding: 16px;
  font-size: 16px; font-weight: 800; cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(232,93,38,0.35);
  transition: transform 0.15s;
}
.checkout-btn:active { transform: scale(0.97); }
.cart-empty { text-align: center; padding: 40px 20px; color: var(--text-light); }
.cart-empty span { font-size: 48px; display: block; margin-bottom: 12px; }

/* ---- Modals ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1300;
  display: flex; align-items: flex-end;
  backdrop-filter: blur(3px);
}
.modal-overlay.center { align-items: center; justify-content: center; }

.checkout-modal, .history-modal {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  width: 100%; max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 20px; font-family: 'Yatra One', cursive; color: var(--saffron); }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-mid); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text-mid); }
.form-group input[type="text"],
.form-group input[type="tel"] {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px; font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus { border-color: var(--saffron); }

.radio-group { display: flex; gap: 10px; }
.radio-card {
  flex: 1; cursor: pointer;
}
.radio-card input { display: none; }
.radio-card span {
  display: flex; align-items: center; justify-content: center;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  text-align: center;
  transition: all 0.2s;
}
.radio-card input:checked + span {
  border-color: var(--saffron);
  background: var(--saffron-pale);
  color: var(--saffron);
}

.order-summary {
  background: var(--saffron-pale);
  border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 16px;
  font-size: 14px;
}
.order-summary-item { display: flex; justify-content: space-between; padding: 3px 0; }
.order-summary-total { font-weight: 800; font-size: 16px; border-top: 1px solid rgba(232,93,38,0.2); margin-top: 8px; padding-top: 8px; }

.confirm-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: #fff; border: none;
  border-radius: var(--radius); padding: 16px;
  font-size: 17px; font-weight: 800; cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(45,106,79,0.35);
}

/* ---- Success Modal ---- */
.success-modal {
  background: var(--white);
  border-radius: 24px;
  padding: 40px 24px;
  text-align: center;
  max-width: 340px;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.success-anim { font-size: 64px; margin-bottom: 12px; animation: bounce 0.6s ease 0.3s; }
@keyframes bounce { 0%,100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.success-modal h2 { font-family: 'Yatra One', cursive; font-size: 28px; color: var(--saffron); margin-bottom: 8px; }
.success-modal p { color: var(--text-mid); margin-bottom: 6px; }
.history-btn {
  width: 100%;
  background: var(--saffron);
  color: #fff; border: none;
  border-radius: var(--radius); padding: 14px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit; margin-top: 20px;
}
.close-light {
  width: 100%; background: none; border: none; color: var(--text-light);
  padding: 10px; font-family: inherit; cursor: pointer; font-size: 14px; margin-top: 8px;
}

/* ---- History ---- */
.history-order {
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.history-order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-num { font-weight: 800; color: var(--saffron); }
.order-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
}
.badge-placed { background: #E3F2FD; color: #1565C0; }
.badge-delivered { background: #E8F5E9; color: #2E7D32; }
.badge-assigned { background: #FFF3E0; color: #E65100; }

/* ---- Bottom Nav ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 2px solid var(--border);
  display: flex;
  z-index: 700;
}
.bottom-nav button {
  flex: 1; background: none; border: none;
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px; font-size: 10px; font-weight: 700;
  color: var(--text-mid); cursor: pointer; font-family: inherit; gap: 3px;
}
.bottom-nav button:first-child span:first-child { font-size: 22px; }

/* ---- Loading ---- */
.loading-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 4px solid var(--saffron-pale);
  border-top-color: var(--saffron);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Utility ---- */
.hidden { display: none !important; }

/* ---- Desktop Enhancement ---- */
@media (min-width: 600px) {
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .checkout-modal, .history-modal { max-width: 480px; margin: auto; border-radius: 24px; }
  .modal-overlay { align-items: center; justify-content: center; }
}
