/* ═══════════════════════════════════════════════════════════════════════════
   MERGE Mall — storefront
   ───────────────────────────────────────────────────────────────────────────
   Brand blue (#2563eb) carries structure and trust; a warm coral-orange
   carries every call to act, so "buy" is never confused with "navigate".
   Type pairs Plus Jakarta Sans (display, geometric and confident) with Inter
   (UI and body, quiet and legible at small sizes).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* brand */
  --brand-50:  #eef4ff;
  --brand-100: #dbe6fe;
  --brand-200: #bfd3fe;
  --brand-400: #6096fa;
  --brand:     #2563eb;
  --brand-600: #1d4ed8;
  --brand-700: #1a3faf;
  --brand-900: #14245c;

  /* action */
  --pop-50:  #fff4ed;
  --pop-100: #ffe5d3;
  --pop:     #f97316;
  --pop-600: #e35d09;

  /* neutrals, biased very slightly cool toward the brand */
  --ink:     #0b1220;
  --ink-2:   #46536b;
  --ink-3:   #7d8aa0;
  --ink-4:   #a8b3c4;
  --line:    #e4e9f1;
  --line-2:  #eef1f6;
  --surface: #ffffff;
  --raised:  #f7f9fc;
  --bg:      #f4f7fb;

  /* semantic, deliberately separate from the accent */
  --ok:     #047857;
  --ok-bg:  #e7f8f1;
  --warn:   #a35b06;
  --warn-bg:#fdf3e3;
  --bad:    #c72d20;
  --bad-bg: #fdeeec;

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --sh-1: 0 1px 2px rgba(11,18,32,.05);
  --sh-2: 0 2px 6px rgba(11,18,32,.06), 0 8px 20px rgba(11,18,32,.05);
  --sh-3: 0 10px 34px rgba(11,18,32,.12);
  --sh-pop: 0 6px 20px rgba(249,115,22,.30);

  --display: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --header-h: 124px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-50:  #111d38;
    --brand-100: #16294d;
    --brand-200: #1d3566;
    --brand-400: #5b8ef0;
    --brand:     #4d8bf5;
    --brand-600: #6ba0f8;
    --brand-700: #8fb8fa;
    --brand-900: #cfe0fd;

    --pop-50:  #2c1608;
    --pop-100: #3d1f0a;
    --pop:     #fb8034;
    --pop-600: #fd9550;

    --ink:     #e9eef7;
    --ink-2:   #b3bed1;
    --ink-3:   #8492a8;
    --ink-4:   #616f85;
    --line:    #26313f;
    --line-2:  #1e2733;
    --surface: #151c26;
    --raised:  #1b2331;
    --bg:      #0d131b;

    --ok:     #34d3a0;
    --ok-bg:  #0f2b23;
    --warn:   #e6a84e;
    --warn-bg:#2d2213;
    --bad:    #f08579;
    --bad-bg: #2f1a18;

    --sh-1: 0 1px 2px rgba(0,0,0,.4);
    --sh-2: 0 2px 6px rgba(0,0,0,.4), 0 8px 20px rgba(0,0,0,.3);
    --sh-3: 0 10px 34px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }

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

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

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.021em; margin: 0; text-wrap: balance; }

:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 18px; }
.tabular { font-variant-numeric: tabular-nums; }

/* ── header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-block: 14px;
}

.logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.28rem;
  letter-spacing: -.034em;
  color: var(--ink);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 55%, var(--pop) 190%);
  display: grid; place-items: center;
  color: #fff; font-size: .95rem; font-weight: 800;
  box-shadow: var(--sh-1);
  flex: none;
}
.logo em { font-style: normal; color: var(--brand); }

.location-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
  padding: 8px 13px;
  border-radius: 999px;
  font-size: .845rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  max-width: 44vw;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .15s, border-color .15s, transform .12s;
}
.location-btn:hover { background: var(--brand-100); border-color: var(--brand-200); }
.location-btn:active { transform: scale(.975); }
.location-btn .pin { font-size: .95em; }

.search-form { flex: 1; min-width: 150px; position: relative; display: flex; }
.search-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 15px 12px 42px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: .93rem;
  font-family: inherit;
  background: var(--raised);
  color: var(--ink);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search-form input::placeholder { color: var(--ink-4); }
.search-form input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--brand-50);
}
.search-form .search-icon {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-4);
  pointer-events: none;
  font-size: .95rem;
}
.search-form button {
  position: absolute;
  right: 5px; top: 50%;
  transform: translateY(-50%);
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 8px 17px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 650;
  font-size: .85rem;
  transition: background .15s;
}
.search-form button:hover { background: var(--brand-600); }

.header-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  position: relative;
  background: none;
  border: none;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--raised); color: var(--ink); text-decoration: none; }
.icon-btn .glyph { font-size: 1.05rem; line-height: 1; }
.cart-count {
  background: var(--pop);
  color: #fff;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  padding-inline: 5px;
  display: inline-grid;
  place-items: center;
  box-shadow: var(--sh-1);
}

.site-nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid var(--line-2);
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 12px 15px;
  font-size: .885rem;
  font-weight: 650;
  color: var(--ink-3);
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ── main ───────────────────────────────────────────────────────────────── */

