/* Ordo Marketplace — the shopper's side.
   ------------------------------------------------------------------
   Same design system as the landing page at '/': same tokens, same
   atmosphere, same button family. A shopper clicks a sky-blue "Enter the
   marketplace" button and arrives somewhere that looks like where they came
   from.

   Within that system: SKY is the marketplace's accent and carries navigation
   and actions, MINT carries money and success — the cart, checkout, totals. */

:root {
  --bg: #07100f;
  --bg-2: #0a1514;
  --panel: rgba(255, 255, 255, .028);
  --line: rgba(255, 255, 255, .08);
  --line-soft: rgba(255, 255, 255, .055);

  --ink: #eef4f2;
  --ink-2: #a9bbb6;
  --ink-3: #72857f;

  --mint: #3ddca6;
  --mint-2: #5ce8bc;
  --mint-dim: rgba(61, 220, 166, .12);

  --sky: #63c8e8;
  --sky-2: #8ad9f1;
  --sky-dim: rgba(99, 200, 232, .12);

  --amber: #f0b45e;
  --danger: #f08a7e;

  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 66px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  font-family: 'Inter', 'Noto Sans Sinhala', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

::selection { background: rgba(99, 200, 232, .25); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  background: var(--sky); color: #04202a; padding: 8px 14px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── atmosphere ───────────────────────────────────────────────── */
.aura { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.aura::before, .aura::after { content: ''; position: absolute; border-radius: 50%; filter: blur(120px); }
.aura::before {
  width: 680px; height: 680px; top: -340px; left: 50%; transform: translateX(-55%);
  background: radial-gradient(circle, rgba(99, 200, 232, .15), transparent 65%);
}
.aura::after {
  width: 560px; height: 560px; top: 45%; right: -260px;
  background: radial-gradient(circle, rgba(61, 220, 166, .09), transparent 65%);
}
.grid-lines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 10%, transparent 75%);
}

/* ── type ─────────────────────────────────────────────────────── */
h1, h2, h3 { font-weight: 600; line-height: 1.15; letter-spacing: -.025em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.035em; }
h2 { font-size: 1.3rem; }
p { color: var(--ink-2); }
.muted { color: var(--ink-3); }
.small { font-size: .86rem; }
.tiny { font-size: .72rem; }
.center { text-align: center; }
.pre { white-space: pre-line; }
.amount { font-weight: 600; color: var(--mint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.spacer { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: 20px 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--sky); margin-bottom: 16px;
}

/* ── header ───────────────────────────────────────────────────── */
.glass-header {
  display: flex; align-items: center; gap: 18px;
  padding: 0 28px; height: var(--header-h);
  background: rgba(7, 16, 15, .82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 100;
}
.logo {
  display: flex; align-items: center; gap: 10px; flex: none;
  font-size: 1.06rem; font-weight: 600; letter-spacing: -.025em; color: var(--ink);
}
.logo::before {
  content: ''; width: 26px; height: 26px; flex: none;
  background: url('/market/assets/logo-mark.png') center/contain no-repeat;
}
.logo span { font-weight: 400; color: var(--ink-3); }

.header-search {
  flex: 1; max-width: 520px; position: relative; margin: 0 auto;
}
.header-search input, .inline-search input, .hero-search input {
  padding-left: 40px;
}
.header-search .ico, .inline-search .ico, .hero-search .ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--ink-3); pointer-events: none;
}
.header-search input { height: 42px; padding-top: 0; padding-bottom: 0; border-radius: 999px; font-size: .94rem; }

.header-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.nav-link {
  padding: 8px 12px; border-radius: 9px; font-size: .9rem; color: var(--ink-2); font-weight: 500;
  transition: color .2s, background .2s;
}
.nav-link:hover, .nav-link.active { color: var(--ink); background: rgba(255, 255, 255, .05); }
.nav-sell { color: var(--mint); }

/* ── layout ───────────────────────────────────────────────────── */
main {
  position: relative; z-index: 1; flex: 1; width: 100%;
  max-width: 1200px; margin: 0 auto; padding: 0 28px 72px;
}
main:focus { outline: none; }

.hero { text-align: center; padding: clamp(40px, 7vh, 72px) 0 clamp(20px, 3vh, 32px); }
.hero p { max-width: 540px; margin: 14px auto 0; font-size: 1.02rem; }
.hero-search {
  position: relative; display: flex; gap: 8px; max-width: 560px; margin: 28px auto 0;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
}
.hero-search input { border: 0; background: transparent; box-shadow: none !important; }
.hero-search input:focus { background: transparent; }
.trust-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin-top: 20px;
  font-size: .85rem; color: var(--ink-2);
}
.trust-row span { display: inline-flex; align-items: center; gap: 7px; }
.trust-row svg { color: var(--mint); }

