/* ============================================================
   Pappu Meesho Mini App — Design System
   Adapts to the Telegram theme (light/dark) via --tg-theme-* vars,
   with a polished Meesho-rose fallback for plain browsers.
   Fonts: Rubik (display) + Nunito Sans (body) — e-commerce pairing.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800&family=Nunito+Sans:wght@400;600;700;800&display=swap');

:root {
  color-scheme: light dark;
  /* Brand */
  --brand: #ee2852;
  --brand-strong: #d61c46;
  --brand-glow: rgba(238, 40, 82, 0.35);
  --grad: linear-gradient(135deg, #ff5e3a 0%, #ee2852 45%, #b8185b 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 94, 58, 0.14), rgba(238, 40, 82, 0.14));

  /* Telegram-aware surface tokens (contrast-safe fallbacks for plain browser) */
  --bg: var(--tg-theme-bg-color, #f8fafc);
  --surface: var(--tg-theme-section-bg-color, #ffffff);
  --surface-2: var(--tg-theme-secondary-bg-color, #f1f5f9);
  --text: var(--tg-theme-text-color, #0f172a);
  --hint: var(--tg-theme-hint-color, #334155);
  --accent: var(--tg-theme-button-color, #ee2852);
  --on-accent: var(--tg-theme-button-text-color, #ffffff);
  --accent-text: var(--tg-theme-accent-text-color, #ee2852);
  --link: var(--tg-theme-link-color, #ee2852);
  --destructive: var(--tg-theme-destructive-text-color, var(--bad));
  --separator: var(--tg-theme-section-separator-color, rgba(2, 6, 23, 0.08));

  /* Semantic status colors — brightened under dark mode so small text stays
     readable (the hardcoded greens/reds below were unreadable on dark bg). */
  --good: #00a862;        /* success / discount green */
  --good-strong: #00895a;
  --bad: #e53935;         /* error red */
  --bad-strong: #c62828;


  /* Typography */
  --font-display: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-2: 0 6px 18px rgba(15, 23, 42, 0.12), 0 20px 44px rgba(15, 23, 42, 0.12);
  --shadow-brand: 0 8px 22px var(--brand-glow);

  /* Shape */
  --radius-sm: 10px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Z-index scale */
  --z-header: 100;
  --z-nav: 150;
  --z-modal: 200;
  --z-toast: 300;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 54px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Dark mode: the app leans on Telegram's injected theme vars, but the success/
   error accents were hardcoded light-theme tones that vanish on a dark surface,
   and the dark `--separator`/shadows are near-invisible. Brighten the status
   colors and re-tune borders/elevation so cards read clearly at night. */
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #ff4d6d;
    --brand-strong: #ff758f;
    --bg: var(--tg-theme-bg-color, #0f172a);
    --surface: var(--tg-theme-section-bg-color, #1e293b);
    --surface-2: var(--tg-theme-secondary-bg-color, #334155);
    --text: var(--tg-theme-text-color, #f8fafc);
    --hint: var(--tg-theme-hint-color, #94a3b8);
    --accent: var(--tg-theme-button-color, #ff4d6d);
    --on-accent: var(--tg-theme-button-text-color, #ffffff);
    --accent-text: var(--tg-theme-accent-text-color, #ff4d6d);
    --good: #2ecc71;
    --good-strong: #27ae60;
    --bad: #ff6b6b;
    --bad-strong: #e5534b;
    --brand-glow: rgba(255, 77, 109, 0.45);
    --grad-soft: linear-gradient(135deg, rgba(255, 94, 58, 0.22), rgba(255, 77, 109, 0.22));
    --separator: rgba(255, 255, 255, 0.14);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 6px 18px rgba(0, 0, 0, 0.5), 0 20px 44px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(120% 60% at 50% -10%, var(--grad-soft), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Visible keyboard focus everywhere (accessibility) */
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Consistent SVG icon treatment */
.ic {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  flex: 0 0 auto;
}

h1, h2, h3, h4, .price, .brand-name, .hero-title, .nav-label {
  font-family: var(--font-display);
}

/* ---------- Header ---------- */
.glass-header {
  position: sticky; top: 0; z-index: 100;
  padding: calc(8px + var(--safe-top)) 14px 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--separator);
}

.brand {
  display: flex; align-items: center; gap: 10px;
}
.brand-logo {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--grad);
  display: grid; place-items: center;
  font-size: 19px; color: #fff;
  box-shadow: var(--shadow-brand);
}
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.brand-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-sub { font-size: 10.5px; color: var(--hint); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--separator);
  padding: 6px 12px 6px 6px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; max-width: 46vw; overflow: hidden;
}
.user-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  flex: 0 0 auto;
}
.user-chip .chip-label { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Layout ---------- */
#main-content { padding: 14px 12px 8px; max-width: 560px; margin: 0 auto; }
.view { animation: viewIn 0.32s var(--ease); }
.view.hidden { display: none; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.section-link { font-size: 13px; font-weight: 600; color: var(--accent-text); background: none; border: none; cursor: pointer; }

/* ---------- Stat strip (compact summary — replaces the tall hero) ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--separator);
  border-radius: var(--radius-sm); padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.stat-k { font-size: 10.5px; font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: .05em; }
.stat-v { font-size: 15px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Account cards ---------- */
.accounts-list { display: grid; gap: 12px; }
.account-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-1);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.account-card:active { transform: scale(0.985); }
.account-icon {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 14px;
  display: grid; place-items: center; font-size: 22px;
  background: var(--grad-soft);
}
.account-info { flex: 1; min-width: 0; }
.account-phone { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.account-meta { font-size: 12.5px; color: var(--hint); margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.account-def { font-size: 11.5px; color: var(--accent-text); margin-top: 3px; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.account-def .ic { width: 12px; height: 12px; }

.fod-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700;
  color: var(--brand-strong);
  background: var(--grad-soft);
  padding: 3px 10px; border-radius: var(--radius-pill);
}
.fod-pill .spark { animation: sparkle 2.4s ease-in-out infinite; }
@keyframes sparkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.fod-pill.empty { color: var(--hint); background: var(--surface-2); }

.account-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.fresh-badge {
  display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px;
}
.fresh-badge.new { color: var(--good); background: rgba(0, 168, 98, 0.13); }
.fresh-badge.used { color: var(--hint); background: var(--surface-2); border: 1px solid var(--separator); }
.fresh-badge.unknown { color: var(--hint); background: transparent; font-weight: 700; }
.account-use {
  border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #fff;
  background: var(--grad); padding: 8px 16px; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-brand);
  transition: transform 0.15s var(--ease), opacity 0.15s;
}
.account-use:active { transform: scale(0.94); }
.account-use.disabled { opacity: 0.45; }

.empty-state { text-align: center; padding: 24px 16px; color: var(--hint); }
.empty-state .empty-emoji { font-size: 32px; display: block; margin-bottom: 10px; }
.empty-state h4 { color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty-state p { font-size: 13.5px; }

/* ---------- Search ---------- */
.search-wrap { position: relative; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.search-bar { display: flex; align-items: center; gap: 10px; }
.search-input {
  flex: 1; width: 100%;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 10px 14px 10px 40px;
  font-size: 16px; color: var(--text);
  outline: none; font-family: inherit;
  box-shadow: var(--shadow-1);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input::placeholder { color: var(--hint); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--brand-glow); }
.search-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 17px; opacity: 0.55; pointer-events: none; }

/* Type-ahead suggestions under the search box (reference meesho_search_suggest) */
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% - 6px);
  background: var(--surface); border: 1px solid var(--separator);
  border-radius: var(--radius); box-shadow: var(--shadow-2);
  overflow: hidden; z-index: 40; max-height: 280px; overflow-y: auto;
}
.search-suggest-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 14px;
  background: none; border: none; border-bottom: 1px solid var(--separator);
  font-size: 15px; color: var(--text); text-align: left; cursor: pointer; font-family: inherit;
}
.search-suggest-item:last-child { border-bottom: none; }
.search-suggest-item:active { filter: brightness(0.94); }
.search-suggest-item .search-ico { position: static; transform: none; font-size: 14px; opacity: 0.5; }

/* ---------- Product grid ---------- */
.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.product-card {
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  display: flex; flex-direction: column;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.product-card:active { transform: scale(0.98); }
.product-img-wrap { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--surface-2); }
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.product-card:active .product-img-wrap img { transform: scale(1.04); }
.product-fod {
  position: absolute; top: 8px; left: 8px;
  background: rgba(255, 255, 255, 0.92); color: var(--brand-strong);
  font-size: 10.5px; font-weight: 800;
  padding: 3px 8px; border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(4px);
}

/* ---------- Wishlist hearts ---------- */
.wish-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid var(--separator);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer; z-index: 2;
}
.wish-btn .ic { width: 17px; height: 17px; }
.wish-btn:active { transform: scale(0.86); }
.wish-btn.active { color: var(--accent); }
.wish-btn.active .ic { fill: currentColor; }
.wish-btn.sheet { top: 12px; right: 12px; width: 40px; height: 40px; }
.wish-btn.sheet .ic { width: 20px; height: 20px; }

/* Product share button — top-right of the sheet hero, left of the wishlist heart. */
.pd-share {
  position: absolute; top: 12px; right: 60px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid var(--separator);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer; z-index: 2;
}
.pd-share .ic { width: 20px; height: 20px; }
.pd-share:active { transform: scale(0.86); }

.wish-open-btn {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--separator);
  color: var(--text);
  cursor: pointer;
}
.wish-open-btn .ic { width: 20px; height: 20px; }
.wish-open-btn:active { transform: scale(0.92); color: var(--accent); }

.product-info { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); }
.price-row { display: flex; align-items: baseline; gap: 7px; }
.price { font-size: 16.5px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.mrp { font-size: 12px; color: var(--hint); text-decoration: line-through; }
.discount-pct { font-size: 11px; font-weight: 700; color: var(--good); }
.card-actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.product-add, .product-bulk {
  border: none; cursor: pointer; text-align: center;
  font-size: 13px; font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 9px;
  transition: background 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.product-add {
  color: #fff;
  background: var(--grad);
}
.product-add:active { transform: scale(0.97); filter: brightness(0.94); }
.product-bulk {
  color: var(--accent-text);
  background: var(--surface-2);
}
.product-bulk:active { transform: scale(0.97); background: var(--brand-glow); }


/* ---------- Bottom sheet modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 8, 20, 0.5); backdrop-filter: blur(3px); animation: fadeIn 0.2s ease; }
.modal-sheet {
  position: relative;
  width: 100%; max-width: 560px;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 8px 18px calc(18px + var(--safe-bottom));
  max-height: 88dvh; overflow-y: auto;
  box-shadow: var(--shadow-2);
  animation: sheetUp 0.32s var(--ease);
  overscroll-behavior: contain;
}
.sheet-handle { width: 44px; height: 5px; border-radius: var(--radius-pill); background: var(--separator); margin: 4px auto 14px; }
@keyframes sheetUp { from { transform: translateY(60%); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.close-modal {
  position: absolute; right: 14px; top: 14px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--surface-2); color: var(--hint);
  font-size: 19px; line-height: 1; display: grid; place-items: center;
  transition: background 0.15s, transform 0.15s;
}
.close-modal:active { transform: scale(0.9); background: var(--brand-glow); color: var(--brand-strong); }

.pd-hero { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; background: var(--surface-2); }
.pd-hero img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.pd-fod { position: absolute; top: 10px; left: 10px; background: var(--grad); color: #fff; font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: var(--radius-pill); box-shadow: var(--shadow-brand); }
.pd-name { font-size: 17px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.pd-price { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.pd-price .price { font-size: 24px; }
.pd-meta { font-size: 13px; color: var(--hint); margin-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.pd-desc { font-size: 13.5px; color: var(--hint); margin-top: 10px; line-height: 1.55; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 700;
  padding: 11px 16px; border-radius: var(--radius);
  transition: transform 0.15s var(--ease), opacity 0.15s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--grad); color: #fff; box-shadow: var(--shadow-brand);
}
.btn-primary:disabled { opacity: 0.5; box-shadow: none; }
.btn-outline {
  background: transparent; color: var(--accent-text);
  border: 1.5px solid var(--accent);
}
.btn-ghost { background: var(--surface-2); color: var(--text); }
.sheet-divider { height: 1px; background: var(--separator); margin: 16px 0; }
.import-json { resize: vertical; min-height: 84px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.btn-sm { font-size: 13px; padding: 9px 14px; border-radius: var(--radius-sm); }
.w-100 { width: 100%; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }

/* ---------- Cart ---------- */
.cart-list { display: grid; gap: 12px; }
.cart-item { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--separator); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-1); }
.cart-item img { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: var(--surface-2); }
.cart-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cart-info h4 { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-var { font-size: 12px; color: var(--hint); }
.cart-price { font-size: 15px; font-weight: 800; }

.summary-card { background: var(--surface); border: 1px solid var(--separator); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-1); }
.summary-row { display: flex; justify-content: space-between; align-items: center; font-size: 14.5px; padding: 5px 0; }
.summary-row.total { border-top: 1px dashed var(--separator); margin-top: 8px; padding-top: 12px; font-size: 17px; font-weight: 800; }
.summary-save { font-size: 12.5px; font-weight: 600; color: var(--good); background: rgba(0, 168, 98, 0.1); padding: 3px 10px; border-radius: var(--radius-pill); }

/* Checkout price breakdown — MRP → discounts → shipping → total */
.price-bk { margin: 12px 0 2px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--separator); border-radius: var(--radius); }
.price-bk .summary-row { font-size: 13.5px; padding: 4px 0; }
.price-bk .summary-row.total { font-size: 16px; }
.price-bk .bk-good { color: var(--good); font-weight: 700; }

/* ---------- Address ---------- */
.address-grid { display: grid; gap: 12px; }
.address-card {
  background: var(--surface); border: 1px solid var(--separator);
  border-radius: var(--radius); padding: 14px;
  cursor: pointer; position: relative;
  box-shadow: var(--shadow-1);
  transition: border-color 0.15s, transform 0.15s;
}
.address-card:active { transform: scale(0.99); }
.address-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--brand-glow); }
.address-card .addr-name { font-size: 15px; font-weight: 700; }
.address-card .addr-line { font-size: 13px; color: var(--hint); margin-top: 3px; line-height: 1.5; }
.address-card .addr-phone { font-size: 12.5px; color: var(--accent-text); margin-top: 6px; font-weight: 600; }
.addr-check {
  position: absolute; top: 14px; right: 14px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--separator);
  display: grid; place-items: center; font-size: 13px; color: transparent;
  transition: all 0.2s;
}
.address-card.selected .addr-check { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 6px 8px var(--safe-bottom);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid var(--separator);
  display: flex; justify-content: space-around; align-items: center;
  max-width: 560px; margin: 0 auto;
}
.nav-item {
  position: relative; flex: 1; max-width: 120px;
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; color: var(--hint);
  padding: 6px 4px; border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.nav-item .icon { font-size: 21px; line-height: 1; position: relative; z-index: 1; transition: transform 0.25s var(--ease); }
.nav-item .nav-dot { position: absolute; top: -2px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--bg); display: none; }
.nav-item.has-badge .nav-dot { display: block; }
.nav-item.active { color: var(--accent); }
.nav-item.active .icon { transform: translateY(-1px) scale(1.08); }
.nav-pill {
  position: absolute; top: 3px; bottom: 3px; left: 8px; right: 8px;
  background: var(--grad-soft);
  border-radius: var(--radius-sm);
  transition: opacity 0.2s; opacity: 0;
}
.nav-item.active .nav-pill { opacity: 1; }
.nav-item .nav-label { position: relative; z-index: 1; }

/* ---------- Loaders / skeletons ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius); }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--surface-2); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-wrap { display: grid; place-items: center; padding: 40px 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%) translateY(16px);
  background: rgba(24, 20, 44, 0.92); color: #fff;
  padding: 11px 18px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-2); z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: linear-gradient(135deg, var(--good), var(--good-strong)); }
.toast.error { background: linear-gradient(135deg, var(--bad), var(--bad-strong)); }
.toast.info { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* ---------- Misc utilities ---------- */
.text-center { text-align: center; }
.text-secondary { color: var(--hint); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.divider { height: 1px; background: var(--separator); margin: 18px 0; }

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

/* =====================================================================
   Pro-Max pass — SVG sizing, touch targets, focus, new components
   ===================================================================== */

/* SVG icon sizing inside existing containers */
.brand-logo .ic, .account-icon .ic { width: 24px; height: 24px; }
.user-chip .avatar .ic { width: 15px; height: 15px; }
.section-link .ic { width: 14px; height: 14px; vertical-align: -2px; }
.search-ico .ic { width: 18px; height: 18px; display: block; }
.empty-emoji .ic { width: 32px; height: 32px; opacity: 0.5; display: inline-block; }
.fod-pill .spark { display: inline-flex; }
.fod-pill .spark .ic { width: 13px; height: 13px; }
.nav-item .icon .ic { width: 23px; height: 23px; }
.back-btn .ic { width: 20px; height: 20px; }

/* 44px touch targets + pointer affordance (Pro-Max) */
.nav-item { min-height: 46px; }
.nav-item .icon, .nav-item .nav-label { pointer-events: none; }
.account-card, .product-card, .address-card, .cart-item { cursor: pointer; }
.btn, .account-use, .account-del, .product-add, .product-bulk, .qty-btn, .shop-mode, .pay-seg-btn, .back-btn {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.account-use, .account-del { min-height: 36px; }
.account-del {
  border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--hint);
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.account-del .ic { width: 16px; height: 16px; }
.account-del:active { transform: scale(0.9); color: var(--bad); background: rgba(229, 57, 53, 0.12); }

/* focus-visible rings */
.btn:focus-visible, .nav-item:focus-visible, .account-use:focus-visible,
.account-del:focus-visible, .product-add:focus-visible, .product-bulk:focus-visible, .shop-mode:focus-visible,
.pay-seg-btn:focus-visible, .qty-btn:focus-visible, .back-btn:focus-visible,
.section-link:focus-visible, .search-input:focus-visible, #link-input:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--brand-glow);
}

/* ---------- Shop mode toggle (Search / Link) ---------- */
.shop-modes { display: flex; gap: 6px; background: var(--surface-2); border-radius: var(--radius-pill); padding: 3px; }
.shop-mode {
  border: none; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 700; color: var(--hint);
  background: transparent; padding: 7px 13px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.18s, color 0.18s;
}
.shop-mode .ic { width: 15px; height: 15px; }
.shop-mode.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- Product cards: pay modes + FOD line ---------- */
.product-fod.fod {
  top: auto; bottom: 8px; left: 8px; right: 8px;
  background: var(--grad); color: #fff;
  display: inline-flex; align-items: center; gap: 5px; justify-content: center;
  font-size: 11px; box-shadow: var(--shadow-brand);
}
.product-fod.fod .ic { width: 13px; height: 13px; }
.pay-modes { display: flex; gap: 6px; flex-wrap: wrap; }
.pm {
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-sm);
}
.pm.upi { color: var(--brand-strong); background: var(--grad-soft); }
.pm.cod { color: var(--hint); background: var(--surface-2); }
.fod-line {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--brand-strong);
}
.fod-line .ic { width: 13px; height: 13px; }
.grid-sentinel { height: 1px; grid-column: 1 / -1; }

/* ---------- Product sheet: FOD banner + price block ---------- */
.pd-fod-banner {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px;
  background: var(--grad-soft); color: var(--brand-strong);
  font-size: 13px; font-weight: 700; line-height: 1.45;
  padding: 10px 12px; border-radius: var(--radius-sm);
}
.pd-fod-banner .ic { width: 16px; height: 16px; flex: 0 0 auto; }
.pd-price-block { margin-top: 10px; background: var(--surface-2); border-radius: var(--radius); padding: 12px; }
.pd-price-row { display: flex; align-items: baseline; gap: 8px; }
.pd-price-row .price { font-size: 24px; }
.pd-pay-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pay-opt {
  border: 1px solid var(--separator); border-radius: var(--radius-sm);
  padding: 10px; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface);
}
.pay-opt .pay-ic { width: 20px; height: 20px; color: var(--hint); margin-bottom: 2px; }
.pay-opt .pay-label { font-size: 11px; color: var(--hint); font-weight: 600; }
.pay-opt .pay-val { font-size: 16px; font-weight: 800; }
.pay-opt .pay-save { font-size: 10.5px; font-weight: 700; color: var(--good); }
.pay-upi { border-color: var(--accent); }
.pd-promo { margin-top: 10px; font-size: 12.5px; color: var(--brand-strong); font-weight: 600; }

/* ---------- Cart: qty stepper + pay compare ---------- */
.qty-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty-btn {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--separator); background: var(--surface-2);
  color: var(--text); cursor: pointer; padding: 0;
  transition: transform 0.15s, background 0.15s;
}
.qty-btn .ic { width: 15px; height: 15px; }
.qty-btn:active { transform: scale(0.9); background: var(--brand-glow); }
.qty-btn.del { border-color: transparent; color: var(--hint); }
.qty-btn.del:active { color: var(--bad); }
.qty-val { font-size: 15px; font-weight: 800; min-width: 18px; text-align: center; }
.pay-compare { gap: 10px; font-size: 13.5px; font-weight: 600; }
.cmp-cod, .cmp-upi { display: inline-flex; align-items: center; gap: 5px; }
.cmp-cod .ic, .cmp-upi .ic { width: 15px; height: 15px; }
.cmp-cod { color: var(--hint); }
.cmp-upi { color: var(--brand-strong); }

/* ---------- Checkout ---------- */
.back-btn {
  border: none; cursor: pointer; background: var(--surface-2);
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; color: var(--text);
  margin-right: 10px; padding: 0;
  transition: transform 0.15s, background 0.15s;
}
.back-btn:active { transform: scale(0.92); background: var(--brand-glow); }
.addr-body { padding-right: 30px; }
.addr-type {
  font-size: 10.5px; font-weight: 700; color: var(--accent-text);
  background: var(--grad-soft); padding: 2px 8px; border-radius: var(--radius-pill);
  margin-left: 6px; vertical-align: 1px;
}
.addr-unsvc { font-size: 11.5px; font-weight: 700; color: var(--bad); margin-top: 6px; }
.addr-check .ic { width: 14px; height: 14px; }

.pay-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-seg-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 8px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--separator);
  cursor: pointer; font-family: inherit; text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.pay-seg-btn b { font-size: 16px; font-weight: 800; color: var(--text); }
.pay-seg-btn span { font-size: 11.5px; color: var(--hint); }
.pay-seg-btn.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--brand-glow); background: var(--grad-soft); }
.pay-seg-btn.active b { color: var(--brand-strong); }
.pay-seg-btn.active span { color: var(--brand-strong); }
.checkout-note {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 12.5px; color: var(--hint); font-weight: 600;
}
.checkout-note .ic { width: 14px; height: 14px; color: var(--brand-strong); }
.checkout-total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--separator);
  font-size: 15px; color: var(--hint); font-weight: 600;
}
.checkout-total-row b { font-size: 19px; font-weight: 800; color: var(--text); }

