/* ============================================================
   DIGITAL MENU — Design tokens & base styles
   Fonts: Cairo (Arabic) / Poppins (English)
   ============================================================ */

:root {
  /* Palette — "spice market" identity: brass, paprika, sage on parchment/ink */
  --ink: #1A1614;
  --ink-surface: #241E19;
  --ink-surface-2: #2E2620;
  --parchment: #FBF7F0;
  --parchment-surface: #FFFFFF;
  --parchment-surface-2: #F3EAD9;
  --brass: #C89B4A;
  --brass-strong: #B4863A;
  --paprika: #B5432B;
  --sage: #6E8B6A;
  --slate: #6B6259;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-soft: 0 8px 24px rgba(26, 22, 20, 0.08);
  --shadow-deep: 0 16px 40px rgba(26, 22, 20, 0.18);

  --font-ar: "Cairo", system-ui, sans-serif;
  --font-en: "Poppins", system-ui, sans-serif;
}

/* Light theme (default) */
:root, [data-theme="light"] {
  --bg: var(--parchment);
  --surface: var(--parchment-surface);
  --surface-2: var(--parchment-surface-2);
  --text: #241E19;
  --text-muted: var(--slate);
  --border: rgba(36, 30, 25, 0.10);
}

/* Dark theme */
[data-theme="dark"] {
  --bg: var(--ink);
  --surface: var(--ink-surface);
  --surface-2: var(--ink-surface-2);
  --text: #F3EAD9;
  --text-muted: #B7AC9D;
  --border: rgba(243, 234, 217, 0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-en);
  transition: background 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body, body.lang-ar { font-family: var(--font-ar); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------- Top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.icon-btn:hover { transform: translateY(-1px); background: var(--surface-2); }

.pill-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 3px;
  gap: 2px;
}
.pill-toggle button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}
.pill-toggle button.active {
  background: var(--brass);
  color: #fff;
}

.currency-select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ---------------- Hero ---------------- */

.hero {
  padding: 40px 20px 20px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero p {
  color: var(--text-muted);
  margin: 0 auto 22px;
  max-width: 520px;
}

.search-wrap {
  max-width: 460px;
  margin: 0 auto;
  position: relative;
}

.search-wrap input {
  width: 100%;
  padding: 13px 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-start: 16px;
  opacity: 0.5;
}

/* ---------------- Category chips ---------------- */

.categories-bar {
  position: sticky;
  top: 68px;
  z-index: 30;
  background: var(--bg);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.categories-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 20px;
  scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip.active {
  background: var(--paprika);
  border-color: var(--paprika);
  color: #fff;
}

/* ---------------- Product grid ---------------- */

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 34px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.quick-add-btn {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  color: var(--brass-strong, var(--brass));
  border: none;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  cursor: pointer;
  z-index: 2;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.quick-add-btn:hover { transform: scale(1.1); background: var(--brass); color: #fff; }
.quick-add-btn:active { transform: scale(0.95); }

.quick-add-stepper {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 999px;
  padding: 4px 6px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  z-index: 2;
}
.qas-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brass);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.qas-btn:active { transform: scale(0.9); }
.qas-qty {
  min-width: 18px;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--brass-strong, var(--brass));
}
@media (max-width: 560px) {
  .quick-add-stepper { bottom: 6px; padding: 3px 5px; }
  .qas-btn { width: 24px; height: 24px; font-size: 1rem; }
}

/* Signature element: calorie "seal" badge on the image corner */
.cal-badge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--ink);
  color: #F3EAD9;
  border: 2px dashed var(--brass);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: var(--shadow-soft);
}
.cal-badge b { font-size: 0.95rem; font-weight: 800; }
.cal-badge span { font-size: 0.5rem; opacity: 0.8; margin-top: 2px; }

.badge-new {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  background: var(--sage);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  z-index: 2;
}