.page-head { padding: 34px 0 20px; }
.page-head p { margin-top: 6px; }
.back-link, .crumbs a { color: var(--ink-3); font-size: .88rem; display: inline-flex; align-items: center; gap: 4px; }
.back-link { margin-bottom: 10px; }
.back-link:hover, .crumbs a:hover { color: var(--sky); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 0 16px; font-size: .88rem; color: var(--ink-3); }

.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-title { font-size: 1.1rem; margin: 30px 0 14px; }
.see-all { color: var(--sky); font-size: .9rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.shops-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid > .empty-state, .grid > .loading, .grid > .error-msg { grid-column: 1 / -1; }

.load-more-wrap, .center-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.narrow { max-width: 720px; margin: 0 auto; }

/* ── chips ────────────────────────────────────────────────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; }
.chip-row.scroll::-webkit-scrollbar { display: none; }
.chip-row.center { justify-content: center; }
@media (max-width: 900px) { .chip-row.center { justify-content: flex-start; } }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-size: .86rem; font-weight: 500;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .035); color: var(--ink-2);
  transition: background .2s, border-color .2s, color .2s;
}
.chip:hover:not(:disabled):not(.static) { color: var(--ink); border-color: rgba(99, 200, 232, .35); }
.chip.active { background: var(--sky-dim); border-color: rgba(99, 200, 232, .55); color: var(--sky-2); }
.chip:disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.chip-n { font-size: .74rem; color: var(--ink-3); }
.chip-row.small .chip { padding: 3px 10px; font-size: .74rem; }

/* ── filters ──────────────────────────────────────────────────── */
.filters { display: grid; gap: 12px; margin-bottom: 20px; }
.inline-search { position: relative; max-width: 420px; }
.filter-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.result-count { margin-right: auto; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: .88rem; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-weight: 500; margin: 0;
}
.toggle input { width: 16px; height: 16px; accent-color: var(--sky); }
select {
  font: inherit; font-size: .88rem; color: var(--ink);
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 12px;
}
select option { background: var(--bg-2); }
.select-wrap { margin: 0; }

/* ── cards ────────────────────────────────────────────────────── */
.card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  transition: transform .35s var(--ease), border-color .35s, background .35s, box-shadow .35s;
}
.card:hover {
  border-color: rgba(99, 200, 232, .3);
  box-shadow: 0 30px 60px -44px rgba(0, 0, 0, .95);
}
.card h3 { font-size: 1.05rem; }
.card-go {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: .87rem; color: var(--sky); font-weight: 500;
}
.card-go svg { transition: transform .3s var(--ease); }
.card:hover .card-go svg { transform: translateX(3px); }

/* shop card */
.shop-card:hover { transform: translateY(-3px); }
.shop-mosaic { display: grid; height: 150px; gap: 2px; background: rgba(0, 0, 0, .3); }
.shop-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }
.shop-mosaic.n2 { grid-template-columns: 1fr 1fr; }
.shop-mosaic.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.shop-mosaic.n3 img:first-child { grid-row: span 2; }
.shop-mosaic.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.shop-mosaic.empty {
  place-items: center; color: var(--ink-3);
  background: radial-gradient(circle at 30% 20%, rgba(99, 200, 232, .12), transparent 60%), rgba(0, 0, 0, .3);
}
.shop-body { padding: 18px 20px 20px; display: grid; gap: 6px; }

