/* ==========================================================================
   QuickKart — app.css  (v2 full redesign)
   Blinkit-style quick-commerce storefront + seller hub + admin panel.

   TABLE OF CONTENTS
   ------------------------------------------------------------------------
    1.  Design tokens
    2.  Reset & base
    3.  Utilities (container, text helpers, chips)
    4.  Buttons & form controls
    5.  Header (sticky) + account menu + cart button
    6.  Search bar + suggestions dropdown
    7.  Bottom nav (mobile)
    8.  Footer
    9.  Cart drawer + bill + overlay
   10.  Modal + auth (login / OTP)
   11.  Toast
   12.  Rating components (pill, stars, star-input)
   13.  Product card + ADD / stepper
   14.  Rails, category tiles, hero & promo banners
   15.  Category browse + search results + all-categories
   16.  Product detail page (PDP)
   17.  Ratings & reviews
   18.  Why-shop strip
   19.  Cart page / checkout / payment gateway / order tracking
   20.  Account & order history + status chips
   21.  Seller hub
   22.  Admin panel (sidebar, stats, tables, barchart, approvals)
   23.  Empty states, breadcrumbs, misc
   24.  Motion & reduced-motion
   25.  MOBILE (responsive overrides — includes the 2-row header fix)
   ========================================================================== */


/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  /* Brand — Indigo primary + Amber accent.
     (These vars keep their historical --green/--yellow names but now hold the
     indigo/amber brand palette; ~77 call sites reference them, so the whole UI
     re-themes from here.) */
  --green: #4338ca;        /* indigo — primary brand */
  --green-dark: #3730a3;   /* indigo dark — hovers */
  --green-deep: #312e81;   /* indigo deep */
  --green-tint: #eef0fb;   /* indigo tint — soft fills */
  --green-tint-soft: #f5f6fd;
  --yellow: #f59e0b;       /* amber — accent */
  --blue: #536cf0;

  /* Ratings */
  --rate-good: #16a34a;
  --rate-mid: #f59e0b;
  --rate-low: #dc2626;

  /* Neutrals */
  --ink: #1a1a1a;
  --muted: #6b7280;
  --surface: #ffffff;
  --bg-subtle: #f7f8fa;
  --bg-grey: #f1f3f5;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* Status */
  --danger: #dc2626;
  --danger-tint: #fdecec;
  --warn: #d97706;
  --info: #2563eb;
  --violet: #7c3aed;

  /* Shape & elevation */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.16);
  --ring: 0 0 0 3px rgba(12, 131, 31, 0.18);

  /* Spacing rhythm */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* Layout */
  --header-h: 76px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}


/* ==========================================================================
   2. Reset & base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
}

h1, h2, h3, h4, h5 {
  margin: 0 0 var(--sp-2);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 700;
}

p {
  margin: 0 0 var(--sp-2);
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

table {
  border-collapse: collapse;
}

::selection {
  background: rgba(12, 131, 31, 0.18);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}


/* ==========================================================================
   3. Utilities
   ========================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.container.narrow {
  max-width: 780px;
}

#main {
  min-height: 60vh;
  padding-bottom: var(--sp-6);
}

.page-title {
  font-size: 26px;
  margin: var(--sp-5) 0 var(--sp-4);
}

.page-title .muted {
  font-size: 15px;
  font-weight: 500;
}

.muted {
  color: var(--muted);
}

.muted.mini,
.mini.muted {
  font-size: 12px;
}

.mrp {
  text-decoration: line-through;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.86em;
}

.free {
  color: var(--rate-good);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.dotsep {
  color: var(--border-strong);
  margin: 0 2px;
}

.fine {
  font-size: 12px;
  color: var(--muted);
}

.fine a {
  color: var(--ink);
  font-weight: 600;
}

/* Generic chip (subcategory links, admin filters, labels) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

a.chip:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-tint-soft);
}

.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 600;
}

.chip.mini {
  font-size: 11px;
  padding: 2px 9px;
  margin-left: 8px;
  color: var(--muted);
  vertical-align: middle;
}

.chip.mini.green {
  border-color: rgba(12, 131, 31, 0.35);
  background: var(--green-tint);
  color: var(--green-dark);
  font-weight: 600;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
}

.chip-x {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
}

.chip-x:hover {
  color: var(--danger);
}

.chip form {
  display: inline;
}


/* ==========================================================================
   4. Buttons & form controls
   ========================================================================== */

.btn-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: var(--green);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid var(--green);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.btn-green:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.btn-green:active {
  transform: scale(0.98);
}

.btn-green:disabled {
  background: #c9cdd3;
  border-color: #c9cdd3;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-green.big {
  font-size: 16px;
  padding: 14px 24px;
  border-radius: 12px;
}

.btn-green.wide {
  width: 100%;
}

.btn-green.mini {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: var(--surface);
  color: var(--green);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--green);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn-outline:hover {
  background: var(--green-tint-soft);
  box-shadow: var(--shadow-xs);
}

.btn-outline.mini {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 8px;
  border-width: 1px;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: 10px;
  border: 1.5px solid var(--danger);
  transition: background 0.15s ease;
}

.btn-danger:hover {
  background: var(--danger-tint);
}

.btn-danger.wide {
  width: 100%;
}

.btn-danger.mini {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 8px;
  border-width: 1px;
}

.linklike {
  color: var(--green);
  font-weight: 600;
  font-size: 14px;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.linklike:hover {
  text-decoration: underline;
}

.linklike.danger {
  color: var(--danger);
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  color: var(--ink);
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-grey);
}

/* Inputs */
input[type="text"],
input[type="search"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: var(--ring);
}

input:disabled {
  background: var(--bg-grey);
  color: var(--muted);
}

textarea {
  resize: vertical;
  min-height: 70px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

label input,
label select,
label textarea {
  margin-top: 5px;
  font-weight: 400;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--green);
  width: 18px;
  height: 18px;
}

/* Form rows */
.frow {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

.frow > * {
  flex: 1 1 160px;
  min-width: 0;
}

.frow.between {
  justify-content: space-between;
  align-items: flex-start;
}

.frow.between > * {
  flex: 0 1 auto;
}

.form-error {
  background: var(--danger-tint);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--sp-3);
}

.form-ok {
  background: rgba(12, 131, 31, 0.08);
  border: 1px solid rgba(12, 131, 31, 0.3);
  color: var(--green, #0c831f);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--sp-3);
}

.inline-form {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}


/* ==========================================================================
   5. Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

/* Let the search claim the header's spare width so it reads as the primary action */
.header-inner .searchwrap {
  flex: 1 1 auto;
  max-width: 720px;
  margin-right: auto;
}

/* Logo */
.logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
}

.logo-quick {
  color: var(--green);
  -webkit-text-stroke: 0.5px #3730a3;
}

.logo-kart {
  color: var(--yellow);
}

.adm {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 6px;
}

/* Delivery location */
.location {
  line-height: 1.3;
  min-width: 0;
  max-width: 220px;
  border-left: 1px solid var(--border);
  padding-left: var(--sp-5);
}

.loc-eta {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: #1f2937;
  white-space: nowrap;
}

.loc-addr {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.caret {
  font-size: 10px;
  color: var(--ink);
}

/* Right-side actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-shrink: 0;
}

.login-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 4px;
  transition: color 0.15s ease;
}

.login-link:hover {
  color: var(--green);
}

/* Account dropdown */
.account-menu {
  position: relative;
}

.account-menu summary {
  list-style: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 4px;
  user-select: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu[open] summary {
  color: var(--green);
}

.menu-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  z-index: 70;
}

.menu-user {
  font-weight: 700;
  font-size: 14px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-pop a,
.menu-pop .linklike {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.menu-pop a:hover,
.menu-pop .linklike:hover {
  background: var(--green-tint-soft);
  color: var(--green-dark);
  text-decoration: none;
}

/* Green cart button */
.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--green);
  color: #fff;
  border-radius: 10px;
  padding: 9px 16px;
  min-height: 50px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  transition: background 0.15s ease, transform 0.15s ease;
}

.cart-btn:hover {
  background: var(--green-dark);
}

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

.cart-ico {
  font-size: 20px;
  line-height: 1;
}

.cart-txt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  white-space: nowrap;
}

.cart-amt {
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0.95;
}


/* ==========================================================================
   6. Search bar + suggestions
   ========================================================================== */

.searchwrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.searchbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--bg-grey);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 var(--sp-4);
  height: 48px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

/* Animated placeholder overlay: Search "curd" with the term scrolling to the
   next hint. Sits on top of the (blank-placeholder) input and never eats
   clicks; hidden the moment the field is focused or has a value. */
.search-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding-left: calc(var(--sp-4) + 25px);
  font-size: 14.5px;
  color: var(--muted);
  pointer-events: none;
}