.price-discount-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}
.price-old {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--paprika);
}
.price-new {
  font-size: 1.15rem;
  color: var(--paprika);
  font-weight: 900;
}
.discount-badge {
  background: var(--paprika);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  font-weight: 800;
  font-size: 1.02rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.info-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.info-chip {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.info-chip-sizes {
  color: var(--brass);
  background: color-mix(in srgb, var(--brass) 14%, transparent);
  font-weight: 700;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
}

.price {
  font-weight: 800;
  color: var(--paprika);
  font-size: 1.05rem;
}

.badge-featured {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--sage);
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .emoji { font-size: 2.4rem; margin-bottom: 10px; }

.footer {
  text-align: center;
  padding: 30px 20px 50px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.social-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ---- Payment methods trust badges (footer) ---- */
.payment-icons-row {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.payment-icon-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}
.payment-icon-badge .pib-icon {
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; flex-shrink: 0;
}
.payment-icon-badge .pib-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 3px; }

.social-link-item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.social-link-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.social-link-item img { width: 100%; height: 100%; object-fit: cover; }

.dev-credit {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dev-credit-sep { opacity: 0.5; }
.dev-credit a {
  color: var(--brass);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.maintenance-screen {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 14px;
}
.maintenance-icon { font-size: 3rem; }
.maintenance-screen p {
  max-width: 480px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* ---------------- Product detail page ---------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  margin: 18px 0;
}
.back-link:hover { color: var(--text); }

.product-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: start;
  padding-bottom: 40px;
}

.product-detail-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 4 / 3;
}
.product-detail-media img { width: 100%; height: 100%; object-fit: cover; }

.product-detail-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-detail-category {
  align-self: flex-start;
}

.product-detail-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  margin: 0;
  line-height: 1.3;
}

.product-detail-desc {
  color: var(--text-muted);
  line-height: 1.9;
  font-size: 1rem;
  margin: 0;
}

.product-detail-price-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.product-detail-price-row .price { font-size: 1.7rem; }

.product-detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-order {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sage);
  color: #fff;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
}
.btn-order:hover { filter: brightness(1.05); }

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
}

.related-section {
  padding-top: 10px;
  padding-bottom: 50px;
}

.pd-loading, .pd-not-found {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-muted);
}

.addon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
}
.addon-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.addon-row-left input { width: 18px; height: 18px; accent-color: var(--brass); }
.addon-price { color: var(--sage); font-weight: 700; font-size: 0.85rem; }

.card-panel-like {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.footer-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 0.78rem;
}
.footer-links-row a { color: var(--text-muted); font-weight: 600; }
.footer-links-row a:hover { color: var(--brass); }
.footer-links-sep { opacity: 0.4; }

@media (max-width: 800px) {
  .product-detail-grid { grid-template-columns: 1fr; gap: 22px; }
  .product-detail-price-row .price { font-size: 1.4rem; }
}

/* ---------------- PWA install banner ---------------- */

.install-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 440px;
  margin: 0 auto;
  background: var(--ink);
  color: #F3EAD9;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-deep);
  z-index: 60;
  transform: translateY(150%);
  transition: transform 0.35s ease;
}
.install-banner.show { transform: translateY(0); }
.install-banner .txt { flex: 1; font-size: 0.86rem; }
.install-banner button.install {
  background: var(--brass);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
}
.install-banner button.dismiss {
  background: transparent;
  border: none;
  color: #B7AC9D;
  font-size: 1.1rem;
  padding: 4px 8px;
}

/* ---------------- Skeleton loading ---------------- */

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-lg);
  height: 260px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

@media (max-width: 560px) {
  .hero { padding: 28px 16px 16px; }
  .categories-bar { top: 64px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-body { padding: 10px; gap: 5px; }
  .card-title { font-size: 0.88rem; }
  .card-desc { font-size: 0.76rem; -webkit-line-clamp: 2; }
  .price { font-size: 0.92rem; }
  .cal-badge { width: 42px; height: 42px; top: 6px; }
  .quick-add-btn { width: 34px; height: 34px; font-size: 1.3rem; bottom: 6px; }
  .cal-badge b { font-size: 0.78rem; }
  .cal-badge span { font-size: 0.42rem; }
  .info-chip { font-size: 0.6rem; padding: 2px 7px; }
  .dev-credit { flex-direction: column; gap: 4px; }
  .dev-credit-sep { display: none; }
  .currency-select { display: none; }
}

/* ============================================================
   Customer account: cart, login modal, checkout, wallet
   ============================================================ */

.icon-btn { position: relative; }

.cart-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  background: var(--paprika);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brass); border-color: var(--brass); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--paprika); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---- Modal ---- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(26,22,20,0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 300; padding: 16px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  max-width: 480px; width: 100%; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-deep); padding: 22px;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-hint { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 16px; line-height: 1.6; }
.modal-status { text-align: center; color: var(--brass-strong); font-weight: 700; font-size: 0.9rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---- Toasts ---- */

.toast-stack {
  position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 400;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--ink); color: #F3EAD9; padding: 12px 18px;
  border-radius: var(--radius-sm); font-size: 0.85rem; box-shadow: var(--shadow-deep);
  opacity: 0; transform: translateY(10px); transition: all 0.25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--paprika); }