main { padding-block: 26px 80px; min-height: 64vh; }

/* ── hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  border-radius: var(--r-xl);
  padding: clamp(32px, 5.5vw, 62px) clamp(22px, 4.5vw, 54px);
  margin-bottom: 34px;
  overflow: hidden;
  background:
    radial-gradient(1000px 420px at 88% -12%, rgba(249,115,22,.34), transparent 62%),
    radial-gradient(760px 380px at 8% 108%, rgba(96,150,250,.42), transparent 60%),
    linear-gradient(128deg, var(--brand-700) 0%, var(--brand) 52%, var(--brand-600) 100%);
  color: #fff;
  box-shadow: var(--sh-3);
  isolation: isolate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.14) 1px, transparent 0);
  background-size: 22px 22px;
  opacity: .5;
  z-index: -1;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.24);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .015em;
  margin-bottom: 16px;
  backdrop-filter: blur(6px);
}
.hero h1 {
  font-size: clamp(1.85rem, 5.2vw, 3.35rem);
  line-height: 1.04;
  font-weight: 800;
  margin-bottom: 14px;
  max-width: 17ch;
}
.hero h1 .hl {
  background: linear-gradient(103deg, #ffd9b8 0%, #ffb877 60%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  margin: 0 0 26px;
  font-size: clamp(.98rem, 1.5vw, 1.1rem);
  opacity: .93;
  max-width: 50ch;
  line-height: 1.6;
}
.hero-search { max-width: 560px; }
.hero-search input {
  background: rgba(255,255,255,.97);
  border-color: transparent;
  padding-block: 15px;
  color: var(--ink);
  font-size: .98rem;
}
.hero-search input:focus { box-shadow: 0 0 0 4px rgba(255,255,255,.3); border-color: transparent; }
.hero-search .search-icon { color: var(--ink-3); }
.hero-search button { background: var(--pop); box-shadow: var(--sh-pop); padding: 9px 20px; }
.hero-search button:hover { background: var(--pop-600); }

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 24px;
  font-size: .845rem;
  font-weight: 550;
  opacity: .9;
}
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }

/* ── section headings ───────────────────────────────────────────────────── */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.18rem, 2.4vw, 1.52rem); font-weight: 800; }
.section-head .sub { font-size: .885rem; color: var(--ink-3); margin: 3px 0 0; }
.section-head .count {
  font-size: .8rem;
  font-weight: 650;
  color: var(--ink-3);
  background: var(--raised);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── grids ──────────────────────────────────────────────────────────────── */

.grid { display: grid; gap: 18px; }
.grid-stores { grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }
.grid-products { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }

/* ── store card ─────────────────────────────────────────────────────────── */

.store-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  box-shadow: var(--sh-1);
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s, border-color .2s;
}
.store-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-2);
  border-color: var(--brand-200);
  text-decoration: none;
}
.store-cover {
  height: 118px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(128deg, var(--brand-100), var(--brand-50) 60%, var(--pop-50));
}
/* Patterned fallback so a shop with no cover photo still looks finished. */
.store-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(37,99,235,.16) 1px, transparent 0);
  background-size: 15px 15px;
}
.store-cover img { width: 100%; height: 100%; object-fit: cover; position: relative; }
.store-avatar {
  position: absolute;
  left: 18px; bottom: -26px;
  width: 58px; height: 58px;
  border-radius: 15px;
  background: var(--surface);
  border: 3px solid var(--surface);
  box-shadow: var(--sh-2);
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 800; font-size: 1.22rem;
  color: var(--brand);
  overflow: hidden;
}
.store-avatar img { width: 100%; height: 100%; object-fit: cover; }
.store-body { padding: 36px 18px 18px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.store-body h3 { font-size: 1.04rem; font-weight: 750; }
.store-meta {
  font-size: .83rem;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.store-foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.store-pill {
  font-size: .775rem;
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-50);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.store-cta { font-size: .855rem; font-weight: 700; color: var(--brand); display: inline-flex; gap: 5px; align-items: center; }
.store-card:hover .store-cta .arr { transform: translateX(3px); }
.store-cta .arr { transition: transform .18s; }

/* ── product card ───────────────────────────────────────────────────────── */

.p-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--sh-1);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s, border-color .18s;
}
.p-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--brand-200); }
.p-thumb {
  aspect-ratio: 1;
  background: var(--raised);
  display: grid; place-items: center;
  overflow: hidden;
  position: relative;
}
.p-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s cubic-bezier(.2,.7,.3,1); }
.p-card:hover .p-thumb img { transform: scale(1.055); }