.search-ph-lead {
  white-space: pre;
}

.search-roll {
  display: inline-block;
  height: 1.4em;
  line-height: 1.4em;
  overflow: hidden;
  margin-left: 1px;
}

.search-roll-list {
  display: flex;
  flex-direction: column;
}

.search-roll-list span {
  height: 1.4em;
  line-height: 1.4em;
  white-space: nowrap;
  font-weight: 600;
  color: #4b5563;
}

.searchbar:focus-within {
  background: var(--surface);
  border-color: var(--green);
  box-shadow: var(--ring);
}

.search-ico {
  font-size: 15px;
  opacity: 0.6;
  flex-shrink: 0;
}

.searchbar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  height: 100%;
  font-size: 14.5px;
  border-radius: 0;
}

.searchbar input:focus {
  box-shadow: none;
}

.searchbar input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.suggest-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 65;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-4);
  transition: background 0.12s ease;
}

.suggest-item:hover {
  background: var(--green-tint-soft);
}

.suggest-item img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.s-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s-unit {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.suggest-all {
  display: block;
  padding: 11px var(--sp-4);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green);
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.suggest-all:hover {
  background: var(--green-tint);
}


/* ==========================================================================
   7. Bottom nav (mobile only — hidden on desktop)
   ========================================================================== */

.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}

.bottom-nav a,
.bottom-nav button {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}

.bottom-nav a span:first-child,
.bottom-nav button span:first-child {
  font-size: 20px;
  line-height: 1;
}

.nav-badge {
  position: absolute;
  top: -2px;
  right: calc(50% - 22px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}


/* ==========================================================================
   8. Footer
   ========================================================================== */

.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-7);
  font-size: 14px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4) var(--sp-5);
  display: flex;
  gap: var(--sp-7);
  align-items: flex-start;
}

.footer-col {
  flex: 0 0 220px;
  min-width: 0;
}

.footer-col.grow {
  flex: 1 1 auto;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px var(--sp-4);
}

.footer-col:not(.grow) .footer-links {
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
}

.footer-links a {
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--green);
}

.seeall {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.seeall:hover {
  text-decoration: underline;
}

.footer-base {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.dl {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  color: var(--ink);
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.store-badge:hover {
  opacity: 0.85;
}

.footer-note {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-4) var(--sp-5);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}


/* ==========================================================================
   9. Cart drawer
   ========================================================================== */

#drawer-overlay,
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 28, 0.55);
  backdrop-filter: blur(1.5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 80;
}

#drawer-overlay.open,
#modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

#cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  background: var(--bg-subtle);
  z-index: 85;
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-lg);
}

#cart-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-head h2 {
  font-size: 17px;
  margin: 0;
}

#cart-drawer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: var(--sp-3);
  gap: var(--sp-3);
}

/* Also applies when embedded on /cart page */
.drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-4);
  color: var(--muted);
  flex: 1;
}

.drawer-empty .big {
  font-size: 52px;
  line-height: 1;
}

.savings-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--green-tint);
  color: var(--green-dark);
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px var(--sp-4);
  flex-shrink: 0;
}

.drawer-eta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.drawer-eta .big {
  font-size: 26px;
  line-height: 1;
}

.drawer-eta strong {
  font-size: 14px;
  letter-spacing: -0.01em;
}

.drawer-eta .muted {
  font-size: 12.5px;
}

.drawer-lines {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-1) var(--sp-4);
  flex-shrink: 0;
}

.dline {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
}

.dline + .dline {
  border-top: 1px solid var(--border);
}

.dline img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  flex-shrink: 0;
  padding: 4px;
}

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

.dline-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dline-info .muted {
  font-size: 12px;
}

.dline-price {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}

/* Bill card (drawer, checkout, order page) */
.bill {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4);
  flex-shrink: 0;
}

.bill h3 {
  font-size: 14px;
  margin-bottom: var(--sp-3);
}

.bill-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-3);
  font-size: 13.5px;
  color: var(--ink);
  padding: 4px 0;
}

.bill-row.grand {
  border-top: 1px dashed var(--border-strong);
  margin-top: var(--sp-2);
  padding-top: var(--sp-3);
  font-weight: 800;
  font-size: 15px;
}

.saved-chip {
  display: inline-block;
  background: var(--green-tint);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  margin-left: 6px;
}

.drawer-policy {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4);
  flex-shrink: 0;
}

.drawer-policy h4 {
  font-size: 13px;
  margin-bottom: 4px;
}

.drawer-policy p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.drawer-cta {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding-top: var(--sp-2);
  background: linear-gradient(to top, var(--bg-subtle) 70%, transparent);
  flex-shrink: 0;
}

.drawer-cta .btn-green.big {
  width: 100%;
  justify-content: space-between;
  padding: 12px var(--sp-4);
}

.total-mini {
  text-align: left;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
}

.muted-inv {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.85;
}


/* ==========================================================================
   10. Modal + auth
   ========================================================================== */

#modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: min(420px, calc(100vw - 32px));
  max-height: min(600px, calc(100vh - 48px));
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

#modal-box.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.auth-box {
  padding: var(--sp-6) var(--sp-6) var(--sp-5);
  text-align: center;
  position: relative;
}

.modal-back {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-back:hover {
  background: var(--bg-grey);
}

.auth-logo {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-3);
}

.auth-box h2 {
  font-size: 19px;
  margin-bottom: 4px;
}

.auth-box .muted {
  font-size: 13.5px;
  margin-bottom: var(--sp-4);
}

.phone-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: var(--sp-3);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.phone-row:focus-within {
  border-color: var(--green);
  box-shadow: var(--ring);
}

.prefix {
  display: flex;
  align-items: center;
  padding: 0 var(--sp-3);
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}

.phone-row input {
  border: none;
  border-radius: 0;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.phone-row input:focus {
  box-shadow: none;
}

.otp-input {
  text-align: center;
  font-size: 24px;
  letter-spacing: 0.5em;
  font-weight: 700;
  margin-bottom: var(--sp-3);
  padding: 12px;
}

.demo-otp {
  background: #fff8e1;
  border: 1px dashed #e6c34c;
  color: #8a6d00;
  border-radius: 10px;
  font-size: 13px;
  padding: 9px 12px;
  margin-bottom: var(--sp-3);
}

.auth-box .linklike {
  margin-top: var(--sp-3);
  text-align: center;
  width: 100%;
}

.auth-box .fine {
  margin-top: var(--sp-4);
  margin-bottom: 0;
}


/* ==========================================================================
   11. Toast
   ========================================================================== */

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  z-index: 95;
  max-width: calc(100vw - 32px);
  text-align: center;
}

#toast:empty {
  display: none;
}


/* ==========================================================================
   12. Rating components
   ========================================================================== */

.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--rate-good);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 6px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.rating-pill.mid {
  background: var(--rate-mid);
}

.rating-pill.low {
  background: var(--rate-low);
}

.stars {
  display: inline-flex;
  gap: 1px;
  font-size: 18px;
  line-height: 1;
}

.star {
  color: var(--border-strong);
}

.star.on {
  color: var(--rate-mid);
}

.rating-count {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}

/* CSS-only star rating input (radios hidden; DOM order 5→1 + row-reverse
   makes hover/checked highlight all leading stars). */
.star-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: var(--sp-3);
}

.star-input input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.star-input label {
  font-size: 2rem;
  line-height: 1;
  color: var(--border-strong);
  cursor: pointer;
  transition: color 0.1s ease, transform 0.1s ease;
  user-select: none;
}

.star-input label:hover {
  transform: scale(1.12);
}

.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label {
  color: var(--rate-mid);
}

.star-input input:focus-visible + label {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}


/* ==========================================================================
   13. Product card + ADD / stepper
   ========================================================================== */

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-width: 0;
}

.pcard:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* Discount chip — warm amber→orange deal badge. A warm accent against the
   indigo-heavy page injects energy and makes the savings pop (a cool/indigo
   badge blends into the theme and reads flat). */
/* Discount ribbon — classic ribbon hanging from the card top with a
   V-notched tail; warm orange gradient so deals pop against the indigo brand. */
.off-badge {
  position: absolute;
  top: 0;
  left: 12px;
  z-index: 2;
  background: linear-gradient(170deg, #fb923c, #ea580c 65%, #c2410c);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 5px 6px 10px;
  text-align: center;
  line-height: 1.15;
  max-width: 42px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 6px), 0 100%);
  filter: drop-shadow(0 2px 3px rgba(234, 88, 12, 0.35));
}

.off-badge.big {
  font-size: 12px;
  max-width: 56px;
  padding: 7px 8px 12px;
  left: 16px;
}