.spinner-inline {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

/* ---------- Order result ---------- */
.order-success, .order-error { text-align: center; padding: 34px 18px; }
.success-ring, .error-ring {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto 14px;
}
.success-ring { background: linear-gradient(135deg, var(--good), var(--good-strong)); color: #fff; box-shadow: 0 12px 30px rgba(0, 168, 98, 0.35); }
.error-ring { background: linear-gradient(135deg, var(--bad), var(--bad-strong)); color: #fff; box-shadow: 0 12px 30px rgba(229, 57, 53, 0.35); }
.success-ring .ic, .error-ring .ic { width: 32px; height: 32px; }
.order-success h3, .order-error h3 { font-size: 19px; margin-bottom: 6px; }
.order-num { font-size: 13.5px; color: var(--hint); margin-bottom: 4px; }
.order-amt { font-size: 14px; font-weight: 700; color: var(--text); }
.err-text { font-size: 13.5px; color: var(--text); margin-top: 8px; line-height: 1.5; }
.err-hint { font-size: 12.5px; color: var(--hint); margin-top: 8px; line-height: 1.5; }

/* ---------- Confirm sheet ---------- */
.confirm-title { font-size: 18px; font-weight: 800; }
.confirm-text { font-size: 13.5px; color: var(--hint); margin-top: 8px; line-height: 1.5; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.btn-danger {
  background: linear-gradient(135deg, var(--bad), var(--bad-strong)); color: #fff; box-shadow: 0 8px 20px rgba(229, 57, 53, 0.3);
}
.btn-danger:disabled { opacity: 0.5; box-shadow: none; }

/* ---------- Session refresh on account cards ---------- */
.account-ref {
  width: 30px; height: 30px; border-radius: 9px; border: none; cursor: pointer;
  background: transparent; color: var(--hint); display: grid; place-items: center; padding: 0;
}
.account-ref .ic { width: 16px; height: 16px; }
.account-ref:active { transform: scale(0.9); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.account-ref.spin .ic { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Orders ---------- */
.orders-chips {
  display: flex; flex-wrap: wrap; gap: 7px; margin: -4px 0 12px;
}
.orders-chips.hidden { display: none; }
.orders-chip {
  border: 1px solid var(--separator); background: var(--surface);
  color: var(--text); font-size: 12.5px; font-weight: 700;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.15s, color 0.15s, background 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.orders-chip:active { transform: scale(0.94); }
.orders-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hint); }
.orders-chip.active {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: var(--shadow-brand);
}
.orders-chip.active .dot { background: #fff; }
.orders-list { display: flex; flex-direction: column; gap: 10px; }
.order-card {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--surface); border: 1px solid var(--separator); border-radius: 16px;
  box-shadow: var(--shadow-1); cursor: pointer;
}
.order-card:active { transform: scale(0.985); }
.order-thumb {
  width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
  background: var(--surface-2);
}
.order-info { flex: 1; min-width: 0; }
.order-info h4 {
  font-size: 14px; font-weight: 800; color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.order-meta { font-size: 12.5px; color: var(--hint); display: block; }
.order-num { font-size: 11.5px; color: var(--hint); display: block; margin-top: 2px; }
.order-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.order-status {
  font-size: 11px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.order-status.ok { background: rgba(0, 168, 98, 0.13); color: var(--good); }
.order-status.bad { background: rgba(229, 57, 53, 0.12); color: var(--bad); }
.order-date { font-size: 11px; color: var(--hint); }
.session-error { padding: 34px 18px; }
.session-error .btn { min-height: 44px; }

/* ---------- Order detail sheet ---------- */
.od-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.od-date { font-size: 12px; color: var(--hint); }
.od-product { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--separator); }
.od-product img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.od-product h4 { font-size: 15px; font-weight: 800; color: var(--text); line-height: 1.3; }
.od-section { padding: 10px 0; border-bottom: 1px solid var(--separator); }
.od-section h5 {
  font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--hint); display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.od-section h5 .ic { width: 15px; height: 15px; }
.bd-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--hint); padding: 4px 0;
}
.bd-row b { color: var(--text); font-weight: 700; }
.bd-row.total { font-weight: 800; color: var(--text); margin-top: 2px; }
.bd-row.total .od-total { color: var(--brand); font-size: 15px; }
.bd-row.good span:last-child { color: var(--good); font-weight: 700; }
.od-addr { font-size: 13px; color: var(--text); line-height: 1.55; }

/* ---------- Cancel sheet ---------- */
.cancel-reasons { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 6px; }
.cancel-reason {
  display: flex; align-items: center; gap: 10px; padding: 12px 13px;
  background: var(--surface-2); border-radius: 12px; cursor: pointer;
  font-size: 13.5px; color: var(--text); line-height: 1.35;
}
.cancel-reason input { accent-color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; }
.cancel-comments {
  width: 100%; margin-top: 12px; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--separator); background: var(--surface-2); color: var(--text);
  font-family: inherit; font-size: 16px; resize: none;
}
.cancel-comments:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

/* ---------- Refer & Earn card ---------- */
.earn-card {
  margin-top: 14px; padding: 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--separator); box-shadow: var(--shadow-1);
}
.earn-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.earn-title { font-size: 14px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 6px; }
.earn-set {
  font-size: 12px; font-weight: 800; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: none; border-radius: 999px; padding: 6px 12px; cursor: pointer; min-height: 32px;
}
.earn-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.earn-lbl { color: var(--hint); width: 64px; flex-shrink: 0; }
.earn-val { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.earn-val.muted { color: var(--hint); font-weight: 500; }
.earn-actions { margin-top: 10px; }

/* ---------- Referral sheet ---------- */
.referral-input {
  width: 100%; margin-top: 14px; padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--separator); background: var(--surface-2); color: var(--text);
  font-family: inherit; font-size: 16px;
}
.referral-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.referral-qr-wrap { text-align: center; margin-top: 16px; }
.referral-qr-title { font-size: 12px; color: var(--hint); margin-bottom: 10px; }
.referral-qr { width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 8px; }

/* ---------- Default address ---------- */
.addr-star { font-size: 11px; font-weight: 800; color: var(--brand); margin-left: 6px; }
.addr-default-btn {
  margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--hint); cursor: pointer;
  background: var(--surface-2); border: none; border-radius: 999px; padding: 6px 12px;
  display: inline-flex; align-items: center; gap: 5px;
}
.addr-default-btn .ic { width: 13px; height: 13px; }
.addr-default-btn:active { color: var(--accent); }

/* ---------- Add account (OTP login + FOD) ---------- */
.section-actions { display: flex; align-items: center; gap: 14px; }
.section-actions .section-link .ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.login-fod {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--grad-soft); border: 1px solid var(--separator);
  color: var(--text); font-size: 13px; line-height: 1.5;
  display: flex; gap: 9px; align-items: flex-start;
}
.login-fod .spark { flex-shrink: 0; margin-top: 1px; color: var(--brand); }
.login-fod b { color: var(--brand-strong); }
.login-check {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--grad-soft); border: 1px solid var(--separator);
  color: var(--text); font-size: 13px; line-height: 1.5;
  white-space: pre-line; /* keep the two-line "Number / Status" format */
}
.login-error { margin-top: 12px; font-size: 12.5px; color: var(--destructive); line-height: 1.4; }
.login-error.pending { color: var(--brand-strong); font-weight: 600; }