/* ---- Quantity stepper ---- */

.qty-stepper {
  display: inline-flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
}
.qty-stepper button {
  background: none; border: none; font-size: 1.1rem; font-weight: 800;
  color: var(--brass-strong); width: 22px; height: 22px; line-height: 1;
}
.qty-stepper span { min-width: 20px; text-align: center; font-weight: 700; }

/* ---- Addon selection (product page) ---- */

.addon-check-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 0.88rem;
}
.addon-check-row label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.addon-check-row input { width: 18px; height: 18px; accent-color: var(--brass); }

/* ---- Cart / checkout page ---- */

.cart-line {
  display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border);
}
.cart-line img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-title { font-weight: 700; font-size: 0.92rem; }
.cart-line-meta { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }
.cart-line-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

.summary-row {
  display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9rem;
}
.summary-row.total { font-weight: 800; font-size: 1.05rem; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; }

.address-card {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px;
  margin-bottom: 10px; cursor: pointer; transition: border-color 0.15s ease;
}
.address-card.selected { border-color: var(--brass); border-width: 2px; }
.address-card-title { font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.address-card-text { color: var(--text-muted); font-size: 0.8rem; margin-top: 4px; }

.pay-method-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer;
}
.pay-method-row input { accent-color: var(--brass); width: 18px; height: 18px; }
.pay-method-row.disabled { opacity: 0.5; cursor: not-allowed; }

#map-picker { height: 320px; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 14px; position: relative; isolation: isolate; z-index: 0; }

.coverage-banner {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; margin-bottom: 14px;
}
.coverage-banner.ok { background: rgba(110,139,106,0.15); color: var(--sage); }
.coverage-banner.bad { background: rgba(181,67,43,0.12); color: var(--paprika); }

/* ---- Account page tabs ---- */

.account-tabs {
  display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto;
  position: sticky; top: var(--topbar-height, 64px); z-index: 30;
  background: var(--bg); padding: 10px 0; border-bottom: 1px solid var(--border);
}
.account-tab-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; font-weight: 700; font-size: 0.85rem; color: var(--text-muted); white-space: nowrap;
}
.account-tab-btn.active { background: var(--brass); border-color: var(--brass); color: #fff; }

.order-card {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px;
}
.order-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-status-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }

.wallet-balance-box {
  background: linear-gradient(135deg, var(--brass), var(--brass-strong));
  color: #fff; border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; text-align: center;
}
.wallet-balance-box .amount { font-size: 2.2rem; font-weight: 800; }
.wallet-balance-box .label { font-size: 0.85rem; opacity: 0.9; }

@media (max-width: 560px) {
  .modal { padding: 18px; border-radius: var(--radius-md); }
}