/* product card */
.product-card .product-media { position: relative; display: block; }
.product-image {
  width: 100%; aspect-ratio: 1 / 1; height: auto; display: block; object-fit: cover;
  background: rgba(0, 0, 0, .28);
  border-bottom: 1px solid var(--line-soft);
  transition: transform .5s var(--ease);
}
.product-card:hover .product-image { transform: scale(1.03); }
.product-card .product-media { overflow: hidden; }
.no-image {
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 25%, rgba(99, 200, 232, .16), transparent 55%),
              radial-gradient(circle at 75% 80%, rgba(61, 220, 166, .1), transparent 55%), rgba(0, 0, 0, .3);
}
.no-image span { font-size: 2.6rem; font-weight: 700; color: rgba(238, 244, 242, .22); letter-spacing: -.04em; }
.product-card.is-out .product-image { opacity: .5; filter: grayscale(.5); }

.sale-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--amber); color: #2a1a02; font-size: .74rem; font-weight: 700;
  padding: 3px 8px; border-radius: 7px;
}
.sale-badge.big { font-size: .9rem; top: 14px; left: 14px; }

.wish-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(7, 16, 15, .7); border: 1px solid var(--line); color: var(--ink-2);
  backdrop-filter: blur(6px); transition: color .2s, transform .2s;
}
.wish-btn:hover { color: var(--ink); transform: scale(1.06); }
.wish-btn.on { color: #ff7a8a; }
.wish-btn.on svg { fill: currentColor; }
.wish-btn.inline { position: static; width: auto; height: auto; padding: 6px 12px; border-radius: 999px; gap: 6px; font-size: .88rem; }
.wish-btn.inline::after { content: 'Save'; }
.wish-btn.inline.on::after { content: 'Saved'; }

.product-info { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; gap: 4px; }
.product-shop { font-size: .76rem; color: var(--sky); font-weight: 500; letter-spacing: .01em; }
.product-shop:hover { text-decoration: underline; }
.product-title { font-size: .98rem; font-weight: 600; line-height: 1.3; }
.product-title a:hover { color: var(--sky-2); }
.product-si { font-size: .84rem; color: var(--ink-3); }
.product-si.big { font-size: 1rem; margin-top: 4px; }
.product-meta { margin: 6px 0 8px; }
.product-price {
  font-size: 1.14rem; font-weight: 600; color: var(--mint);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 2px 0 10px;
}
.product-price .was { font-size: .82rem; color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.product-stock {
  font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
  padding: 3px 9px; border-radius: 100px; display: inline-block;
  border: 1px solid var(--line); color: var(--ink-3); background: rgba(255, 255, 255, .04);
}
.stock-AVAILABLE { color: var(--mint); border-color: rgba(61, 220, 166, .3); background: var(--mint-dim); }
.stock-LIMITED { color: var(--amber); border-color: rgba(240, 180, 94, .3); background: rgba(240, 180, 94, .1); }
.stock-PRE_ORDER { color: var(--sky); border-color: rgba(99, 200, 232, .3); background: var(--sky-dim); }
.stock-OUT_OF_STOCK { color: var(--danger); border-color: rgba(240, 138, 126, .3); background: rgba(240, 138, 126, .1); }

/* skeletons */
.sk {
  background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .09), rgba(255, 255, 255, .04));
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px;
}
.sk-line { height: 14px; margin: 8px 0; width: 80%; }
.sk-line.short { width: 55%; }
.sk-line.tiny { width: 30%; }
.skeleton { pointer-events: none; }
.skeleton .product-image { border: 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── buttons ──────────────────────────────────────────────────── */
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: .94rem; font-weight: 600; text-align: center;
  background: linear-gradient(135deg, var(--sky), #4bb3d6);
  color: #04202a; border: 1px solid transparent;
  box-shadow: 0 10px 30px -14px rgba(99, 200, 232, .9);
  transition: transform .25s var(--ease), background .25s, box-shadow .25s, opacity .2s;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--sky-2), #5cc4e4);
  box-shadow: 0 14px 36px -14px rgba(99, 200, 232, .95);
}
.btn-primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-primary.big { padding: 15px 20px; font-size: 1.02rem; margin-top: 18px; }
.btn-inline { width: auto; }
.btn-sm { padding: 9px 12px; font-size: .86rem; }