/* ---------- Product sheet: actions + FOD calculator (b) (c) ---------- */
.pay-cod { border-color: var(--separator); }
.pay-cod .pay-save { color: var(--hint); }
.pd-actions { display: flex; gap: 10px; margin-top: 14px; }
.pd-actions .btn { flex: 1; }
.flex-1 { flex: 1 1 0 !important; }
.pd-anon-note {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--hint); font-size: 12.5px;
  display: flex; align-items: center; gap: 7px; font-weight: 600;
}
.pd-anon-note .ic { width: 15px; height: 15px; color: var(--brand); flex-shrink: 0; }
.fod-calc {
  margin-top: 12px; padding: 12px; border-radius: var(--radius);
  background: var(--grad-soft); border: 1px solid var(--separator);
}
.fod-calc-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 800; color: var(--brand-strong); margin-bottom: 8px;
}
.fod-calc-label .ic { width: 15px; height: 15px; }
.fod-calc-input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--separator); background: var(--surface);
  color: var(--text); font: 700 16px var(--font-body);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.fod-calc-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--brand-glow); }
.fod-calc-result { margin-top: 8px; font-size: 13px; color: var(--hint); line-height: 1.5; }
.fod-calc-result b { color: var(--text); }
.fod-pill.mini { font-size: 10.5px; padding: 2px 8px; gap: 3px; }