.pcard-img {
  display: block;
  padding: var(--sp-2);
}

.pcard-img img {
  width: 100%;
  aspect-ratio: 1;
  transition: transform 0.2s ease;
}

.pcard:hover .pcard-img img {
  transform: scale(1.04);
}

.pcard-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.pcard-eta {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 3px;
  background: var(--bg-grey);
  color: #4b5563;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 5px;
  padding: 2px 5px;
}

.pcard-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.pcard-name:hover {
  color: var(--green-dark);
}

.pcard-rating {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pcard-rating .rating-pill {
  font-size: 11px;
  padding: 3px 6px;
}

.pcard-rating .muted {
  font-size: 11px;
}

.pcard-unit {
  font-size: 12px;
  color: var(--muted);
}

.more-opts {
  color: var(--green);
  font-weight: 700;
}

.pcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-2);
}

.pcard-price {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.price {
  font-size: 14px;
  font-weight: 700;
}

.oos {
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.oos.big {
  font-size: 15px;
  display: block;
  text-align: center;
  padding: 12px;
  background: var(--danger-tint);
  border-radius: 10px;
}

/* ADD button (qty == 0) */
.add-btn {
  background: var(--surface);
  border: 1.5px solid var(--green);
  color: var(--green);
  font-weight: 700;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.add-btn:hover {
  background: var(--green-tint-soft);
}

.add-btn:active {
  transform: scale(0.96);
}

.add-btn.stepper {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  padding: 7px 18px;
}

/* Quantity stepper (qty > 0) */
.stepper {
  display: inline-flex;
  align-items: center;
  background: var(--green);
  color: #fff;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.stepper button {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  width: 30px;
  height: 33px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease;
}

.stepper button:hover {
  background: var(--green-dark);
}

.stepper span {
  min-width: 22px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
}

/* NOTE: the qty==0 ADD button is rendered with classes "add-btn stepper"
   (for every size), so it matches .stepper above — restore the crisp
   white/green-outline look explicitly. */
.add-btn.stepper {
  background: var(--surface);
  color: var(--green);
  border: 1.5px solid var(--green);
  overflow: visible;
  box-shadow: none;
}

.add-btn.stepper:hover {
  background: var(--green-tint-soft);
}

/* Size variants */
.stepper.s-line button {
  width: 26px;
  height: 28px;
  font-size: 14px;
}

.stepper.s-line span {
  font-size: 12.5px;
  min-width: 18px;
}

/* Compact ADD inside drawer cart lines */
.dline .add-btn.stepper {
  padding: 5px 14px;
  font-size: 12px;
}

/* Big "Add to cart" under the PDP gallery (same "add-btn stepper" markup,
   scoped by its container) — solid green, full width */
.pdp-gallery-cta .add-btn.stepper {
  width: 100%;
  font-size: 16px;
  padding: 14px 24px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: var(--shadow-sm);
}

.pdp-gallery-cta .add-btn.stepper:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.stepper.s-big {
  width: 100%;
  justify-content: space-between;
  border-radius: 12px;
}

.stepper.s-big button {
  width: 52px;
  height: 50px;
  font-size: 20px;
}

.stepper.s-big span {
  font-size: 17px;
}


/* ==========================================================================
   14. Rails, category tiles, hero & promo banners
   ========================================================================== */

.rail {
  margin: var(--sp-6) 0;
}

.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.rail-head h2 {
  font-size: 21px;
  margin: 0;
}

.rail-scroll {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: var(--sp-1) 2px var(--sp-3);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rail-scroll::-webkit-scrollbar {
  display: none;
}

/* Prev/next arrows overlaying the rail (Blinkit-style) */
.rail-body {
  position: relative;
}

.rail-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface, #fff);
  box-shadow: var(--shadow-sm);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  padding: 0 0 3px;
}

.rail-arrow:hover {
  box-shadow: var(--shadow-md, var(--shadow-sm));
}

.rail-arrow.prev {
  left: -12px;
}

.rail-arrow.next {
  right: -12px;
}

.rail-arrow.hidden {
  display: none;
}

/* Touch devices scroll by swiping — the arrows just get in the way. */
@media (hover: none) and (pointer: coarse) {
  .rail-arrow {
    display: none;
  }
}

.rail-scroll .pcard {
  flex: 0 0 190px;
  width: 190px;
  scroll-snap-align: start;
}

/* Category tiles grid (home) */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-6) 0;
}

.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  text-align: center;
  padding: var(--sp-3) var(--sp-2);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cat-tile:hover {
  transform: translateY(-2px);
  background: var(--green-tint-soft);
  box-shadow: var(--shadow-sm);
}

.cat-tile img {
  width: 64px;
  height: 64px;
}

.cat-tile span {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
}

/* Hero banner */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-7);
  margin: var(--sp-5) 0;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-md);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: 0.6;
}

.hero-copy h1 {
  font-size: clamp(24px, 4vw, 38px);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.hero-copy p {
  font-size: clamp(14px, 2vw, 17px);
  opacity: 0.94;
  margin-bottom: var(--sp-4);
  max-width: 46ch;
}

.hero-cta,
.promo-cta {
  display: inline-block;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero:hover .hero-cta,
.promo:hover .promo-cta {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.hero-art {
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.2));
  flex-shrink: 0;
}

/* Promo cards */
.promo-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-5) 0;
}

.promo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.promo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.promo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