/* Money leaves the shopper's hands here, so it is mint, like every other
   confirmed total in Ordo. */
#place-order-btn, .checkout-btn, .btn-mint {
  background: linear-gradient(135deg, var(--mint), #31c493);
  color: #04241a;
  box-shadow: 0 10px 30px -14px rgba(61, 220, 166, .9);
}
#place-order-btn:hover:not(:disabled), .checkout-btn:hover:not(:disabled), .btn-mint:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--mint-2), #3ad4a2);
  box-shadow: 0 14px 36px -14px rgba(61, 220, 166, .95);
}

.btn-quiet {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 10px; padding: 10px 16px; border-radius: var(--radius-sm);
  text-align: center; font-size: .9rem; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--line);
  transition: background .25s, color .25s, border-color .25s;
}
.btn-quiet.btn-inline, .btn-quiet.btn-sm { margin-top: 0; width: auto; }
.btn-quiet:hover:not(:disabled) { background: rgba(255, 255, 255, .05); color: var(--ink); border-color: rgba(255, 255, 255, .16); }
.btn-quiet:disabled { opacity: .5; cursor: wait; }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--sky); font-size: .88rem; font-weight: 500; padding: 4px 0;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--ink-3); }
.link-btn.danger:hover { color: var(--danger); }

.glass-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; position: relative; flex: none;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .035);
  color: var(--ink); font-size: .89rem;
  transition: transform .25s var(--ease), background .25s, border-color .25s;
}
.glass-btn:hover { background: rgba(255, 255, 255, .075); border-color: rgba(255, 255, 255, .16); }
.glass-btn.bump { animation: bump .4s var(--ease); }
@keyframes bump { 40% { transform: scale(1.18); } }
.small-btn { width: auto; padding: 9px 16px; gap: 8px; font-weight: 500; }

.icon-btn { background: transparent; color: var(--ink-3); display: inline-flex; padding: 4px; border-radius: 8px; }
.icon-btn:hover { color: var(--ink); }

.badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--mint); color: #04241a;
  font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center;
  border-radius: 100px;
  box-shadow: 0 0 0 3px var(--bg);
}
#cart-count.empty { background: rgba(255, 255, 255, .14); color: var(--ink-2); }
#wishlist-count { background: #ff7a8a; color: #2a0409; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(4, 36, 26, .3); border-top-color: #04241a;
  animation: spin .7s linear infinite;
}