/* ---------- Anonymous browse banner (a) ---------- */
.anon-banner {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--grad-soft); border: 1px solid var(--separator);
  color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.45;
}
.anon-banner .spark { flex-shrink: 0; color: var(--brand); display: inline-flex; }
.anon-banner .spark .ic { width: 17px; height: 17px; }

/* ---------- Bulk order sheet (b) ---------- */
.bulk-block { margin-top: 14px; }
.bulk-label {
  display: block; font-size: 12.5px; font-weight: 800; color: var(--text);
  margin-bottom: 8px;
}
.bulk-options { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.bulk-opt {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--separator); border-radius: var(--radius-sm);
  padding: 10px 12px; background: var(--surface); cursor: pointer;
  transition: border-color 0.15s;
}
.bulk-opt:has(input:checked) { border-color: var(--accent); background: var(--grad-soft); }
.bulk-opt input { margin-top: 2px; accent-color: var(--brand); width: 16px; height: 16px; flex-shrink: 0; }
.bulk-opt-txt { font-size: 13px; line-height: 1.45; color: var(--text); min-width: 0; }
.bulk-opt-txt b { color: var(--text); }
.bulk-opt-txt .fod-pill { margin-left: 6px; }
.bulk-queue-title, .bulk-q-title { margin-bottom: 10px; font-size: 14px; font-weight: 800; }
.bulk-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--separator); margin-bottom: 8px;
}
.bulk-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bulk-row-phone { font-size: 14px; font-weight: 800; }
.bulk-row-sub { font-size: 12px; color: var(--hint); }
.bulk-row.bad .bulk-row-sub { color: var(--destructive); }
.bulk-row.done { border-color: var(--good); background: linear-gradient(135deg, rgba(0,168,98,0.10), rgba(0,168,98,0.05)); }
.bulk-row.done .bulk-row-sub { color: var(--good); font-weight: 700; }
.btn-sm { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn-sm .ic { width: 14px; height: 14px; }

/* ---------- UPI QR payment sheet (b) ---------- */
.upi-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 14px; }
.upi-qr {
  width: 208px; height: 208px; border-radius: var(--radius);
  background: #fff; padding: 10px; box-shadow: var(--shadow-1);
  object-fit: contain;
}
.upi-qr-note { font-size: 12.5px; color: var(--hint); font-weight: 600; }
.upi-intent { margin-top: 14px; }
.upi-intent .btn { margin-top: 10px; }

