:root {
  --navy: #16345c;
  --navy-dark: #0f2440;
  --red: #c8202f;
  --red-dark: #a2131f;
  --cream: #faf5ea;
  --cream-dark: #f0e8d6;
  --ink: #24303d;
  --muted: #6b7280;
  --border: #e4dcc9;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(22, 52, 92, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  padding-bottom: 90px;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.brand-logo { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.community-link {
  color: #fff;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.community-link:hover { background: rgba(255,255,255,0.22); }
.community-link-icon { display: none; }
footer .community-link { color: var(--navy); background: var(--cream-dark); border-color: var(--border); }
.brand-name { font-size: 1.3rem; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.brand-name .red { color: #ff6b6b; }
.brand-tagline { font-size: 0.72rem; color: #cfd9e6; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }

.cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.cart-btn:hover { transform: translateY(-1px); }
.cart-count-badge {
  background: #fff;
  color: var(--red);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  padding: 0 6px;
}

.closed-banner {
  background: #fff3cd;
  color: #7a5b00;
  text-align: center;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Compact header on phones: drop the tagline, shrink the logo/text, and
   collapse the WhatsApp button to an icon so the cart button never gets
   squeezed off-screen. */
@media (max-width: 640px) {
  .site-header { padding: 10px 14px; gap: 8px; }
  .brand-logo { width: 32px; height: 32px; }
  .brand-name { font-size: 1.05rem; }
  .brand-tagline { display: none; }
  .community-link-text { display: none; }
  .community-link-icon { display: inline; }
  .community-link { padding: 8px 10px; }
  .cart-btn { padding: 8px 12px; font-size: 0.85rem; gap: 6px; }
}

/* Category nav */
.category-nav {
  position: sticky;
  top: var(--header-h, 60px);
  z-index: 20;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }

.cat-pill {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.cat-pill.active, .cat-pill:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* Categories & grid */
main { max-width: 1200px; margin: 0 auto; padding: 10px 20px 40px; }

.category-section { padding-top: 22px; scroll-margin-top: var(--scroll-offset, 120px); }
.category-section h2 {
  font-size: 1.3rem;
  color: var(--navy-dark);
  border-left: 5px solid var(--red);
  padding-left: 10px;
  margin: 0 0 14px;
}

.daily-deal-section {
  padding: 16px;
  margin: 16px 0 8px;
  background: linear-gradient(135deg, #fff8ec, #fdeecb);
  border: 1px solid #f0d38a;
  border-radius: var(--radius);
}
.daily-deal-section h2 {
  font-size: 1.3rem;
  color: var(--navy-dark);
  margin: 0 0 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.product-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(22,52,92,0.14); }

.product-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--cream-dark) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23c8b98a" stroke-width="1"><circle cx="12" cy="12" r="9"/></svg>') center/40% no-repeat;
  object-fit: cover;
}

.product-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-name { font-weight: 700; font-size: 1rem; color: var(--ink); }
.product-subtitle { font-size: 0.78rem; color: var(--muted); font-style: italic; margin-top: -2px; }
.product-desc {
  font-size: 0.8rem;
  color: var(--muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.product-price { font-weight: 800; color: var(--navy-dark); }
.product-price small { display: block; font-weight: 500; color: var(--muted); font-size: 0.68rem; }
.add-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.add-btn:hover { background: var(--red); }

.badge {
  position: absolute;
  margin: 10px;
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}
.product-card-image-wrap { position: relative; }

/* Overlays / modals */
.modal-overlay, .drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 36, 64, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-overlay.open, .drawer-overlay.open { display: flex; }

.modal, .drawer {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px;
  position: relative;
}
.drawer { margin-left: auto; border-radius: var(--radius) 0 0 var(--radius); }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--cream-dark);
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 1rem;
  cursor: pointer;
}

.option-group { margin: 18px 0; }
.option-group-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; display: flex; justify-content: space-between; }
.option-group-title .req { color: var(--red); font-size: 0.72rem; font-weight: 600; }
.option-choice {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--cream-dark);
  font-size: 0.92rem;
}
.option-choice label { flex: 1; cursor: pointer; }
.option-choice .delta { color: var(--muted); font-size: 0.82rem; }

.size-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.size-pill { padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 0.85rem; font-weight: 600; }
.size-pill.selected { background: var(--navy); color: #fff; border-color: var(--navy); }

.location-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.location-pill {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.location-pill:hover { border-color: var(--navy); }
.location-pill.selected { background: var(--navy); color: #fff; border-color: var(--navy); }

.qty-row { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }
.qty-stepper { display: flex; align-items: center; gap: 14px; }
.qty-stepper button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: #fff; font-size: 1.1rem; cursor: pointer; }

.primary-btn {
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 18px;
}
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.primary-btn.secondary { background: var(--navy); }

.cart-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--cream-dark); }
.cart-line-info { flex: 1; }
.cart-line-name { font-weight: 700; font-size: 0.92rem; }
.cart-line-options { font-size: 0.76rem; color: var(--muted); }
.cart-line-remove { background: none; border: none; color: var(--red); font-size: 0.78rem; cursor: pointer; padding: 0; margin-top: 4px; }
.cart-line-qty { display: flex; align-items: center; gap: 8px; }
.cart-line-qty button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: #fff; cursor: pointer; }

.cart-empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.cart-summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.92rem; }
.cart-summary-row.total { font-weight: 800; font-size: 1.05rem; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }

.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 5px; }
.form-field input, .form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}
.payment-toggle { display: flex; gap: 10px; }
.payment-toggle label {
  flex: 1;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  font-weight: 700;
}
.payment-toggle input { display: none; }
.payment-toggle input:checked + span { color: var(--red); }
.payment-toggle label:has(input:checked) { border-color: var(--red); background: #fdeceb; }

.form-error { color: var(--red); font-size: 0.85rem; margin-top: 8px; }

footer {
  text-align: center;
  padding: 30px 16px;
  color: var(--muted);
  font-size: 0.82rem;
}
footer .anchor { color: var(--navy); font-weight: 700; }

/* Order status bar + modal */
.order-status-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 6px 18px rgba(15, 36, 64, 0.35);
  cursor: pointer;
  max-width: calc(100% - 32px);
}
.order-status-bar[hidden] { display: none; }
.order-status-bar[data-state="accepted"] { background: #1e7a34; }
.order-status-bar[data-state="done"] { background: #444; }
.order-status-bar[data-state="cancelled"] { background: var(--red); }
.order-status-bar[data-state="rejected"] { background: var(--red); }

.status-steps { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.status-step { display: flex; align-items: center; gap: 12px; opacity: 0.4; }
.status-step.active { opacity: 1; }
.status-step .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--cream-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex: none;
}
.status-step.active .dot { background: #1e7a34; color: #fff; }
.status-step.cancelled .dot { background: var(--red); color: #fff; }
.status-step-label { font-weight: 600; font-size: 0.92rem; }
.status-step-sub { font-size: 0.78rem; color: var(--muted); }

.status-order-lines { margin-top: 18px; border-top: 1px solid var(--cream-dark); padding-top: 14px; }

@media (max-width: 480px) {
  .drawer, .modal { max-width: 100%; border-radius: var(--radius) var(--radius) 0 0; margin: auto 0 0; max-height: 92vh; }
  .drawer-overlay, .modal-overlay { align-items: flex-end; }
}