.promo h3 {
  font-size: 19px;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.promo p {
  font-size: 13.5px;
  opacity: 0.94;
  margin-bottom: var(--sp-3);
}

.promo-cta {
  font-size: 13px;
  padding: 8px 18px;
}

/* Banner themes */
.theme-green {
  background: linear-gradient(135deg, #6366f1, #312e81);
}

.theme-teal {
  background: linear-gradient(135deg, #0ea5a4, #065666);
}

.theme-yellow {
  background: linear-gradient(135deg, #f6c21c, #d97706);
}

.theme-blue {
  background: linear-gradient(135deg, #536cf0, #29359e);
}


/* ==========================================================================
   15. Category browse + search results
   ========================================================================== */

.browse {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: var(--sp-4);
  align-items: start;
  margin: var(--sp-4) 0;
}

.subnav {
  position: sticky;
  top: calc(var(--header-h) + 14px);
  max-height: calc(100vh - var(--header-h) - 28px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}

.subnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 8px 3px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.25;
  color: #4b5563;
  transition: background 0.12s ease, border-color 0.12s ease;
}

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

.subnav-item img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--bg-subtle);
  padding: 3px;
  flex-shrink: 0;
}

.subnav-item:hover {
  background: var(--bg-subtle);
}

.subnav-item.active {
  border-left-color: var(--green);
  background: var(--green-tint-soft);
  font-weight: 700;
  color: var(--green-dark);
}

.browse-main {
  min-width: 0;
}

.browse-title {
  font-size: 22px;
  margin: 2px 0 var(--sp-4);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.browse-title .muted {
  font-size: 14px;
  font-weight: 500;
}

/* Visually hidden but available to screen readers (page still has an <h1>) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Product grid (browse + search) — six per row, Blinkit-style */
.pgrid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--sp-3);
}

/* All-categories page */
.catlist-block {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.catlist-block h2 {
  font-size: 19px;
  margin-bottom: var(--sp-2);
}

.catlist-block h2 a:hover {
  color: var(--green-dark);
}


/* ==========================================================================
   16. Product detail page (PDP)
   ========================================================================== */

.pdp-crumbs {
  margin: var(--sp-4) 0 var(--sp-4);
}

.pdp-grid {
  display: grid;
  grid-template-columns: minmax(320px, 480px) 1fr;
  gap: var(--sp-7);
  align-items: start;
  margin-bottom: var(--sp-6);
}

/* --- Gallery (sticky) --- */
.pdp-gallery {
  position: sticky;
  top: calc(var(--header-h) + 14px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.pdp-img {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #fbfcfd, #eef1f4);
  padding: var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pdp-img img {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
}

.pdp-thumbs {
  display: flex;
  gap: var(--sp-2);
}

.thumb {
  width: 64px;
  height: 64px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.thumb:hover {
  border-color: var(--border-strong);
}

.thumb.active {
  border-color: var(--green);
  box-shadow: var(--ring);
}

.pdp-gallery-cta {
  margin-top: var(--sp-1);
}

/* --- Info column --- */
.pdp-info {
  min-width: 0;
}

.pdp-brand {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 4px;
}

.pdp-brand:hover {
  text-decoration: underline;
}

.pdp-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
}

.pdp-meta-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.pdp-eta {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

/* Price box */
.pdp-pricebox {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}

.price-big {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.pdp-pricebox .mrp {
  font-size: 17px;
}

.pct-off {
  color: var(--rate-good);
  font-size: 15px;
  font-weight: 700;
}

.tax-note {
  flex-basis: 100%;
  font-size: 12.5px;
  color: var(--muted);
}

.section-label {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 var(--sp-2);
}

/* Unit selector */
.unit-row {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.unit-opt {
  position: relative;
  min-width: 92px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  text-align: center;
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.unit-opt:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.unit-opt.active {
  border-color: var(--green);
  background: var(--green-tint-soft);
}

.unit-opt.active::after {
  content: "✓";
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.unit-opt .u {
  font-size: 13px;
  font-weight: 600;
}

.unit-opt .p {
  font-size: 13.5px;
  font-weight: 800;
  margin-top: 1px;
}

.unit-opt .d {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: 0.02em;
}

/* Attribute picker option that maps to an out-of-stock variant */
.unit-opt.oos-opt {
  opacity: 0.55;
}

.unit-opt.oos-opt .d {
  color: var(--danger, #d33);
}

/* Small section heading inside admin boxes (e.g. "Variant attributes") */
.mini-head {
  margin: 14px 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #666);
}

/* Offers box */
.offers-box {
  background: var(--green-tint-soft);
  border: 1px solid rgba(12, 131, 31, 0.18);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.offers-box .section-label {
  margin-bottom: 2px;
}

.offer-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  line-height: 1.45;
}

.offer-ico {
  font-size: 15px;
  line-height: 1.3;
  flex-shrink: 0;
}

/* Trust chips */
.trust-row {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.trust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

/* Seller box */
.seller-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  font-size: 13.5px;
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

/* PDP content blocks */
.pdp-block {
  margin-bottom: var(--sp-5);
}

.pdp-block h2 {
  font-size: 19px;
  margin-bottom: var(--sp-3);
}

/* Spec table (zebra) */
.spec-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

.spec-table tr:nth-child(even) {
  background: var(--bg-subtle);
}

.spec-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  width: 140px;
  padding: 9px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.spec-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: none;
}

.pdp-desc {
  font-size: 14.5px;
  line-height: 1.65;
  color: #333;
  max-width: 72ch;
}

.pdp-desc > :first-child {
  margin-top: 0;
}

.pdp-desc p {
  margin: 0 0 var(--sp-3);
}

/* Sub-headings inside the description ("Key Features", "How to Use", …) */
.desc-head {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  margin: var(--sp-5) 0 var(--sp-2);
}

.desc-list {
  margin: 0 0 var(--sp-3);
  padding-left: 1.25em;
  list-style: disc;
}

.desc-list li {
  margin-bottom: var(--sp-1);
  padding-left: 2px;
}


/* ==========================================================================
   17. Ratings & reviews
   ========================================================================== */

.reviews-block {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-5);
}

.reviews-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--sp-5);
  align-items: start;
}

/* Summary card */
.rating-summary {
  position: sticky;
  top: calc(var(--header-h) + 14px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.rating-big {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.of5 {
  font-size: 17px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.rating-summary .muted {
  font-size: 13px;
}

.histo {
  margin-top: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.histo-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12.5px;
}

.hlabel {
  width: 32px;
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.hbar {
  flex: 1;
  height: 8px;
  background: var(--bg-grey);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.hfill {
  height: 100%;
  background: var(--rate-good);
  border-radius: var(--radius-pill);
  min-width: 0;
  transition: width 0.4s ease;
}

.hcount {
  width: 32px;
  flex-shrink: 0;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Review list */
.reviews-list {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-height: 640px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.review {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  box-shadow: var(--shadow-xs);
}

.rev-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: 6px;
}

.rev-head strong {
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.rev-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: #333;
  margin-bottom: var(--sp-2);
}

.rev-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.verified {
  color: var(--rate-good);
  font-weight: 700;
}

/* Review form */
.review-form {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}

.review-form h3 {
  font-size: 15px;
  margin-bottom: var(--sp-3);
}

.review-form input[type="text"],
.review-form textarea {
  margin-bottom: var(--sp-3);
  background: var(--surface);
}


/* ==========================================================================
   18. Why-shop strip
   ========================================================================== */

.why-shop {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin: var(--sp-6) 0;
}

.why-shop h3 {
  font-size: 19px;
  margin-bottom: var(--sp-4);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--sp-4);
}

.why-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}

.why-ico {
  font-size: 26px;
  line-height: 1.2;
  flex-shrink: 0;
}

.why-row strong {
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
}

.why-row p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}


/* ==========================================================================
   19. Cart page / checkout / gateway / order tracking
   ========================================================================== */

.cart-page {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}

.cart-page > div {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* Checkout */
.checkout {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.co-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}

.co-box h2 {
  font-size: 17px;
  margin-bottom: var(--sp-3);
}

.addr-list,
.pay-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.addr-opt,
.pay-opt {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  font-weight: 400;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.addr-opt:hover,
.pay-opt:hover {
  border-color: var(--border-strong);
}

.addr-opt:has(input:checked),
.pay-opt:has(input:checked) {
  border-color: var(--green);
  background: var(--green-tint-soft);
}

.addr-opt input,
.pay-opt input {
  margin-top: 3px;
  flex-shrink: 0;
}

.addr-opt strong,
.pay-opt strong {
  font-size: 14px;
}

.addr-opt p,
.pay-opt p {
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 0;
}

.addr-opt.static {
  cursor: default;
  justify-content: space-between;
  align-items: center;
}

.addr-new {
  margin-top: var(--sp-3);
}

.addr-new summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 600;
  font-size: 14px;
  list-style: none;
}

.addr-new summary::-webkit-details-marker {
  display: none;
}

.addr-form {
  margin-top: var(--sp-3);
  padding: var(--sp-4);
  background: var(--bg-subtle);
  border-radius: 10px;
}

.co-lines {
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
}

.co-line {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: 13.5px;
  padding: 5px 0;
}

.co-line > span:last-child {
  font-weight: 600;
  white-space: nowrap;
}

.checkout .bill,
.co-box .bill {
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

/* Mock payment gateway */
body.bare {
  background: var(--bg-subtle);
  min-height: 100vh;
}

.gateway {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5) var(--sp-4);
}

.gw-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-6);
}

.gw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.gw-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--green);
}

.gw-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--warn);
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

.gw-amount {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: var(--sp-2) 0 var(--sp-4);
}

.gw-method {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  text-align: center;
}

.gw-qr {
  font-size: 96px;
  line-height: 1;
  margin: var(--sp-2) auto;
  color: var(--ink);
}

.gw-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

/* Order hero + tracking */
.order-hero {
  text-align: center;
  padding: var(--sp-6) var(--sp-4) var(--sp-4);
}

.order-hero .big {
  font-size: 52px;
  line-height: 1;
  display: block;
  margin-bottom: var(--sp-2);
}

.order-hero h1 {
  font-size: 24px;
}

.order-hero.cancel h1 {
  color: var(--danger);
}

.track {
  margin-bottom: var(--sp-5);
}

.track-steps {
  display: flex;
  align-items: flex-start;
  padding: var(--sp-4) var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tstep {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  width: 84px;
}

.tstep .dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-grey);
  border: 2px solid var(--border-strong);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tstep.done .dot {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.tlabel {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

.tstep.done .tlabel {
  color: var(--ink);
}

.tline {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--bg-grey);
  margin-top: 12px;
  min-width: 12px;
  transition: background 0.2s ease;
}

.tline.done {
  background: var(--green);
}


/* ==========================================================================
   20. Account & order history + status chips
   ========================================================================== */

.profile-form label {
  min-width: 180px;
}

.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.order-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.order-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* Status chips — tinted background + solid text.
   Order:  placed / packing / on_the_way / delivered / cancelled
   Seller: pending / approved / rejected / suspended */
.status-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  white-space: nowrap;
  text-transform: capitalize;
}

.status-chip.st-placed {
  color: var(--info);
  background: rgba(37, 99, 235, 0.1);
}

.status-chip.st-packing,
.status-chip.st-pending {
  color: var(--warn);
  background: rgba(217, 119, 6, 0.1);
}

.status-chip.st-on_the_way {
  color: var(--violet);
  background: rgba(124, 58, 237, 0.1);
}

.status-chip.st-delivered,
.status-chip.st-approved {
  color: var(--rate-good);
  background: rgba(22, 163, 74, 0.1);
}

.status-chip.st-cancelled,
.status-chip.st-rejected,
.status-chip.st-suspended {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.1);
}

/* Payment status text (admin tables) */
.pay-paid {
  color: var(--rate-good);
  font-weight: 700;
}

.pay-pending {
  color: var(--warn);
  font-weight: 700;
}

.pay-failed,
.pay-refunded {
  color: var(--danger);
  font-weight: 700;
}


/* ==========================================================================
   21. Seller hub
   ========================================================================== */

.seller-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--sp-5);
  align-items: start;
  margin: var(--sp-5) 0;
}

.seller-main {
  min-width: 0;
}

.seller-main .page-title {
  margin-top: 0;
}

.side-title {
  color: #fff;
  font-size: 15px;
  padding: var(--sp-4) var(--sp-4) var(--sp-2);
  margin: 0;
}


/* ==========================================================================
   22. Admin panel
   ========================================================================== */

.admin-body {
  background: var(--bg-subtle);
  min-height: 100vh;
  display: flex;
}

/* Dark sidebar (shared by admin shell + in-page seller hub) */
.admin-side {
  width: 230px;
  flex-shrink: 0;
  background: #151a21;
  color: #cbd2da;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  padding: var(--sp-4) 0;
}

.admin-side .logo {
  padding: 0 var(--sp-4) var(--sp-4);
  font-size: 22px;
}

.admin-side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--sp-2);
  flex: 1;
}

.admin-side nav a {
  display: block;
  padding: 10px var(--sp-3);
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  font-weight: 500;
  color: #cbd2da;
  transition: background 0.12s ease, color 0.12s ease;
}

.admin-side nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.admin-side nav a.active {
  border-left-color: var(--green);
  background: rgba(12, 131, 31, 0.15);
  color: #fff;
  font-weight: 600;
}

.back-store {
  padding: var(--sp-3) var(--sp-4);
  font-size: 13px;
  color: #8b949e;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: var(--sp-3);
}

.back-store:hover {
  color: #fff;
}

/* In-page variant (seller hub) — bounded card, not full height */
.admin-side.inpage {
  min-height: 0;
  border-radius: var(--radius);
  position: sticky;
  top: calc(var(--header-h) + 14px);
  box-shadow: var(--shadow-sm);
  padding-bottom: var(--sp-3);
}

.admin-side.inpage nav {
  flex: none;
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: var(--sp-5) var(--sp-6) var(--sp-7);
}

.admin-title {
  font-size: 24px;
  margin-bottom: var(--sp-4);
}

.admin-main h2 {
  font-size: 18px;
  margin: var(--sp-5) 0 var(--sp-3);
}

.admin-search {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.admin-search input {
  width: 260px;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: var(--sp-4);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--green);
}

.stat.warn::before {
  background: var(--warn);
}

.stat.warn {
  border-color: rgba(217, 119, 6, 0.35);
}

.stat .n {
  display: block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat.warn .n {
  color: var(--warn);
}

.stat .l {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}

/* Admin tables */
.atable {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  font-size: 13.5px;
  border-collapse: separate;
  border-spacing: 0;
  margin: var(--sp-3) 0 var(--sp-4);
}

.atable thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-subtle);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.atable td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.atable tbody tr:last-child td {
  border-bottom: none;
}

.atable tbody tr {
  transition: background 0.1s ease;
}

.atable tbody tr:hover {
  background: var(--green-tint-soft);
}

.atable td a {
  color: var(--green-dark);
  font-weight: 600;
}

.atable td a:hover {
  text-decoration: underline;
}

.atable input[type="text"],
.atable input[type="number"] {
  min-width: 70px;
  padding: 6px 8px;
  font-size: 13px;
}

/* Active/hidden toggle */
.toggle {
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  border: 1px solid transparent;
  transition: opacity 0.15s ease;
}

.toggle:hover {
  opacity: 0.8;
}

.toggle.on {
  background: rgba(22, 163, 74, 0.1);
  color: var(--rate-good);
  border-color: rgba(22, 163, 74, 0.3);
}

.toggle.off {
  background: var(--bg-grey);
  color: var(--muted);
  border-color: var(--border-strong);
}

/* Inline status <select> in orders table */
.status-sel {
  width: auto;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 5px 28px 5px 12px;
  border: 1.5px solid var(--border-strong);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.status-sel.st-placed {
  color: var(--info);
  border-color: rgba(37, 99, 235, 0.4);
  background-color: rgba(37, 99, 235, 0.08);
}

.status-sel.st-packing {
  color: var(--warn);
  border-color: rgba(217, 119, 6, 0.4);
  background-color: rgba(217, 119, 6, 0.08);
}

.status-sel.st-on_the_way {
  color: var(--violet);
  border-color: rgba(124, 58, 237, 0.4);
  background-color: rgba(124, 58, 237, 0.08);
}

.status-sel.st-delivered {
  color: var(--rate-good);
  border-color: rgba(22, 163, 74, 0.4);
  background-color: rgba(22, 163, 74, 0.08);
}

.status-sel.st-cancelled {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.4);
  background-color: rgba(220, 38, 38, 0.08);
}

/* Pending-work alert strip */
.alert-strip {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
}

.alert-strip a {
  font-size: 13.5px;
  font-weight: 700;
  color: #92600a;
}

.alert-strip a:hover {
  text-decoration: underline;
}

/* 7-day revenue bar chart */
.barchart {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  height: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: var(--sp-4) var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
}

.bar {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.bar .fill {
  width: min(46px, 100%);
  background: linear-gradient(to top, var(--green-deep), var(--green));
  border-radius: 6px 6px 0 0;
  transition: filter 0.15s ease;
}

.bar:hover .fill {
  filter: brightness(1.15);
}

.bar .bv {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translate(-50%, -100%);
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 4;
}

.bar:hover .bv {
  opacity: 1;
}

.bar .bl {
  position: absolute;
  bottom: -22px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* Product approval actions */
.approve-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.approve-actions form {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.approve-actions input[type="text"] {
  width: 200px;
  font-size: 13px;
  padding: 8px 10px;
}


/* ==========================================================================
   23. Empty states, breadcrumbs, misc
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}

.empty-state .big {
  font-size: 56px;
  line-height: 1;
}

.empty-state h3 {
  color: var(--ink);
  font-size: 19px;
  margin: 0;
}

.empty-state p {
  max-width: 42ch;
  margin: 0 0 var(--sp-2);
}

.crumbs {
  font-size: 15px;
  color: var(--muted);
  margin: var(--sp-4) 0 var(--sp-2);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.crumbs a:hover {
  color: var(--green);
}

.crumbs .cur {
  color: var(--ink);
  font-weight: 600;
}


/* ==========================================================================
   24. Motion & reduced-motion
   ========================================================================== */

/* Entrance animation lives on drawer/modal transitions declared above
   (transform + opacity, 0.25s). Everything else uses micro-transitions. */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* ==========================================================================
   25. MOBILE — responsive overrides
   ========================================================================== */

/* --- Tablet: tighten desktop chrome --- */
@media (max-width: 1024px) {
  .header-inner {
    gap: var(--sp-4);
  }

  .location {
    max-width: 170px;
    padding-left: var(--sp-4);
  }

  .pdp-grid {
    gap: var(--sp-5);
  }

  /* Six-across gets cramped on smaller laptops — drop to four */
  .pgrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-main {
    padding: var(--sp-4);
  }
}

/* --- Phone / small tablet --- */
@media (max-width: 768px) {
  :root {
    --header-h: 108px; /* two-row header */
  }

  body {
    /* Clear the fixed bottom nav */
    padding-bottom: 70px;
  }

  body.bare,
  body.admin-body {
    padding-bottom: 0;
  }

  /* ------------------------------------------------------------------
     CRITICAL HEADER FIX — 2-row grid:
       row 1:  logo …………………………… [login] [cart]  (cart never overflows)
       row 2:  search bar, full width
     ------------------------------------------------------------------ */
  .header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "logo   loc    actions"
      "search search search";
    align-items: center;
    gap: 6px var(--sp-3);
    padding: 10px var(--sp-3) 12px;
    min-height: 0;
  }

  .logo {
    grid-area: logo;
    font-size: 22px;
  }

  .location {
    grid-area: loc;
    border-left: none;
    padding-left: 0;
    max-width: none;
    min-width: 0;
    text-align: center;
    justify-self: center;
  }

  /* Hide the address line; keep only the compact ETA */
  .loc-addr {
    display: none;
  }

  .loc-eta {
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-grey);
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .header-actions {
    grid-area: actions;
    gap: var(--sp-3);
    justify-self: end;
    min-width: 0;
  }

  .searchwrap {
    grid-area: search;
    width: 100%;
  }

  .searchbar {
    height: 42px;
  }

  /* Compact cart button — always fully visible */
  .cart-btn {
    min-height: 42px;
    padding: 6px 12px;
    font-size: 12.5px;
    gap: 6px;
  }

  .cart-ico {
    font-size: 17px;
  }

  .cart-amt {
    font-size: 11px;
  }

  .login-link,
  .account-menu summary {
    font-size: 13.5px;
    padding: 6px 2px;
  }

  /* Show mobile bottom nav */
  .bottom-nav {
    display: flex;
  }

  /* --- Home --- */
  .hero {
    padding: var(--sp-5);
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-art {
    align-self: flex-end;
  }

  .promo-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: var(--sp-2);
    margin: var(--sp-5) 0;
  }

  .cat-tile img {
    width: 52px;
    height: 52px;
  }

  .cat-tile span {
    font-size: 11.5px;
  }

  .rail-scroll .pcard {
    flex-basis: 165px;
    width: 165px;
  }

  /* --- Browse: subnav becomes a horizontal icon strip --- */
  .browse {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }

  .subnav {
    position: static;
    max-height: none;
    display: flex;
    overflow-x: auto;
    border-radius: var(--radius);
    scrollbar-width: none;
  }

  .subnav::-webkit-scrollbar {
    display: none;
  }

  .subnav-item {
    flex-direction: column;
    flex: 0 0 auto;
    width: 84px;
    gap: 5px;
    padding: var(--sp-2);
    border-left: none;
    border-bottom: 3px solid transparent;
    text-align: center;
    font-size: 11.5px;
    border-right: 1px solid var(--border);
  }

  .subnav-item span {
    white-space: normal;
    line-height: 1.2;
  }

  .subnav-item.active {
    border-left: none;
    border-bottom-color: var(--green);
  }

  .pgrid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--sp-2);
  }

  /* --- PDP: single column, non-sticky gallery --- */
  .pdp-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  .pdp-gallery {
    position: static;
  }

  .pdp-title {
    font-size: 22px;
  }

  .price-big {
    font-size: 26px;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .rating-summary {
    position: static;
  }

  .reviews-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .spec-table th {
    width: 110px;
  }

  /* --- Drawer full width --- */
  #cart-drawer {
    width: 100vw;
  }

  /* --- Checkout / co-box --- */
  .co-box {
    padding: var(--sp-4);
  }

  .approve-actions {
    align-items: stretch;
    width: 100%;
  }

  .approve-actions input[type="text"] {
    flex: 1;
    width: auto;
  }

  .frow.between {
    flex-direction: column;
  }

  .frow.between > * {
    width: 100%;
  }

  .admin-search input {
    width: 100%;
  }

  /* --- Track steps: allow horizontal scroll --- */
  .track-steps {
    overflow-x: auto;
  }

  .tstep {
    width: 72px;
  }

  /* --- Footer --- */
  .footer-inner {
    flex-direction: column;
    gap: var(--sp-5);
    padding: var(--sp-5) var(--sp-4);
  }

  .footer-col {
    flex: 1 1 auto;
    width: 100%;
  }

  .footer-links {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .footer-base {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Footer must clear the fixed bottom nav */
  .site-footer {
    padding-bottom: var(--sp-5);
  }

  /* --- Seller hub: stack --- */
  .seller-wrap {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  .admin-side.inpage {
    position: static;
    width: 100%;
  }

  .admin-side.inpage nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--sp-1);
  }

  .admin-side.inpage nav a {
    border-left: none;
    border-radius: var(--radius-sm);
  }

  .admin-side.inpage nav a.active {
    border-left: none;
  }

  /* --- Admin shell: sidebar becomes top bar --- */
  .admin-body {
    flex-direction: column;
  }

  .admin-side {
    width: 100%;
    min-height: 0;
    position: static;
    padding: var(--sp-3) 0;
  }

  .admin-side nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--sp-1);
    padding: 0 var(--sp-3);
  }

  .admin-side nav a {
    border-left: none;
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 13px;
  }

  .admin-side nav a.active {
    border-left: none;
  }

  .admin-main {
    padding: var(--sp-4) var(--sp-3) var(--sp-6);
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  /* Tables scroll horizontally inside the page instead of breaking layout */
  .atable {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .barchart {
    gap: var(--sp-2);
    height: 150px;
  }

  .bar .bl {
    font-size: 9.5px;
  }
}

/* --- Very small phones (≤ 400px) --- */
@media (max-width: 400px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
  }

  /* Not enough room — drop the ETA pill entirely */
  .location {
    display: none;
  }

  .cart-btn .cart-amt {
    display: none;
  }

  .logo {
    font-size: 20px;
  }

  .pgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rail-scroll .pcard {
    flex-basis: 150px;
    width: 150px;
  }

  .unit-opt {
    min-width: 80px;
    padding: 8px 10px;
  }
}

/* ---- Hotfix: mobile horizontal overflow (promo cards / hero) ---- */
html, body { overflow-x: hidden; }
@media (max-width: 768px) {
  .promo-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .promo { width: 100%; }
  .hero { max-width: 100%; }
  .hero-art { display: none; }
}

/* ---- Hotfix 2: mobile header — bottom nav owns Login/Account, header keeps only the cart ---- */
@media (max-width: 768px) {
  .login-link, .account-menu { display: none; }
  .header-actions { flex-shrink: 0; }
  .cart-btn { max-width: 130px; }
  .cart-btn .cart-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---- Hotfix 3: icon-only cart button on mobile (count lives on the bottom-nav badge) ---- */
@media (max-width: 768px) {
  .cart-btn { width: 42px; min-width: 42px; max-width: 42px; height: 42px; padding: 0; justify-content: center; }
  .cart-btn .cart-txt { display: none; }
  .loc-eta { max-width: 160px; }
}

/* ================= Commerce additions: coupons, notifications, wishlist,
   rider box, invoice, moderation notes, generate button ================= */
.coupon-box { margin-top: 4px; }
.coupon-entry { display: flex; gap: 10px; }
.coupon-entry input { flex: 1; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #edf9ef; border: 1px dashed #0c831f; border-radius: 10px; padding: 12px 14px; }
.bill-row.discount span:last-child { color: #0c831f; font-weight: 700; }

.bell-btn { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; font-size: 18px; text-decoration: none; }
.bell-btn:hover { background: #f1f3f5; }
.bell-btn .nav-badge { position: absolute; top: 2px; right: 2px; }

.notif-row { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; text-decoration: none; color: inherit; }
.notif-row:hover { border-color: #0c831f; }
.notif-row.unread { border-left: 4px solid #0c831f; background: #f7fdf8; }
.notif-row p { margin: 4px 0 0; }

.wish-btn { margin-left: auto; border: 1.5px solid #e5e7eb; background: #fff; border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; color: #6b7280; cursor: pointer; transition: all .15s; }
.wish-btn:hover { border-color: #d3455b; color: #d3455b; }
.wish-btn.on { border-color: #d3455b; background: #fdf2f4; color: #d3455b; }

.rider-box { display: flex; gap: 12px; align-items: center; background: #f0f7ff;
  border: 1px solid #bfd9f9; border-radius: 12px; padding: 14px 16px; margin: 14px 0; }
.rider-box .rider-ico { font-size: 26px; }

.order-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.order-actions form { display: inline; }

.mod-note { background: #f0f7ff; border-left: 4px solid #2563eb; padding: 8px 12px;
  border-radius: 8px; font-size: 13px; margin: 8px 0; }
.mod-note.flagged { background: #fdf1f1; border-left-color: #dc2626; color: #991b1b; font-weight: 600; }
.approval-desc { max-width: 70ch; white-space: pre-line; font-size: 13.5px; color: #444;
  max-height: 130px; overflow-y: auto; }

.danger-text { color: #dc2626; }
.inline-form { display: inline-block; margin-right: 6px; }

/* Invoice (print-friendly) */
.invoice { max-width: 760px; margin: 24px auto; background: #fff; border: 1px solid #e5e7eb;
  border-radius: 14px; padding: 32px; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid #0c831f; padding-bottom: 16px; margin-bottom: 18px; }
.inv-meta { text-align: right; }
.inv-meta h1 { font-size: 24px; margin: 0; }
.inv-parties { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.inv-parties h3 { font-size: 12px; text-transform: uppercase; color: #6b7280; margin-bottom: 4px; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.inv-table th { text-align: left; font-size: 12px; text-transform: uppercase; color: #6b7280;
  border-bottom: 1px solid #e5e7eb; padding: 8px 6px; }
.inv-table td { padding: 8px 6px; border-bottom: 1px solid #f1f3f5; font-size: 14px; }
.inv-totals { margin-left: auto; max-width: 320px; }
@media print {
  body.bare { background: #fff; }
  .invoice { border: none; margin: 0; }
  .invoice .btn-green { display: none; }
}

/* ==========================================================================
   Admin: dynamic per-product spec editor (progressive enhancement)
   ========================================================================== */
.spec-editor {
  margin-top: 6px;
}

.spec-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.spec-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spec-row.dragging {
  opacity: 0.5;
}

.spec-drag {
  cursor: grab;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  user-select: none;
  padding: 0 2px;
}

.spec-label,
.spec-value {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  background: var(--surface, #fff);
}

.spec-label {
  flex: 0 0 34%;
  font-weight: 600;
}

.spec-value {
  flex: 1 1 auto;
}

.spec-label:focus,
.spec-value:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-tint);
}

.spec-del {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.spec-del:hover {
  border-color: var(--rate-low);
  color: var(--rate-low);
}

.spec-add {
  cursor: pointer;
}

/* ================= Dashboard redesign: hero KPIs, deltas, chart card ================= */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; margin-bottom: 18px; }
.kpi { position: relative; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
  padding: 18px 20px 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: transform .15s ease, box-shadow .15s ease; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; }
.kpi.accent-green::before { background: linear-gradient(180deg,#16a34a,#0c831f); }
.kpi.accent-blue::before { background: linear-gradient(180deg,#3b82f6,#2563eb); }
.kpi.accent-violet::before { background: linear-gradient(180deg,#8b5cf6,#7c3aed); }
.kpi.accent-amber::before { background: linear-gradient(180deg,#f59e0b,#d97706); }
.kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.kpi-ico { font-size: 20px; width: 36px; height: 36px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 10px; background: #f6f7f9; }
.kpi.accent-green .kpi-ico { background: #e9f7ec; }
.kpi.accent-blue .kpi-ico { background: #eaf1fe; }
.kpi.accent-violet .kpi-ico { background: #f1ecfe; }
.kpi.accent-amber .kpi-ico { background: #fdf3e2; }
.kpi-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #6b7280; }
.kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; color: #111827;
  font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-sub { margin-top: 6px; font-size: 12.5px; min-height: 18px; }
.kpi-sub a { color: #0c831f; font-weight: 600; text-decoration: none; }
.delta { font-weight: 700; font-size: 12.5px; padding: 2px 8px; border-radius: 999px; }
.delta.up { color: #15803d; background: #e9f7ec; }
.delta.down { color: #b91c1c; background: #fdecec; }
.delta-note { font-weight: 500; color: #6b7280; }

.chart-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
  padding: 18px 20px; margin: 18px 0; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chart-head h2 { margin: 0; }

/* Secondary stat cards: crisper numbers */
.stat .n { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat .l a { color: inherit; text-decoration: underline; }

/* Orders table: address column stays readable */
.addr-cell { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #4b5563; font-size: 13px; }
@media (max-width: 900px) { .addr-cell { max-width: 140px; } }

/* Long money values wrap instead of truncating in stat cards */
.stat .n { white-space: normal; overflow-wrap: anywhere; font-size: clamp(17px, 1.4vw, 22px); }

/* ---- Admin polish: compact inline forms, table actions, settings form ---- */

/* Delivery-partner assign row on order detail: controls hug their content
   instead of stretching across the card. */
.assign-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: var(--sp-3) 0;
}
.assign-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
  margin: 0;
}
.assign-row select {
  min-width: 240px;
  max-width: 340px;
}
.assign-row button {
  flex: 0 0 auto;
}

/* Action cells: buttons/links sit on one compact line. */
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* Numeric table cells */
.atable td.num,
.atable th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Banner theme swatch */
.theme-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.theme-dot.t-green  { background: #0c831f; }
.theme-dot.t-teal   { background: #0d9488; }
.theme-dot.t-yellow { background: #f5c518; }
.theme-dot.t-blue   { background: #2563eb; }

/* Role / misc small chips in admin tables */
.role-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: #4b5563;
  text-transform: capitalize;
}
.role-chip.r-admin    { background: rgba(79, 70, 229, 0.1);  border-color: rgba(79, 70, 229, 0.35);  color: #4f46e5; }
.role-chip.r-seller   { background: rgba(13, 148, 136, 0.1); border-color: rgba(13, 148, 136, 0.35); color: #0d9488; }
.role-chip.r-employee { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.4); color: #b45309; }

/* Settings page: two-column field grid with per-field hints */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.set-field label {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.set-field .hint {
  display: block;
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-top: 4px;
}
.settings-section {
  margin: 0 0 var(--sp-2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

/* Table footer count line */
.table-count {
  font-size: 12.5px;
  color: #6b7280;
  margin: -6px 0 var(--sp-3);
}

/* ============ Admin presentation polish: forms, tables, reports, categories ============ */

/* Inline add-forms: input stretches, button stays its natural size */
.add-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.add-inline input, .add-inline select { flex: 1 1 180px; min-width: 0; padding: 10px 12px;
  border: 1px solid #e5e7eb; border-radius: 10px; }
.add-inline button { flex: 0 0 auto; white-space: nowrap; }
.add-inline.mini input { padding: 7px 10px; font-size: 13px; }
.add-inline.mini button { font-size: 12.5px; }
.co-box.compact { padding: 14px 18px; }

/* Numeric columns: right-aligned, tabular digits, compact width */
.atable th.num, .atable td.num { text-align: right; font-variant-numeric: tabular-nums;
  white-space: nowrap; width: 1%; padding-right: 18px; }
.atable tfoot th { border-top: 2px solid #e5e7eb; padding: 10px; font-size: 13px; }
.atable tfoot th.num { text-align: right; padding-right: 18px; }

/* Report cards */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.report-card { padding: 16px 18px; }
.report-head { display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.report-head h2 { margin: 0; font-size: 16.5px; }
.report-total { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.atable.report td, .atable.report th { padding: 8px 10px; }
.share-bar { height: 4px; background: #f1f3f5; border-radius: 999px; margin-top: 5px; max-width: 220px; }
.share-bar.wide { max-width: none; width: 100%; margin-top: 0; }
.share-fill { height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #16a34a, #0c831f); }
.trend-cell { width: 30%; min-width: 120px; }

/* Categories admin: compact two-column card grid */
.cat-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; }
.cat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); display: flex; flex-direction: column; gap: 12px; }
.cat-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  border-bottom: 1px solid #f1f3f5; padding-bottom: 10px; }
.cat-card-head h3 { margin: 0; font-size: 16.5px; }
.icon-danger { background: none; border: none; cursor: pointer; font-size: 15px; opacity: .45;
  padding: 4px 6px; border-radius: 8px; transition: all .15s; }
.icon-danger:hover { opacity: 1; background: #fdecec; }
.cat-card-section { display: flex; flex-direction: column; gap: 8px; }
.cat-card-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #9ca3af; }
.chip.attr { background: #f1ecfe; border-color: #ddd0fb; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 1100px) { .cat-admin-grid { grid-template-columns: 1fr; } }

/* ============ Master–detail layout (Categories manager) ============ */
.master-detail { display: grid; grid-template-columns: 290px 1fr; gap: 18px; align-items: start; }
.md-side { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px;
  position: sticky; top: 16px; max-height: calc(100vh - 100px); display: flex; flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.md-add { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #f1f3f5; }
.md-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.md-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 10px;
  text-decoration: none; color: #1a1a1a; border-left: 3px solid transparent; transition: background .12s; }
.md-item:hover { background: #f6f7f9; }
.md-item.active { background: #e9f7ec; border-left-color: #0c831f; }
.md-item.active .md-item-name { color: #0a7019; }
.md-item-name { font-weight: 600; font-size: 14px; }
.md-item-meta { font-size: 11.5px; color: #9ca3af; }

.md-detail { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.md-detail-head { display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 12px; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 16px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.md-detail-head h2 { margin: 0 0 2px; font-size: 20px; }
.md-detail-actions { display: flex; gap: 8px; align-items: center; }
.md-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); display: flex; flex-direction: column; gap: 12px; }
.md-card-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.md-card-head h3 { margin: 0; font-size: 15.5px; }
.btn-danger.mini { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.chip.mini { font-size: 11.5px; padding: 3px 10px; }

@media (max-width: 1000px) {
  .master-detail { grid-template-columns: 1fr; }
  .md-side { position: static; max-height: 260px; }
}

/* Stat values must never break mid-number; shrink instead */
.stat .n { white-space: nowrap; overflow-wrap: normal; font-size: clamp(14px, 1.3vw, 22px); }

/* ============ Lively product imagery: full-bleed card art ============ */
.pcard-img { display: block; padding: 0; overflow: hidden; border-radius: 14px 14px 0 0; }
.pcard-img img { display: block; width: 100%; aspect-ratio: 5 / 4; height: auto; object-fit: cover;
  object-position: center bottom; transition: transform .25s ease; }
.pcard:hover .pcard-img img { transform: scale(1.05); }
.pcard-body { padding: 8px 10px 10px; }

/* Category tiles: bigger, punchier */
.cat-tile img { width: 100%; height: 96px; object-fit: cover; border-radius: 14px; }
.cat-tile { width: auto; }
.cat-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px; }
.cat-tile span { font-size: 12.5px; font-weight: 600; }

/* PDP gallery: fill the frame */
.pdp-img { padding: 0; overflow: hidden; }
.pdp-img img { width: 100%; height: auto; display: block; }
.pdp-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Drawer + suggestion thumbnails keep their compact rounded look */
.dline img, .suggest-item img { border-radius: 10px; object-fit: cover; }

/* ============ Card & PDP buy-action polish ============ */
/* Tighter card rhythm: no dead space between name, rating, unit and price row */
.pcard-body { display: flex; flex-direction: column; gap: 2px; }
.pcard-name { margin: 0; min-height: 2.66em; line-height: 1.33; font-size: 12.5px; font-weight: 500; }
.pcard-rating { margin: 0; display: flex; align-items: center; }
.pcard-rating .rating-pill { font-size: 11px; padding: 2px 7px; }
.pcard-unit { margin: 0; font-size: 11.5px; }
.pcard-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }

/* Card stepper: same footprint as the ADD button, quiet and tidy */
.stepper.s-card { display: inline-flex; align-items: center; height: 34px; border-radius: 10px;
  overflow: hidden; padding: 0; }
.stepper.s-card button { width: 28px; height: 34px; border: none; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.stepper.s-card span { min-width: 22px; text-align: center; font-size: 13.5px; font-weight: 700; }
.add-btn.stepper { height: 34px; display: inline-flex; align-items: center; padding: 0 18px; }

/* PDP: price left, Add to cart right, one aligned row */
.pdp-buy-row { display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; padding: 14px 0; border-top: 1px solid #f1f3f5; border-bottom: 1px solid #f1f3f5;
  margin: 12px 0 16px; }
.pdp-pricebox { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0; padding: 0; border: none; }
.pdp-pricebox .tax-note { flex-basis: 100%; }
.pdp-cta { flex: 0 0 auto; }
.pdp-cta .add-btn.stepper, .pdp-cta .stepper.s-big { min-width: 190px; height: 48px; font-size: 15.5px;
  justify-content: center; border-radius: 12px; }
.pdp-cta .stepper.s-big button { width: 46px; height: 48px; font-size: 20px; border: none; cursor: pointer; }
.pdp-cta .stepper.s-big span { min-width: 34px; text-align: center; font-size: 16px; font-weight: 800; }
@media (max-width: 768px) {
  .pdp-buy-row { align-items: stretch; flex-direction: column; }
  .pdp-cta .add-btn.stepper, .pdp-cta .stepper.s-big { width: 100%; }
}

/* ============ Category tiles: no box-in-box — just image + label ============ */
.cat-grid .cat-tile { background: transparent; border: none; box-shadow: none; padding: 0; }
.cat-grid .cat-tile:hover { transform: none; box-shadow: none; background: transparent; }
.cat-tile img { border-radius: 18px; transition: transform .18s ease, box-shadow .18s ease; }
.cat-tile:hover img { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.cat-tile span { margin-top: 6px; }

/* Same idea on the category-page subnav: flat items, no nested tile chrome */
.subnav-item img { border-radius: 12px; }

/* ============ PDP gallery: clickable shots + lightbox ============ */
#pdp-main-img { cursor: zoom-in; }
.pdp-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.pdp-thumbs .thumb { width: 64px; height: 64px; padding: 0; border: 2px solid #e5e7eb;
  border-radius: 12px; overflow: hidden; background: none; cursor: pointer;
  transition: border-color .15s, transform .15s; }
.pdp-thumbs .thumb:hover { transform: translateY(-2px); }
.pdp-thumbs .thumb.active { border-color: #0c831f; box-shadow: 0 0 0 2px rgba(12,131,31,.18); }
.pdp-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

#lightbox-overlay { position: fixed; inset: 0; background: rgba(10, 12, 16, .88);
  display: none; align-items: center; justify-content: center; z-index: 200;
  cursor: zoom-out; padding: 4vh 4vw; }
#lightbox-overlay.open { display: flex; animation: lb-in .18s ease; }
#lightbox-img { max-width: min(88vw, 720px); max-height: 86vh; border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5); cursor: default; }
.lb-close { position: fixed; top: 22px; right: 26px; width: 44px; height: 44px;
  border-radius: 50%; border: none; background: rgba(255,255,255,.14); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer; transition: background .15s, transform .15s; }
.lb-close:hover { background: rgba(255,255,255,.3); transform: rotate(90deg); }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #lightbox-overlay.open { animation: none; } }

/* ============ Change Location modal ============ */
button.location { background: none; border: none; text-align: left; cursor: pointer; font: inherit; }
.loc-box { padding: 22px 24px 24px; }
.loc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.loc-head h2 { margin: 0; font-size: 17px; }
.modal-x { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer;
  color: #6b7280; padding: 2px 6px; border-radius: 6px; }
.modal-x:hover { background: #f1f3f5; color: #111; }
.loc-actions { display: flex; align-items: center; gap: 10px; }
.loc-actions .btn-green { white-space: nowrap; }
.loc-or { font-size: 10.5px; font-weight: 700; color: #9ca3af; border: 1px solid #e5e7eb;
  border-radius: 50%; width: 30px; height: 30px; flex: 0 0 30px; display: inline-flex;
  align-items: center; justify-content: center; background: #fff; }
#loc-search { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid #dfe3e8;
  border-radius: 8px; font-size: 13.5px; }
#loc-status { min-height: 16px; margin: 8px 2px 0; }
#loc-suggestions { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.loc-suggestion { text-align: left; background: #fff; border: none; padding: 8px 10px;
  border-radius: 7px; font-size: 13px; cursor: pointer; }
.loc-suggestion:hover { background: #f1f8f2; }
.loc-saved-head { font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: #6b7280; margin: 18px 0 8px; }
.loc-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.loc-item { display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; }
.loc-item.selected { border-color: #0c831f; background: #f7fdf8; }
.loc-pick { flex: 1; display: flex; gap: 10px; align-items: flex-start; background: none;
  border: none; text-align: left; cursor: pointer; font: inherit; min-width: 0; }
.loc-item-ico { font-size: 18px; background: #f6f7f9; border-radius: 8px; width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; }
.loc-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.loc-item-text .muted { font-size: 12.5px; }
.loc-item-text strong { display: flex; align-items: center; gap: 8px; }
.loc-item-actions { display: flex; gap: 6px; }
.loc-mini-btn { background: #f6f7f9; border: none; border-radius: 7px; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 13px; text-decoration: none; }
.loc-mini-btn:hover { background: #e9ecef; }
.loc-mini-btn.danger:hover { background: #fdecec; }
@media (max-width: 520px) {
  .loc-actions { flex-wrap: wrap; }
  .loc-or { display: none; }
  #loc-search { flex-basis: 100%; }
}

/* ============ Location fixes: stacked header text + roomier modal ============ */
/* Header location: the two lines must stack, never run into the search bar */
button.location { display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  min-width: 0; max-width: 230px; padding: 2px 0; }
button.location .loc-eta { display: block; white-space: nowrap; }
button.location .loc-addr { display: block; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #6b7280; }
@media (max-width: 900px) { button.location { max-width: 150px; } }

/* Location modal gets a wider box so the search field breathes */
#modal-box:has(.loc-box) { width: 520px; max-width: 94vw; }
.loc-actions { flex-wrap: nowrap; }
.loc-actions .btn-green { flex: 0 0 auto; }
#loc-search { flex: 1 1 auto; min-width: 140px; }
.loc-hint { margin: 6px 2px 0; }
.loc-suggestion { border: 1px solid #eef0f3; }
.loc-suggestion:first-child { border-color: #bfe3c6; background: #f4fbf5; font-weight: 600; }
@media (max-width: 560px) {
  #modal-box:has(.loc-box) { width: 94vw; }
  .loc-actions { flex-wrap: wrap; }
  .loc-actions .btn-green { width: 100%; justify-content: center; }
}

/* Location modal: text must never truncate */
#loc-search { font-size: 12.5px; }
#loc-search::placeholder { font-size: 12.5px; color: #9ca3af; }
.loc-actions .btn-green { font-size: 13px; padding: 0 12px; height: 40px; }
.loc-hint { font-size: 11px; line-height: 1.5; white-space: normal; }
.loc-box .loc-head h2 { font-size: 16px; }

/* /categories: art tiles instead of plain text chips */
.catlist-block h2 { display: flex; align-items: baseline; justify-content: space-between; }
.catlist-all { font-size: 13px; font-weight: 600; color: var(--indigo, #4f46e5); white-space: nowrap; }
.catlist-grid { margin-top: 6px; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
.catlist-grid .cat-tile img { width: 84px; height: 84px; }