/* ---------- Bulk manage accounts (export / refresh) ---------- */
.section-link.active { color: var(--brand-strong); font-weight: 800; }
.manage-bar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-bottom) + 10px);
  z-index: 20; margin: 14px 0 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--separator); box-shadow: var(--shadow-2);
}
.manage-count { font-size: 13px; font-weight: 800; color: var(--text); white-space: nowrap; }
.manage-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.manage-bar .btn { flex: 0 0 auto; }
.sel-box { display: flex; align-items: center; padding-left: 2px; }
.sel-box input { width: 19px; height: 19px; accent-color: var(--brand); cursor: pointer; }
.sel-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad); color: #fff;
}
.sel-badge .ic { width: 14px; height: 14px; }
.account-card.sel-checked { border-color: var(--accent); background: var(--grad-soft); }
.manage-sheet-body { margin-top: 12px; }
.manage-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 46vh; overflow-y: auto; }
.manage-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--separator);
}
.manage-row.ok { border-color: var(--good); }
.manage-row.bad { border-color: var(--destructive); }
.manage-row-phone { font-size: 14px; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.manage-row-status { font-size: 12px; font-weight: 700; color: var(--hint); text-align: right; }
.manage-row.ok .manage-row-status { color: var(--good); }
.manage-row.bad .manage-row-status { color: var(--destructive); }
.manage-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.manage-copy, .manage-dl { font-size: 12px; padding: 7px 10px; }

/* Anonymous search: match count + related-category chips + CTA */
.anon-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; max-width: 320px; }
.anon-chip { font-size: 12px; font-weight: 600; color: var(--accent); background: rgba(251, 86, 122, 0.08); border: 1px solid rgba(251, 86, 122, 0.25); border-radius: 999px; padding: 5px 11px; }