/* Most POS products have no photo, so the no-image state is the common case.
   A tinted monogram reads as a deliberate design, where a faded icon reads as
   a broken image. */
.p-thumb .ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.6rem;
  color: var(--brand);
  opacity: .34;
  background:
    radial-gradient(circle at 30% 24%, var(--brand-50), transparent 58%),
    linear-gradient(140deg, var(--raised), var(--brand-50) 130%);
  letter-spacing: -.03em;
  user-select: none;
}
.p-flag {
  position: absolute;
  top: 9px; left: 9px;
  z-index: 2;
}
.p-body { padding: 13px 13px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.p-cat { font-size: .715rem; font-weight: 700; color: var(--ink-4); text-transform: uppercase; letter-spacing: .05em; }
.p-name {
  font-size: .895rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.45em;
}
.p-price {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-top: auto;
}
.p-store { font-size: .78rem; color: var(--ink-3); }

/* ── buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 19px;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  font-family: var(--body);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  text-align: center;
  transition: background .16s, border-color .16s, transform .12s, box-shadow .16s, color .16s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.982); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-pop { background: var(--pop); color: #fff; box-shadow: var(--sh-pop); }
.btn-pop:hover:not(:disabled) { background: var(--pop-600); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover:not(:disabled) { background: var(--brand-600); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.btn-soft:hover:not(:disabled) { background: var(--brand-100); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--raised); border-color: var(--ink-4); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 13px; font-size: .835rem; border-radius: 9px; }
.btn-lg { padding: 15px 26px; font-size: 1rem; border-radius: var(--r); }

.btn-wa {
  background: #25d366;
  color: #fff;
  box-shadow: 0 6px 20px rgba(37,211,102,.32);
  font-size: 1.02rem;
  padding: 16px 24px;
}
.btn-wa:hover { background: #1fbb59; }

/* ── badges ─────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .715rem;
  font-weight: 750;
  padding: 4px 9px;
  border-radius: 7px;
  letter-spacing: .012em;
  white-space: nowrap;
}
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-best { background: var(--ok); color: #fff; box-shadow: 0 2px 8px rgba(4,120,87,.28); }
.badge-brand { background: var(--brand-50); color: var(--brand-700); }

/* ── notices ────────────────────────────────────────────────────────────── */

.notice {
  border-radius: var(--r-sm);
  padding: 13px 15px;
  font-size: .89rem;
  margin-bottom: 12px;
  border: 1px solid transparent;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}
.notice .ni { flex: none; font-size: 1rem; line-height: 1.3; }
.notice-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 24%, transparent); }
.notice-bad  { background: var(--bad-bg);  color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 24%, transparent); }
.notice-ok   { background: var(--ok-bg);   color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 24%, transparent); }
.notice-info { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }

/* ── panels ─────────────────────────────────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--sh-1);
}
.panel h3 { font-size: 1.04rem; font-weight: 750; margin-bottom: 14px; }

/* ── empty & skeleton ───────────────────────────────────────────────────── */