/* ── product page ─────────────────────────────────────────────── */
.product-page { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.gallery { position: sticky; top: calc(var(--header-h) + 20px); }
.gallery-main {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .3);
}
.gallery-main img, .product-image.big { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; border: 0; }
.product-image.big.sk { border-radius: var(--radius); }
.thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; }
.thumb {
  width: 72px; height: 72px; flex: none; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; opacity: .65; transition: opacity .2s, border-color .2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.active, .thumb:hover { opacity: 1; border-color: var(--sky); }

.buy-box { display: grid; gap: 12px; }
.pd-title { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.pd-price .product-price { font-size: 1.7rem; margin: 4px 0 0; }
.variant-group .label { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.buy-row { display: flex; gap: 12px; align-items: stretch; margin-top: 6px; }
.buy-row .btn-primary { flex: 1; }

.stepper {
  display: inline-flex; align-items: center; flex: none;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(0, 0, 0, .3);
}
.stepper button { width: 40px; height: 44px; font-size: 1.2rem; color: var(--ink-2); }
.stepper button:hover:not(:disabled) { color: var(--ink); }
.stepper button:disabled { opacity: .3; cursor: not-allowed; }
.stepper input {
  width: 46px; text-align: center; border: 0; background: transparent; padding: 0; height: 44px;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { box-shadow: none; }
.stepper.sm button { width: 30px; height: 30px; font-size: 1rem; }
.stepper.sm span { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }

.pd-actions { display: flex; gap: 18px; align-items: center; }
.pd-perks { list-style: none; display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(0, 0, 0, .2); }
.pd-perks li { display: flex; gap: 12px; align-items: flex-start; }
.pd-perks svg { color: var(--mint); flex: none; margin-top: 3px; }
.pd-perks div { display: grid; font-size: .9rem; }
.pd-section { border-top: 1px solid var(--line-soft); padding-top: 16px; }
.pd-section h2 { font-size: 1rem; margin-bottom: 8px; }
details.pd-section summary { cursor: pointer; font-weight: 600; }
details.pd-section p { margin-top: 10px; }

/* ── shop page ────────────────────────────────────────────────── */
.shop-hero { padding: 30px 0 22px; display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.shop-hero-body { flex: 1; min-width: 240px; }
.shop-hero h1 { margin: 0 0 8px; }
#shop-sub { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .88rem; }
#shop-sub span { display: inline-flex; align-items: center; gap: 6px; }
#shop-sub svg { color: var(--mint); }

/* ── overlays ─────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(3, 8, 8, .66);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; justify-content: flex-end;
  opacity: 1; transition: opacity .3s var(--ease);
}
/* The overlays hide with opacity and visibility rather than display:none, so
   they animate and a closed pane still leaves the tab order. */
.overlay.hidden {
  display: flex !important;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity .3s var(--ease), visibility 0s linear .3s;
}
.slide-pane {
  width: 100%; max-width: 440px; height: 100%;
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(0);
  transition: transform .35s var(--ease);
  box-shadow: -30px 0 70px -30px rgba(0, 0, 0, .9);
}
.overlay.hidden .slide-pane { transform: translateX(100%); }

.overlay.dialog { justify-content: center; align-items: center; padding: 20px; z-index: 1100; }
.dialog-pane { height: auto; max-width: 400px; border: 1px solid var(--line); border-radius: 18px; }
.overlay.dialog.hidden .dialog-pane { transform: translateY(14px) scale(.98); }
.dialog-pane h2 { margin-bottom: 8px; }
.dialog-actions { display: flex; gap: 10px; margin-top: 22px; }
.dialog-actions > * { flex: 1; margin: 0; }

.pane-header {
  padding: 18px 22px; border-bottom: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(0, 0, 0, .2);
}
.pane-header h2 { font-size: 1.14rem; }
.pane-content { flex: 1; overflow-y: auto; padding: 20px 22px; }
.pane-footer { padding: 14px 22px; border-top: 1px solid var(--line-soft); background: rgba(0, 0, 0, .24); }

/* ── cart ─────────────────────────────────────────────────────── */
.cart-group { padding: 16px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255, 255, 255, .02); margin-bottom: 16px; }
.cart-group-head a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; margin-bottom: 12px; }
.cart-group-head a:hover { color: var(--sky); }
.cart-group-head svg { color: var(--sky); }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px dashed var(--line-soft); }
.cart-thumb { width: 64px; height: 64px; flex: none; border-radius: 10px; overflow: hidden; background: rgba(0, 0, 0, .3); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-ph { width: 100%; height: 100%; }
.cart-ph span { font-size: 1.4rem; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title { font-weight: 500; display: block; line-height: 1.3; }
.cart-item-title:hover { color: var(--sky-2); }
.cart-item-controls { display: flex; align-items: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.cart-item .amount { align-self: flex-start; }
.qty-btn { color: var(--ink-2); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 1.08rem; font-weight: 600; }
.small-total { font-size: .95rem; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.checkout-btn { margin-top: 4px; }

/* ── forms ────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.span-2 { grid-column: span 2; }
.form-group { margin-bottom: 16px; }
.form-group label, .form-label {
  display: block; margin-bottom: 7px;
  font-size: .76rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.optional { text-transform: none; letter-spacing: 0; font-weight: 400; }
input, textarea {
  width: 100%; padding: 12px 14px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink); font-family: inherit; font-size: 1rem;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 64px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(99, 200, 232, .55);
  background: rgba(0, 0, 0, .45);
  box-shadow: 0 0 0 3px rgba(99, 200, 232, .12);
}
input[type="search"]::-webkit-search-cancel-button { filter: invert(.7); }
input.invalid { border-color: rgba(240, 138, 126, .7); box-shadow: 0 0 0 3px rgba(240, 138, 126, .12); }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 6px; }

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .012));
  border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px;
}
.panel-title { font-size: 1.05rem; margin: 0 0 16px; }
.panel .panel-title:not(:first-child) { margin-top: 26px; }

.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.summary { position: sticky; top: calc(var(--header-h) + 20px); }
.summary-line { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: .92rem; }
.summary-line > span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-totals { border-top: 1px solid var(--line-soft); margin-top: 10px; padding-top: 10px; }
.summary-totals .total-row { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
#sum-note { margin: 12px 0 6px; }

.pay-option {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px;
}
.pay-option.selected { border-color: rgba(61, 220, 166, .5); background: var(--mint-dim); }
.pay-option > svg { color: var(--mint); flex: none; }
.pay-option > div { flex: 1; }
.pay-check { width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: #04241a; display: grid; place-items: center; }

/* ── orders ───────────────────────────────────────────────────── */
.orders-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.track-form .btn-primary { width: auto; }
#track-result { margin-top: 16px; display: grid; gap: 16px; }
#my-orders { display: grid; gap: 16px; }
.order-card { display: grid; gap: 16px; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.order-head h3 { font-size: 1.1rem; margin: 2px 0; }
.state-pill {
  flex: none; font-size: .74rem; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2); background: rgba(255, 255, 255, .04);
}
.state-CONFIRMED, .state-PACKED, .state-HANDED_TO_COURIER, .state-IN_TRANSIT { color: var(--sky-2); border-color: rgba(99, 200, 232, .4); background: var(--sky-dim); }
.state-DELIVERED, .state-COMPLETED { color: var(--mint); border-color: rgba(61, 220, 166, .4); background: var(--mint-dim); }
.state-CANCELLED, .state-RETURNED, .state-FAILED_DELIVERY, .state-COD_REFUSED, .state-RETURN_REQUESTED { color: var(--danger); border-color: rgba(240, 138, 126, .35); background: rgba(240, 138, 126, .1); }

.timeline { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 10%; right: 10%; top: 11px; height: 2px; background: var(--line);
}
.timeline li { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; font-size: .78rem; color: var(--ink-3); }
.timeline .dot {
  width: 24px; height: 24px; border-radius: 50%; z-index: 1;
  display: grid; place-items: center;
  background: var(--bg-2); border: 2px solid var(--line);
}
.timeline li.done .dot { background: var(--mint); border-color: var(--mint); color: #04241a; }
.timeline li.done { color: var(--ink-2); }
.timeline li.current .step-label { color: var(--ink); font-weight: 600; }
.order-lines { border-top: 1px solid var(--line-soft); padding-top: 8px; }
.order-lines .total-row { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 1rem; }

.success-message { text-align: center; padding: 48px 12px 28px; }
.success-icon {
  width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center; color: #04241a;
  background: linear-gradient(135deg, var(--mint), #31c493);
  box-shadow: 0 20px 50px -20px rgba(61, 220, 166, .9);
  animation: pop .5s var(--ease);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.success-message h1 { margin-bottom: 10px; }
.success-message p { max-width: 520px; margin: 0 auto; }
.ref { color: var(--ink); font-size: 1.1em; letter-spacing: .02em; }

/* ── states ───────────────────────────────────────────────────── */
.error-msg {
  color: var(--danger);
  background: rgba(240, 138, 126, .09);
  border: 1px solid rgba(240, 138, 126, .28);
  padding: 12px 14px; border-radius: var(--radius-sm); margin-top: 14px; font-size: .9rem;
}
.loading { padding: 44px 0; text-align: center; color: var(--ink-3); font-size: .92rem; }
.loading::before {
  content: ''; display: block; width: 22px; height: 22px; margin: 0 auto 14px;
  border: 2px solid var(--line); border-top-color: var(--sky); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 48px 16px; display: grid; justify-items: center; gap: 10px; }
.empty-state p { max-width: 380px; }
.empty-icon {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  color: var(--sky); background: var(--sky-dim); border: 1px solid rgba(99, 200, 232, .25); margin-bottom: 6px;
}
.empty-state .btn-primary, .empty-state .btn-quiet { margin-top: 8px; }

.hidden { display: none !important; }

/* ── toasts ───────────────────────────────────────────────────── */
.toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1200;
  display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 12px 16px; border-radius: 12px; font-size: .9rem;
  background: #10201e; border: 1px solid var(--line); color: var(--ink);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9);
  animation: toast-in .3s var(--ease);
  transition: opacity .35s, transform .35s;
}
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-success { border-color: rgba(61, 220, 166, .4); }
.toast-error { border-color: rgba(240, 138, 126, .5); }
.toast-action { color: var(--sky); font-weight: 600; white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ── footer ───────────────────────────────────────────────────── */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--line-soft); padding: 36px 28px 26px; background: rgba(0, 0, 0, .2); }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.footer-logo { margin-bottom: 8px; }
.footer-inner p { max-width: 360px; font-size: .9rem; }
.footer-links { display: grid; gap: 8px; align-content: start; font-size: .9rem; color: var(--ink-2); }
.footer-links a:hover { color: var(--sky); }
.footer-fine { max-width: 1200px; margin: 26px auto 0; font-size: .8rem; }

/* ── responsive ───────────────────────────────────────────────── */
.show-sm { display: none; }

@media (max-width: 1080px) {
  .hide-md { display: none; }
}

@media (max-width: 900px) {
  .product-page, .checkout-layout, .orders-layout { grid-template-columns: 1fr; gap: 24px; }
  .gallery, .summary { position: static; }
  .summary { order: -1; }
}

@media (max-width: 720px) {
  :root { --header-h: 112px; }
  .glass-header { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .logo span { display: none; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .header-actions { margin-left: auto; }
  .hide-sm { display: none; }
  .show-sm { display: inline-flex; }
  main { padding: 0 16px 56px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .shops-grid { grid-template-columns: 1fr; }
  .product-info { padding: 12px; }
  .product-title { font-size: .9rem; }
  .product-price { font-size: 1rem; }
  .wish-btn { width: 32px; height: 32px; top: 8px; right: 8px; }
  .slide-pane { max-width: none; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .panel { padding: 18px; }
  .filter-row { gap: 10px 14px; }
  .result-count { flex-basis: 100%; }
  .hero-search .btn-primary { padding: 10px 14px; }
  .timeline { font-size: .7rem; }
  .timeline li { font-size: .68rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > div:first-child { grid-column: span 2; }
  .site-footer { padding: 28px 16px 22px; }
  .track-form .btn-primary { width: 100%; }
}

@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .card:hover, .btn-primary:hover, .glass-btn:hover, .product-card:hover .product-image { transform: none; }
}