/* ---- Order status pill colors (mirrors admin.css badges) ---- */
.order-status-pill.pending { background: #FFF3CD; color: #8A6D1D; }
.order-status-pill.confirmed { background: #D6EAF8; color: #1F5F8B; }
.order-status-pill.preparing { background: #E2D6F8; color: #5B3E96; }
.order-status-pill.out_for_delivery { background: #D4EFDF; color: #1E7E4E; }
.order-status-pill.delivered { background: #D5F5E3; color: #196F3D; }
.order-status-pill.cancelled { background: #FADBD8; color: #943126; }

.order-item-row-mini { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 4px 0; color: var(--text-muted); }
.tx-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 0.85rem; }
.tx-row .tx-type { font-weight: 700; }
.tx-row .tx-date { color: var(--text-muted); font-size: 0.75rem; }
.tx-amount.positive { color: var(--sage); font-weight: 700; }
.tx-amount.negative { color: var(--paprika); font-weight: 700; }

/* ---- Sticky checkout bar (cart.html) ---- */
.sticky-checkout-bar {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 150;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.sticky-checkout-bar-inner {
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
}
.sticky-checkout-total { display: flex; flex-direction: column; font-size: 0.72rem; color: var(--text-muted); line-height: 1.3; }
.sticky-checkout-total b { font-size: 1.1rem; color: var(--text); }
.sticky-checkout-bar #place-order-btn { flex: 1; }
.cart-bottom-spacer { height: 84px; }

/* ---- Delivery confirmation code (shown to customer while out for delivery) ---- */
.delivery-code-box {
  background: linear-gradient(135deg, var(--brass), var(--brass-strong));
  color: #fff; border-radius: var(--radius-md); padding: 14px; text-align: center; margin-top: 10px;
}
.delivery-code-label { font-size: 0.75rem; opacity: 0.9; margin-bottom: 4px; }
.delivery-code-value { font-size: 1.8rem; font-weight: 800; letter-spacing: 6px; }
.delivery-code-hint { font-size: 0.7rem; opacity: 0.85; margin-top: 4px; }

/* ---- Public store rating trust widget (home page) ---- */
.store-rating-widget {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 16px 24px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
.srw-item { text-align: center; }
.srw-star-single { display: inline-flex; align-items: center; align-self: center; }
.srw-star-single svg { display: block; }
.srw-value { display: flex; align-items: baseline; justify-content: center; gap: 3px; }
.srw-value b { font-size: 1.4rem; font-weight: 800; color: var(--brass-strong); }
.srw-sub { font-size: 0.8rem; color: var(--text-muted); }
.srw-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.srw-divider { width: 1px; height: 34px; background: var(--border); }

@media (max-width: 560px) {
  .store-rating-widget { gap: 10px; padding: 10px 12px; margin-bottom: 14px; border-radius: var(--radius-md); }
  .srw-value b { font-size: 1rem; }
  .srw-sub, .srw-label { font-size: 0.64rem; }
  .srw-star-single svg { width: 14px; height: 14px; }
  .srw-divider { height: 22px; }
}

/* ---- Store closed banner ---- */
.store-closed-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(181,67,43,0.1); color: var(--paprika);
  border: 1px solid rgba(181,67,43,0.3); border-radius: var(--radius-md);
  padding: 12px 16px; margin-bottom: 16px; font-size: 0.85rem; font-weight: 600;
}
.scb-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ---- Out of stock ---- */
.card-out-of-stock .card-media img { filter: grayscale(0.7); opacity: 0.7; }
.out-of-stock-label { color: var(--paprika); font-weight: 700; font-size: 0.9rem; }

/* ---- Return request items ---- */
.return-item-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px dashed var(--border); font-size: 0.85rem; flex-wrap: wrap;
}
.qty-stepper-mini { display: flex; align-items: center; gap: 8px; }
.qty-stepper-mini button {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); font-weight: 800; cursor: pointer;
}

/* ---- Coupon box (cart page) ---- */
.coupon-input-row { display: flex; gap: 8px; }
.coupon-input-row input {
  flex: 1; padding: 10px 14px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: inherit;
}
#coupon-applied-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: color-mix(in srgb, var(--sage, #6E8B6A) 12%, transparent);
  border: 1px solid var(--sage, #6E8B6A); border-radius: var(--radius-md);
  padding: 10px 14px; margin-top: 8px; font-size: 0.85rem;
}
#coupon-applied-box button {
  background: none; border: none; color: var(--paprika); font-size: 0.78rem; cursor: pointer; font-weight: 700;
}

/* ---- Offers/Coupons list (account page) ---- */
.offer-card {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px dashed var(--brass); border-radius: var(--radius-md); padding: 14px;
  margin-bottom: 12px; position: relative; overflow: hidden;
}
.offer-card.used { opacity: 0.55; border-style: solid; border-color: var(--border); }
.offer-card-badge {
  flex-shrink: 0; width: 54px; height: 54px; border-radius: 50%;
  background: var(--brass); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; text-align: center; line-height: 1.1;
}
.offer-card-body { flex: 1; min-width: 0; }
.offer-card-code {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: 1px;
  background: var(--surface-2); border-radius: 999px; padding: 3px 12px; font-size: 0.85rem; margin-bottom: 4px;
  cursor: pointer; border: none;
}
.offer-card-desc { font-size: 0.8rem; color: var(--text-muted); }
.offer-card-used-tag { font-size: 0.72rem; color: var(--paprika); font-weight: 700; margin-top: 4px; }