.empty {
  text-align: center;
  padding: 64px 22px;
  background: var(--surface);
  border: 1.5px dashed var(--line);
  border-radius: var(--r-lg);
}
.empty .emoji { font-size: 2.6rem; margin-bottom: 10px; opacity: .8; }
.empty h3 { font-size: 1.14rem; font-weight: 750; margin-bottom: 7px; }
.empty p { margin: 0 auto 20px; color: var(--ink-3); max-width: 42ch; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@keyframes shimmer { 100% { background-position-x: -200%; } }
.sk {
  background: linear-gradient(90deg, var(--line-2) 8%, var(--line) 20%, var(--line-2) 34%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: 8px;
}
.sk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.sk-thumb { aspect-ratio: 1; }
.sk-lines { padding: 13px; display: flex; flex-direction: column; gap: 8px; }
.sk-line { height: 11px; }
.sk-line.w60 { width: 60%; }
.sk-line.w40 { width: 40%; }

@media (prefers-reduced-motion: reduce) {
  .sk { animation-duration: 6s; }
  * { transition-duration: .01ms !important; }
}

/* ── modal ──────────────────────────────────────────────────────────────── */

@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.975); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11,18,32,.62);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 120;
  animation: fadeIn .18s ease-out;
  overflow-y: auto;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  width: 100%;
  max-width: 452px;
  max-height: min(92vh, 780px);
  overflow-y: auto;
  padding: 30px;
  animation: popIn .22s cubic-bezier(.2,.8,.3,1);
}
.modal h2 { font-size: 1.36rem; font-weight: 800; margin-bottom: 7px; }
.modal .sub { color: var(--ink-2); font-size: .91rem; margin: 0 0 22px; }

/* ── forms ──────────────────────────────────────────────────────────────── */

.field { margin-bottom: 15px; }
.field label { display: block; font-size: .825rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field label .opt { font-weight: 500; color: var(--ink-4); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: .93rem;
  background: var(--raised);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--brand-50);
}
.field textarea { resize: vertical; min-height: 82px; }
.field .hint { font-size: .785rem; color: var(--ink-3); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.seg {
  display: flex;
  gap: 4px;
  background: var(--raised);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.seg button {
  flex: 1;
  border: none;
  background: none;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: .87rem;
  font-weight: 700;
  color: var(--ink-3);
  cursor: pointer;
  transition: background .16s, color .16s;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* ── chips ──────────────────────────────────────────────────────────────── */

.chips {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 18px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: .86rem;
  font-weight: 650;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.chip:hover { border-color: var(--brand-200); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.25); }

/* ── store hero ─────────────────────────────────────────────────────────── */

.shop-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--sh-1);
}
.shop-cover {
  height: clamp(130px, 22vw, 210px);
  position: relative;
  overflow: hidden;
  background: linear-gradient(128deg, var(--brand-100), var(--brand-50) 55%, var(--pop-50));
}
.shop-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(37,99,235,.16) 1px, transparent 0);
  background-size: 18px 18px;
}
.shop-cover img { width: 100%; height: 100%; object-fit: cover; position: relative; }
.shop-body { padding: 20px; display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.shop-avatar {
  width: 84px; height: 84px;
  border-radius: 20px;
  margin-top: -58px;
  border: 4px solid var(--surface);
  background: var(--surface);
  box-shadow: var(--sh-2);
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 800; font-size: 1.7rem; color: var(--brand);
  overflow: hidden;
  flex: none;
}
.shop-avatar img { width: 100%; height: 100%; object-fit: cover; }
.shop-text { flex: 1; min-width: 220px; }
.shop-text h1 { font-size: clamp(1.32rem, 3.2vw, 1.85rem); font-weight: 800; margin-bottom: 5px; }
.shop-text p { margin: 0 0 8px; color: var(--ink-2); font-size: .93rem; }
.shop-facts { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .84rem; color: var(--ink-3); }
.shop-facts span { display: inline-flex; align-items: center; gap: 6px; }

/* ── offer groups (price comparison) ────────────────────────────────────── */

.offer-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.offer-head { display: flex; gap: 15px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.offer-head .thumb {
  width: 62px; height: 62px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--raised);
  display: grid; place-items: center;
  color: var(--ink-4); font-size: 1.5rem;
  flex: none;
  overflow: hidden;
}
.offer-head h3 { font-size: 1.04rem; font-weight: 750; margin-bottom: 3px; }
.offer-head .meta { font-size: .82rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.offer-spread {
  margin-left: auto;
  text-align: right;
  flex: none;
}
.offer-spread .lbl { font-size: .72rem; font-weight: 700; color: var(--ink-4); text-transform: uppercase; letter-spacing: .05em; }
.offer-spread .val { font-family: var(--display); font-size: 1.12rem; font-weight: 800; color: var(--ok); }

.offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
  transition: background .15s;
}
.offer-row:last-child { border-bottom: none; }
.offer-row:hover { background: var(--raised); }
.offer-row.best { background: linear-gradient(90deg, var(--ok-bg), transparent 72%); }
.offer-row.best:hover { background: linear-gradient(90deg, var(--ok-bg), transparent 60%); }
.offer-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.offer-store { font-weight: 700; font-size: .93rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.offer-link { font-size: .8rem; color: var(--ink-3); }
.offer-link:hover { color: var(--brand); }
.offer-right { display: flex; align-items: center; gap: 14px; }
.offer-price { font-family: var(--display); font-weight: 800; font-size: 1.14rem; letter-spacing: -.02em; }

/* ── cart ───────────────────────────────────────────────────────────────── */

.cart-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 20px; align-items: start; }
.cart-summary { position: sticky; top: calc(var(--header-h) + 14px); }

.cart-store-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 4px;
}
.cart-store-head h3 { margin: 0; font-size: .99rem; font-weight: 750; display: flex; align-items: center; gap: 9px; }
.cart-store-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }

.cart-line {
  display: grid;
  grid-template-columns: 66px minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}
.cart-line:last-of-type { border-bottom: none; }
.cart-line .ct {
  width: 66px; height: 66px;
  border-radius: 11px;
  object-fit: cover;
  background: var(--raised);
  display: grid; place-items: center;
  color: var(--ink-4); font-size: 1.4rem;
  overflow: hidden;
}
.cart-line-name { font-weight: 650; font-size: .93rem; line-height: 1.35; }
.cart-line-sub { font-size: .825rem; color: var(--ink-3); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cart-line-right { display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }

.qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.qty button {
  width: 32px; height: 32px;
  background: none; border: none;
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 700; font-size: 1rem;
  display: grid; place-items: center;
  transition: background .14s, color .14s;
}
.qty button:hover { background: var(--brand-50); color: var(--brand); }
.qty span { min-width: 34px; text-align: center; font-weight: 700; font-size: .89rem; font-variant-numeric: tabular-nums; }

.totals-row { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; color: var(--ink-2); padding-block: 5px; }
.totals-row.grand {
  font-family: var(--display);
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--ink);
  padding-top: 13px;
  margin-top: 8px;
  border-top: 1.5px solid var(--line);
  letter-spacing: -.02em;
}
.totals-row.sub { font-weight: 700; color: var(--ink); }

/* ── order confirmation ─────────────────────────────────────────────────── */

.ok-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 42px 26px;
  text-align: center;
  box-shadow: var(--sh-2);
}
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(4,120,87,.34); } 70% { box-shadow: 0 0 0 20px rgba(4,120,87,0); } 100% { box-shadow: 0 0 0 0 rgba(4,120,87,0); } }
.ok-mark {
  width: 70px; height: 70px;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 2rem;
  display: grid; place-items: center;
  margin: 0 auto 18px;
  animation: pulseRing 2s ease-out 2;
}
.ok-card h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.ok-card .lead { color: var(--ink-2); margin: 0 0 20px; }
.ref-plate {
  display: inline-block;
  background: var(--brand-50);
  border: 1.5px dashed var(--brand-200);
  color: var(--brand-700);
  font-family: var(--display);
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: .01em;
  padding: 13px 28px;
  border-radius: var(--r);
  font-variant-numeric: tabular-nums;
}

/* ── toast ──────────────────────────────────────────────────────────────── */

@keyframes toastUp { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 13px 20px;
  border-radius: 999px;
  font-size: .89rem;
  font-weight: 650;
  z-index: 200;
  box-shadow: var(--sh-3);
  max-width: calc(100vw - 36px);
  display: flex; align-items: center; gap: 9px;
  animation: toastUp .24s cubic-bezier(.2,.8,.3,1);
}

/* ── spinner ────────────────────────────────────────────────────────────── */

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 56px auto;
}

/* ── footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 32px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: .86rem;
}
.footer-grid { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }

/* ── responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .cart-grid { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}

@media (max-width: 760px) {
  :root { --header-h: 150px; }
  body { font-size: 14.5px; }
  .header-row { flex-wrap: wrap; gap: 10px; }
  .search-form { order: 3; flex-basis: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .grid-products { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .grid-stores { grid-template-columns: 1fr; }
  .hero { border-radius: var(--r-lg); }
  .modal { padding: 24px; border-radius: var(--r-lg); }
  .offer-head { flex-wrap: wrap; }
  .offer-spread { margin-left: 0; text-align: left; width: 100%; }
  .cart-line { grid-template-columns: 56px minmax(0,1fr); }
  .cart-line .ct { width: 56px; height: 56px; }
  .cart-line-right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .shop-avatar { width: 66px; height: 66px; margin-top: -44px; font-size: 1.35rem; }
}