/* Toggle switch (Delivery: skip address step) */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toggle-lbl { font-size: 13px; color: var(--text); font-weight: 600; }
.toggle {
  position: relative; width: 44px; height: 26px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--separator); border-radius: 999px;
  transition: background .18s ease, border-color .18s ease; cursor: pointer;
}
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text); transition: transform .18s ease, background .18s ease;
}
.toggle input:checked + .toggle-knob { transform: translateX(18px); background: #fff; }
.toggle:has(input:checked) { background: var(--accent); border-color: var(--accent); }

/* Address chip — one-line "skip address step" collapse at checkout & bulk */
.addr-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 13px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--separator);
}
.chip-ico { display: inline-flex; color: var(--accent); flex-shrink: 0; }
.chip-ico .ic { width: 16px; height: 16px; }
.chip-txt { font-size: 13px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-default { font-size: 10.5px; font-weight: 800; color: var(--accent); background: var(--grad-soft); border: 1px solid rgba(251,86,122,.25); border-radius: 999px; padding: 2px 8px; flex-shrink: 0; }
.chip-change {
  margin-left: auto; flex-shrink: 0; font-size: 12.5px; font-weight: 800;
  color: var(--accent); background: none; border: none; padding: 4px 6px; cursor: pointer;
}

/* Add-address mini-form inside the delivery settings sheet */
.add-address { margin-top: 14px; display: grid; gap: 8px; }
.add-address-title { font-size: 12px; font-weight: 800; color: var(--hint); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 2px; }
