/* ============================================================
   marketplace-redesign.css — BrickCapital Marketplace
   Premium e-commerce redesign of the #marketplace section on
   index.html. Loaded LAST in <head> so its rules win over
   styles.css. Presentation only — every filter/sort/pagination
   still runs through the untouched initMarketplace() engine, and
   every listing number comes from the real seed data. Only the
   markup INSIDE #marketplace is targeted; the hero above it and
   the shared nav/footer are never referenced here.
   ============================================================ */

/* reveal-on-scroll (scoped) */
.mkt-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.mkt-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .mkt-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* pull the section up a touch tighter under the trust row */
#marketplace .wrap { max-width: 1200px; }

/* ============================================================
   1 · CINEMATIC MARKETPLACE HERO
============================================================ */
.mkt-hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 26px; border: 1px solid var(--glass-border);
  margin: 6px 0 32px; padding: 50px 50px 46px;
  background:
    radial-gradient(680px 360px at 12% 0%, rgba(232,203,106,0.11), transparent 60%),
    radial-gradient(720px 420px at 96% 20%, rgba(0,113,227,0.09), transparent 62%),
    linear-gradient(165deg, #17171b 0%, #0f0f12 58%, #131317 100%),
    var(--near-black);
}
.mkt-hero-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask: radial-gradient(130% 100% at 78% 12%, #000 18%, transparent 76%);
  mask: radial-gradient(130% 100% at 78% 12%, #000 18%, transparent 76%);
}
.mkt-hero-glow {
  position: absolute; width: 440px; height: 440px; right: -90px; top: -140px;
  z-index: 0; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,39,0.15), transparent 68%);
  filter: blur(20px); animation: mktGlow 20s ease-in-out infinite;
}
@keyframes mktGlow { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-26px,22px) scale(1.09); } }
@media (prefers-reduced-motion: reduce) { .mkt-hero-glow { animation: none; } }

.mkt-hero-inner {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center;
}

/* reset the inherited .page-header look so our hero owns it */
.mkt-header { text-align: left; margin: 0; max-width: 640px; }
.mkt-header::after { display: none; }   /* hide styles.css underline; our own accent below */
.mkt-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono, monospace); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.11em; text-transform: uppercase; color: var(--gold-light);
}
.mkt-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-light); box-shadow: 0 0 8px rgba(232,203,106,0.85);
}
.mkt-header h2 {
  font-size: clamp(34px, 5vw, 58px); font-weight: 840; letter-spacing: -0.035em;
  line-height: 1.02; margin: 16px 0 0; color: #fff;
}
/* keep the "arrival" title animation happy — it targets .mkt-header h2 */
.mkt-header p {
  font-size: 15.5px; line-height: 1.6; color: var(--ink-soft);
  margin: 18px 0 0; max-width: 560px;
}
.mkt-trust { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.mkt-trust-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 640;
  color: var(--ink-soft); border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.045);
}
.mkt-trust-chip svg { width: 14px; height: 14px; color: var(--gold-light); }
/* 4th trust chip (Dispute resolution) shown only on mobile, where the upper
   home trust row is hidden and all four features live inside this card. */
.mkt-trust-chip--m { display: none; }

/* dashboard stat tiles */
.mkt-stats {
  display: grid; grid-template-columns: repeat(2, minmax(128px, 1fr));
  gap: 12px; min-width: 300px;
}
.mkt-stat {
  position: relative; overflow: hidden;
  border-radius: 16px; border: 1px solid var(--glass-border);
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.014));
  box-shadow: var(--shadow-md); padding: 16px 16px 15px;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.mkt-stat::before {
  content: ""; position: absolute; top: 0; left: 14px; right: 14px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent); opacity: 0.6;
}
.mkt-stat:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--shadow-hover); }
.mkt-stat .v { font-size: 25px; font-weight: 820; letter-spacing: -0.02em; line-height: 1.1; }
.mkt-stat .v small { font-size: 14px; color: var(--gold-light); font-weight: 700; }
.mkt-stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); margin-top: 4px; }
.mkt-stat.accent-gold .v { color: var(--gold-light); }
.mkt-stat.accent-green .v { color: #58cf90; }
.mkt-stat.accent-blue .v { color: #7db4e6; }

/* ============================================================
   2 · CATEGORY TABS (restyle the existing #categoryTabs)
============================================================ */
#marketplace .category-tabs {
  display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 22px; border: none; padding: 0;
}
#marketplace .category-tabs .tab-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 17px; border-radius: 12px; cursor: pointer;
  font-size: 13.5px; font-weight: 640; font-family: inherit;
  color: var(--ink-soft); background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
#marketplace .category-tabs .tab-btn .tab-icon { width: 17px; height: 17px; opacity: 0.85; }
#marketplace .category-tabs .tab-btn:hover { transform: translateY(-2px); border-color: var(--border-hover); background: var(--glass-bg-strong); color: var(--ink); }
#marketplace .category-tabs .tab-btn.active {
  color: #1c1608; background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-color: transparent; box-shadow: var(--shadow-glow-gold);
}
#marketplace .category-tabs .tab-btn.active .tab-icon { opacity: 1; }

/* ============================================================
   3 · TOOLBAR / COMMAND BAR
============================================================ */
.mkt-toolbar {
  display: flex; gap: 13px; align-items: center; flex-wrap: wrap;
  padding: 15px; margin: 0 0 22px;
  border-radius: 18px; border: 1px solid var(--glass-border);
  background: var(--glass-bg); box-shadow: var(--shadow-md);
  backdrop-filter: var(--glass-blur, blur(14px)); -webkit-backdrop-filter: var(--glass-blur, blur(14px));
}
.mkt-search {
  flex: 1 1 320px; min-width: 0; position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px; border-radius: 13px;
  background: var(--near-black); border: 1px solid var(--glass-border);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.mkt-search:focus-within { border-color: rgba(201,162,39,0.5); box-shadow: 0 0 0 3px rgba(201,162,39,0.14); }
.mkt-search .icon-svg { display: inline-flex; color: var(--ink-muted); flex-shrink: 0; }
.mkt-search .icon-svg svg { width: 18px; height: 18px; }
.mkt-search input {
  flex: 1; min-width: 0; border: none; background: none; outline: none;
  color: var(--ink); font-size: 14.5px; font-family: inherit;
}
.mkt-search input::placeholder { color: var(--ink-muted); }
.mkt-filters { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; }
.mkt-filters select {
  appearance: none; -webkit-appearance: none;
  padding: 13px 40px 13px 16px; border-radius: 13px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  color: var(--ink); background-color: var(--near-black);
  border: 1px solid var(--glass-border);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 15px;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.mkt-filters select:hover { border-color: var(--border-hover); }
.mkt-filters select:focus { outline: none; border-color: rgba(201,162,39,0.5); box-shadow: 0 0 0 3px rgba(201,162,39,0.14); }
/* a non-default theme/condition selection reads as gold, matching the
   active-filter chips — so the compact bar still signals active state */
.mkt-filters select.mkt-select-active {
  color: var(--gold-light);
  border-color: rgba(201,162,39,0.5);
  background-color: rgba(201,162,39,0.08);
}
.mkt-adv-btn { padding: 13px 20px !important; border-radius: 13px !important; }
/* the drawer toggle picks up an active look while the drawer is open
   (JS mirrors the drawer's .open state to aria-expanded on this button) */
.mkt-toolbar .mkt-adv-btn[aria-expanded="true"] {
  color: var(--gold-light);
  border-color: rgba(201,162,39,0.5);
  background: rgba(201,162,39,0.1);
}

/* FILTER DECLUTTER — the long theme-chip list (main.js still populates
   #themeChipRow, and its click handlers keep working) is collapsed out of
   the filter bar. Themes are reachable only through the "All themes"
   <select> and the advanced-filter drawer, so the bar stays compact.
   Kept out of the layout entirely rather than visually hidden so it never
   reserves space or catches pointer/tab focus. */
.mkt-themerow,
#themeChipRow { display: none !important; }

/* active filter chips (main.js populates #activeFilterChips) */
.mkt-active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 16px; }
.mkt-active-chips .filter-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 8px 6px 13px; border-radius: 999px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  color: var(--ink); background: rgba(201,162,39,0.1); border: 1px solid rgba(201,162,39,0.32);
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.mkt-active-chips .filter-chip:hover { background: rgba(201,162,39,0.18); border-color: rgba(201,162,39,0.5); }
.mkt-active-chips .filter-chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%; font-size: 14px; line-height: 1;
  background: rgba(255,255,255,0.08); color: var(--ink-soft);
}
.mkt-active-chips .filter-chip-clear-all { color: var(--ink-muted); background: none; border-color: var(--line-soft); padding: 6px 13px; }
.mkt-active-chips .filter-chip-clear-all:hover { color: var(--ink); background: var(--glass-bg-strong); }

/* ============================================================
   4 · RESULTS BAR
============================================================ */
.mkt-resultsbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin: 6px 0 22px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line-soft);
}
#marketplace .results-count {
  font-size: 14px; font-weight: 640; color: var(--ink-soft); margin: 0;
}
#marketplace .results-count::first-line { color: var(--ink); }
.mkt-sortwrap { display: inline-flex; align-items: center; gap: 9px; }
.mkt-sortlabel { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); font-weight: 700; }
.mkt-sortwrap select {
  appearance: none; -webkit-appearance: none;
  padding: 10px 34px 10px 14px; border-radius: 12px; cursor: pointer;
  font-size: 13px; font-weight: 640; font-family: inherit;
  color: var(--ink); background-color: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
  transition: border-color .18s var(--ease);
}
.mkt-sortwrap select:hover { border-color: var(--border-hover); }
.mkt-sortwrap select:focus { outline: none; border-color: rgba(201,162,39,0.5); box-shadow: 0 0 0 3px rgba(201,162,39,0.14); }

/* ============================================================
   5 · PREMIUM GRID + LISTING CARD
   Markup produced by the window.listingCardHTML override; classes
   keep .card / .thumb / .wishlist-btn / .badge so existing handlers
   + paintAllThumbs still work, .mkt-card carries the new design.
============================================================ */
.mkt-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 18px; margin: 0 0 8px;
}
.mkt-card {
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none;
  border-radius: 20px; border: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012));
  box-shadow: var(--shadow-md); color: var(--ink);
  transition: transform .32s var(--ease-out), border-color .32s var(--ease-out), box-shadow .32s var(--ease-out);
  will-change: transform;
}
.mkt-card:hover { transform: translateY(-6px); border-color: var(--border-hover); box-shadow: var(--shadow-hover); }
.mkt-card.card-rare { border-color: rgba(201,162,39,0.4); }
.mkt-card.card-rare:hover { box-shadow: var(--shadow-glow-gold); }

/* card stagger-in on render */
.mkt-card-in { opacity: 0; transform: translateY(14px); animation: mktCardIn .5s var(--ease-out) forwards; }
@keyframes mktCardIn { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mkt-card-in { opacity: 1; transform: none; animation: none; } }

.mkt-card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.mkt-card-media .thumb { width: 100%; height: 100%; display: block; transition: transform .5s var(--ease-out); }
.mkt-card:hover .mkt-card-media .thumb { transform: scale(1.05); }
.mkt-card-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(9,9,11,0.28) 0%, transparent 32%, transparent 62%, rgba(9,9,11,0.5) 100%);
}
/* Badge system — one emphasized primary condition badge + quieter
   secondary attribute chips. A wrapping flex row (never a stack) with a
   consistent gap guarantees badges never overlap and reflow cleanly on
   narrow cards. `right` reserves the wishlist button's corner so a long
   condition label wraps under it instead of colliding. */
.mkt-card-badges {
  position: absolute; top: 11px; left: 11px; right: 56px; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start;
}
.mkt-card-badges .badge {
  position: static; top: auto; left: auto;
  display: inline-flex; align-items: center; border-radius: 999px;
  letter-spacing: 0.02em; white-space: nowrap; line-height: 1.1;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
/* primary: solid, higher contrast, carries the most weight */
.mkt-card-badges .badge-primary {
  padding: 5px 11px; font-size: 11px; font-weight: 800;
  color: var(--ink); background: rgba(20,20,24,0.82); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.mkt-card-badges .badge-primary.new { color: #6bd79c; border-color: rgba(30,142,90,0.55); background: rgba(16,42,30,0.86); }
.mkt-card-badges .badge-primary.parts { color: var(--gold-light); border-color: rgba(201,162,39,0.5); background: rgba(46,38,12,0.84); }
/* secondary: smaller, dimmer, recede behind the primary badge */
.mkt-card-badges .badge-sec {
  padding: 3px 9px; font-size: 10px; font-weight: 700;
  color: var(--ink-soft); background: rgba(16,16,20,0.66); border: 1px solid var(--line-soft);
}
.mkt-card-badges .badge-sec.badge-retired { color: #93c2ea; border-color: rgba(0,113,227,0.42); }
.mkt-card-badges .badge-sec.badge-rare { color: var(--gold-light); border-color: rgba(201,162,39,0.42); }
.mkt-card-badges .badge-sec.badge-minifig { color: var(--ink-soft); border-color: var(--line-soft); }
.mkt-card-badges .badge-sec.badge-more { color: var(--ink-muted); background: rgba(16,16,20,0.58); }

.mkt-card .wishlist-btn {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--glass-border); background: rgba(16,16,20,0.66);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.mkt-card .wishlist-btn:hover { transform: scale(1.1); background: rgba(16,16,20,0.85); border-color: var(--border-hover); }
.mkt-card .wishlist-btn svg { width: 18px; height: 18px; }
.mkt-card .wishlist-btn.saved { background: rgba(217,30,54,0.9); border-color: transparent; }

/* hover quick-view spec chips */
.mkt-card-quick {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 5px; padding: 12px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.mkt-card:hover .mkt-card-quick, .mkt-card:focus-within .mkt-card-quick { opacity: 1; transform: none; }
.mkt-card-quick span {
  font-size: 10.5px; font-weight: 640; padding: 4px 9px; border-radius: 8px;
  color: var(--ink); background: rgba(16,16,20,0.78); border: 1px solid var(--line-soft);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
@media (prefers-reduced-motion: reduce) {
  .mkt-card-quick { transition: none; }
  .mkt-card-media .thumb, .mkt-card { transition: border-color .2s, box-shadow .2s; }
  .mkt-card:hover { transform: none; }
  .mkt-card:hover .mkt-card-media .thumb { transform: none; }
}

.mkt-card-body { display: flex; flex-direction: column; gap: 4px; padding: 15px 16px 16px; flex: 1; }
.mkt-card-theme { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold-light); }
.mkt-card-title {
  font-size: 15px; font-weight: 740; letter-spacing: -0.01em; line-height: 1.32; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mkt-card-metrow { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 3px; font-size: 11.5px; color: var(--ink-muted); }
.mkt-card-metrow span { display: inline-flex; align-items: center; gap: 4px; }
.mkt-card-metrow .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.mkt-card-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 12px;
}
.mkt-card-pricewrap { display: flex; flex-direction: column; gap: 1px; }
.mkt-card-price { font-size: 20px; font-weight: 820; letter-spacing: -0.02em; color: #fff; }
.mkt-card-ppp { font-size: 10.5px; color: var(--ink-muted); font-weight: 600; }
.mkt-card-seller { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; min-width: 0; }
.mkt-card-seller-name { font-size: 12px; color: var(--ink-soft); max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkt-card-rating { font-size: 11.5px; font-weight: 700; color: var(--gold-light); }
.mkt-card .verified-pill { margin-top: 8px; align-self: flex-start; }

/* ============================================================
   SIMPLIFIED CARD — image-first, essentials only (overrides above)
   Hierarchy: image → title → price → seller. One small condition
   indicator; everything else lives on the listing detail page.
============================================================ */
/* give the image more presence */
.mkt-card-media { aspect-ratio: 1 / 1; }
/* single, subtle condition indicator (top-left) */
.mkt-card-media .mkt-cond {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: inline-flex; align-items: center;
  padding: 5px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em; line-height: 1; white-space: nowrap;
  color: var(--ink); background: rgba(14,14,18,0.68);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.06);
}
.mkt-card-media .mkt-cond.new { color: #6bd79c; border-color: rgba(30,142,90,0.5); }
.mkt-card-media .mkt-cond.parts { color: var(--gold-light); border-color: rgba(201,162,39,0.45); }
.mkt-card-media .mkt-cond.used { color: var(--ink-soft); }

/* more air in the body; clear type hierarchy */
.mkt-card-body { gap: 7px; padding: 16px 17px 17px; }
.mkt-card-theme { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; color: var(--gold-light); opacity: 0.92; }
.mkt-card-title {
  font-size: 16px; font-weight: 760; line-height: 1.32; color: #fff;
  -webkit-line-clamp: 2; min-height: calc(1.32em * 2);
}
.mkt-card-foot {
  align-items: center; gap: 12px; margin-top: 8px; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.mkt-card-price { font-size: 21px; font-weight: 820; letter-spacing: -0.02em; color: #fff; }
.mkt-card-seller { align-items: flex-end; gap: 3px; }
.mkt-card-seller-name { font-size: 12px; color: var(--ink-muted); max-width: 130px; }
.mkt-card-rating { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--gold-light); }

/* ── Mobile card foot: stack so price + seller never overlap ──────────────
   On narrow cards (2-col and 1-col grids ≤680px) the price and the seller
   block share too little width to sit side-by-side, so long names / large
   prices ($12,999.99) collided. Fix: put the price on its own line, then a
   dedicated row with the seller name (flexes + truncates) and the rating
   (pinned right, never pushed out). Pure flow — no fixed positioning.
   Desktop (>680px) keeps the original side-by-side foot. Shared .mkt-card,
   so this also covers Saved, Wishlist, Related, and Recently-viewed. */
/* Selectors are prefixed with .mkt-card (specificity 0,2,0) so they beat the
   later single-class .mkt-card-foot rules in this file regardless of order. */
@media (max-width: 680px) {
  .mkt-card .mkt-card-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .mkt-card .mkt-card-price { text-align: left; }
  .mkt-card .mkt-card-seller {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    text-align: left;
  }
  .mkt-card .mkt-card-seller-name {
    flex: 1 1 auto;
    min-width: 0;          /* allow the name to shrink so it can truncate */
    max-width: none;       /* flex + min-width:0 now control the width */
    /* overflow:hidden / text-overflow:ellipsis / white-space:nowrap inherited */
  }
  .mkt-card .mkt-card-rating {
    flex: 0 0 auto;        /* rating keeps its size and stays inside the card */
    white-space: nowrap;
  }
}

/* ============================================================
   PREMIUM CRAFTSMANSHIP — luxurious cards in the Market Intelligence
   gold-glass design language. Visual only; same info + layout.
============================================================ */
.mkt-grid { gap: 20px; }

/* card construction: gradient glass border + layered depth */
.mkt-card {
  position: relative; border-radius: 22px; border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.062), rgba(255,255,255,0.014)) padding-box,
    linear-gradient(150deg, rgba(255,255,255,0.24), rgba(255,255,255,0.03) 48%, rgba(201,162,39,0.16)) border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 20px 44px rgba(0,0,0,0.36), 0 4px 12px rgba(0,0,0,0.28);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.mkt-card:hover {
  transform: translateY(-8px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.09), 0 36px 74px rgba(0,0,0,0.5), 0 12px 26px rgba(0,0,0,0.34), 0 0 46px rgba(201,162,39,0.15);
}
.mkt-card.card-rare:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 36px 74px rgba(0,0,0,0.5), 0 0 56px rgba(201,162,39,0.26); }
/* tactile press — a quick settle from the hover lift before navigation.
   Declared after :hover so it wins while the pointer is held down. */
.mkt-card:active { transform: translateY(-3px) scale(0.992); transition-duration: .12s; }

/* soft light sweep across the whole surface on hover */
.mkt-card::before {
  content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: inherit;
  background: linear-gradient(100deg, transparent 34%, rgba(255,255,255,0.12) 46%, rgba(255,255,255,0.02) 52%, transparent 64%);
  background-size: 250% 100%; background-repeat: no-repeat; background-position: 165% 0;
  opacity: 0; transition: opacity .25s var(--ease);
}
.mkt-card:hover::before { opacity: 1; animation: mktSheen 1.15s var(--ease-out); }
@keyframes mktSheen { from { background-position: 165% 0; } to { background-position: -95% 0; } }

/* image: immersive depth + slow luxurious zoom */
.mkt-card-media { aspect-ratio: 1 / 1; }
.mkt-card-media::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(130% 90% at 50% -8%, rgba(255,255,255,0.10), transparent 44%),
    radial-gradient(150% 130% at 50% 120%, rgba(6,6,9,0.42), transparent 58%);
}
.mkt-card-shade { background: linear-gradient(180deg, rgba(9,9,11,0.2) 0%, transparent 30%, transparent 66%, rgba(6,6,9,0.42) 100%); }
.mkt-card-media .thumb { transition: transform 1.05s cubic-bezier(0.16,1,0.3,1); }
.mkt-card:hover .mkt-card-media .thumb { transform: scale(1.075); }

/* floating controls: refined glass + micro-interactions */
.mkt-card-media .mkt-cond { z-index: 3; top: 13px; left: 13px; box-shadow: 0 6px 16px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.08); }
.mkt-card .wishlist-btn {
  z-index: 4; top: 12px; right: 12px; width: 40px; height: 40px;
  background: rgba(12,12,16,0.5); border-color: rgba(255,255,255,0.14);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform .3s var(--ease-out), background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.mkt-card:hover .wishlist-btn { background: rgba(14,14,18,0.62); }
.mkt-card .wishlist-btn:hover { transform: scale(1.12); border-color: rgba(201,162,39,0.55); box-shadow: 0 8px 20px rgba(0,0,0,0.4), 0 0 18px rgba(201,162,39,0.22); }
.mkt-card .wishlist-btn:active { transform: scale(0.94); }
.mkt-card .wishlist-btn.saved { background: linear-gradient(150deg, #e0455e, #c01f38); border-color: transparent; box-shadow: 0 8px 20px rgba(217,30,54,0.4); }

/* body: refined MI-language hierarchy */
.mkt-card-body { gap: 8px; padding: 17px 18px 18px; }
.mkt-card-theme {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--gold-light);
}
.mkt-card-theme::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 7px rgba(232,203,106,0.8); flex: none; }
.mkt-card-title {
  font-size: 16px; font-weight: 740; line-height: 1.34; letter-spacing: -0.012em; color: #f4f2ee;
  transition: color .3s var(--ease);
}
.mkt-card:hover .mkt-card-title { color: #fff; }
.mkt-card-foot { align-items: center; gap: 12px; margin-top: 10px; padding-top: 15px; position: relative; border-top: none; }
.mkt-card-foot::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.mkt-card-price { font-size: 21px; font-weight: 800; letter-spacing: -0.025em; color: #fff; font-variant-numeric: tabular-nums; }
.mkt-card-seller-name { font-size: 12px; color: var(--ink-muted); }
.mkt-card-rating svg { filter: drop-shadow(0 0 5px rgba(232,203,106,0.4)); }

@media (prefers-reduced-motion: reduce) {
  .mkt-card, .mkt-card-media .thumb, .mkt-card .wishlist-btn, .mkt-card-title { transition: none; }
  .mkt-card:hover, .mkt-card:active { transform: none; }
  .mkt-card:hover::before { animation: none; opacity: 0; }
  .mkt-card:hover .mkt-card-media .thumb { transform: none; }
}

/* ============================================================
   5b · EMPTY / NO-RESULTS STATE
   main.js drops a single .empty-state into the auto-fill grid;
   without spanning it would collapse into one narrow column.
   Span it full width and give it an intentional glass panel.
============================================================ */
#marketplace .mkt-grid .empty-state {
  grid-column: 1 / -1;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
  padding: 60px 28px;
}
#marketplace .mkt-grid .empty-state p { color: var(--ink-soft); }
#marketplace .mkt-grid .empty-state .empty-state-icon { color: var(--gold-light); opacity: 0.65; }
@media (max-width: 430px) {
  #marketplace .mkt-grid .empty-state { padding: 44px 20px; }
}

/* ============================================================
   5c · SKELETON LOADING STATE
   Injected by marketplace-redesign.js before the real render lands.
   Mirrors the card silhouette (media block + stacked text lines) so
   the layout doesn't shift when content swaps in. Shimmer + reduced-
   motion handling come from .bc-skel in transform.css.
============================================================ */
.mkt-skel-card {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 22px; border: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
}
/* match the live card's square media so the swap-in causes no layout shift */
.mkt-skel-media { aspect-ratio: 1 / 1; width: 100%; border-radius: 0; }
.mkt-skel-body { padding: 16px; }
.mkt-skel-body .bc-skel-line { margin: 0 0 10px; }
.mkt-skel-body .bc-skel-line.lg { width: 82%; }
.mkt-skel-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.mkt-skel-foot .bc-skel-line { margin: 0; }

/* ============================================================
   6 · LOAD MORE
============================================================ */
.load-more-wrap { text-align: center; margin: 22px 0 4px; }
.mkt-loadmore { padding: 13px 28px !important; border-radius: 14px !important; font-weight: 640; }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 900px) {
  .mkt-hero-inner { grid-template-columns: 1fr; gap: 26px; }
  .mkt-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 0; }
}
@media (max-width: 680px) {
  .mkt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mkt-toolbar { padding: 12px; }
  .mkt-filters { width: 100%; }
  .mkt-filters select { flex: 1 1 auto; min-width: 0; }
  .mkt-adv-btn { flex: 1 1 100%; }
  .mkt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 430px) {
  .mkt-grid { grid-template-columns: 1fr; }
  .mkt-resultsbar { border-bottom: none; padding-bottom: 4px; }
}

/* ── Mobile compression pass ── (mobile only; desktop untouched)
   One compact marketplace card: no description paragraph, all four trust
   features here, and a much shorter hero so filters/search/listings sit
   higher on the first screen. */
@media (max-width: 768px) {
  /* Dense-but-premium hero: same visual style, ~40% shorter so listings
     arrive much sooner. All four trust chips kept — tightened so they pack
     two-per-row instead of stacking, which is the biggest height saving.
     [Marketplace hero height-reduction pass] */
  .mkt-hero {
    padding: 21px 19px 21px;
    margin: 0 0 13px;
    border-radius: 18px;
  }
  .mkt-hero-inner { gap: 16px; }
  /* the hero card supplies its own padding — drop the inherited .page-header
     padding (64px/36px) that was silently adding ~100px of dead height */
  .mkt-header { max-width: none; padding: 0; }
  .mkt-eyebrow { font-size: 11px; }
  .mkt-header h2 { font-size: 24px; margin-top: 8px; }
  .mkt-header p { display: none; }              /* remove duplicate description */
  .mkt-trust { margin-top: 15px; gap: 7px; }
  .mkt-trust-chip--m { display: inline-flex; }  /* reveal Dispute resolution */
  /* smaller chips so all four sit two-per-row → far less vertical space */
  .mkt-trust-chip { padding: 6px 10px; font-size: 11.5px; gap: 6px; }
  .mkt-trust-chip svg { width: 13px; height: 13px; }
  /* tight, intentional gap above the Sell button (stats hidden on mobile) */
  .mkt-sell-mobile { margin-top: 7px; padding-top: 10px; padding-bottom: 10px; }
  /* transition into the category chips feels connected, not disconnected */
  #marketplace .category-tabs { margin-top: 0; margin-bottom: 14px; }
  .mkt-toolbar { margin-bottom: 14px; }
  .mkt-resultsbar { margin: 4px 0 14px; padding-bottom: 12px; }
}

/* ============================================================
   CARD SYSTEM ALIGNMENT
   The premium listing card is the canonical reference and is left
   untouched. Two lighter cards in this section are brought up to the
   same gradient-glass language for one consistent system: the hero
   dashboard stat tiles and the recently-viewed preview cards.
============================================================ */
/* dashboard stat tiles — gradient glass border + smooth gold-warm hover */
.mkt-stat {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.014)) padding-box,
    linear-gradient(150deg, rgba(255,255,255,0.22), rgba(255,255,255,0.03) 48%, rgba(201,162,39,0.14)) border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 40px rgba(0,0,0,0.34), 0 3px 10px rgba(0,0,0,0.26);
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), background .45s var(--ease);
}
.mkt-stat:hover {
  transform: translateY(-5px); border-color: transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.02)) padding-box,
    linear-gradient(150deg, rgba(201,162,39,0.5), rgba(255,255,255,0.06) 52%, rgba(201,162,39,0.28)) border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.09), 0 30px 60px rgba(0,0,0,0.46), 0 8px 20px rgba(0,0,0,0.3), 0 0 40px rgba(201,162,39,0.13);
}

/* recently-viewed preview cards (shared .recent-card, scoped to this
   section so the component is unchanged elsewhere) */
#marketplace .recent-card {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.012)) padding-box,
    linear-gradient(150deg, rgba(255,255,255,0.2), rgba(255,255,255,0.03) 50%, rgba(201,162,39,0.12)) border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow-sm);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), background .4s var(--ease);
}
#marketplace .recent-card:hover {
  transform: translateY(-4px); border-color: transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.066), rgba(255,255,255,0.018)) padding-box,
    linear-gradient(150deg, rgba(201,162,39,0.44), rgba(255,255,255,0.05) 52%, rgba(201,162,39,0.22)) border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 16px 34px rgba(0,0,0,0.34), 0 0 30px rgba(201,162,39,0.1);
}
#marketplace .recent-card .rc-title { font-weight: 700; letter-spacing: -0.005em; color: var(--ink); }
#marketplace .recent-strip-head h3 { font-weight: 740; letter-spacing: -0.01em; }

@media (prefers-reduced-motion: reduce) {
  .mkt-stat, #marketplace .recent-card { transition: none; }
  .mkt-stat:hover, #marketplace .recent-card:hover { transform: none; }
}

/* ============================================================
   PROFILE MATERIAL — final alignment layer (wins by source order)
   The earlier "premium craftsmanship" passes gave the listing cards,
   hero stat tiles and recently-viewed cards gold-tinted gradient
   BORDERS, heavy stacked float shadows, colored hover GLOWS and a
   full-surface light sweep. This block tempers all of that to the
   exact Profile benchmark material: a neutral translucent smoked-
   glass surface, a near-invisible WHITE-translucent border, a soft
   inset TOP-LIGHT reflection and a single soft ambient shadow. Gold
   survives ONLY as small highlights (eyebrow dot, the condition
   pill, icon accents, a faint hover warmth). Presentation only — no
   markup, IDs, data flows or layout change. Reuses :root tokens.
   ============================================================ */

/* --- LISTING CARD: neutral dark glass, white hairline border, top-light --- */
.mkt-card {
  border: 1px solid var(--glass-border);
  background: linear-gradient(155deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform .32s var(--ease-out), border-color .32s var(--ease-out), box-shadow .32s var(--ease-out);
}
.mkt-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255,255,255,0.08);
}
/* retire the full-surface white sheen — the card now reads via material + light */
.mkt-card::before { display: none; }
/* rare/lead card: only a WHISPER of gold on the surface + a faint hover ambient */
.mkt-card.card-rare {
  border-color: rgba(201,162,39,0.24);
  background: linear-gradient(150deg, rgba(201,162,39,0.06), rgba(255,255,255,0.02) 60%);
}
.mkt-card.card-rare:hover {
  border-color: rgba(201,162,39,0.34);
  box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255,255,255,0.08), 0 0 30px rgba(201,162,39,0.10);
}

/* --- HERO STAT TILES: same neutral glass + top-light, gentle hover --- */
.mkt-stat {
  border: 1px solid var(--glass-border);
  background: linear-gradient(155deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.mkt-stat:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: linear-gradient(155deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* --- RECENTLY-VIEWED CARDS: neutral glass, no gold border/glow --- */
#marketplace .recent-card {
  border: 1px solid var(--glass-border);
  background: linear-gradient(155deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.05);
}
#marketplace .recent-card:hover {
  border-color: var(--border-hover);
  background: linear-gradient(155deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255,255,255,0.07);
}

/* --- TOOLBAR: add the soft inset top-light so it reads as one lit object --- */
.mkt-toolbar { box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.06); }

/* --- WISHLIST BUTTON: keep the small control, soften the gold hover glow --- */
.mkt-card .wishlist-btn:hover {
  border-color: rgba(201,162,39,0.4);
  box-shadow: 0 8px 20px rgba(0,0,0,0.34), 0 0 14px rgba(201,162,39,0.12);
}

@media (prefers-reduced-motion: reduce) {
  .mkt-card, .mkt-stat, #marketplace .recent-card { transition: none; }
  .mkt-card:hover, .mkt-stat:hover, #marketplace .recent-card:hover { transform: none; }
}

/* ============================================================
   MI-BENCHMARK ALIGNMENT — Marketplace (Warm Gold / Orange)
   Wins by source order. Brings every marketplace card up to the
   Market Intelligence card material: a solid, hue-tinted graphite
   FLOOR (weight + depth, not an airy wash), an accent-woven
   hairline border painted via border-box, the exact MI layered
   shadow stack (inset top-light + deep ambient + tight contact),
   an 18px radius, and a long ease-out lift on hover with a faint
   accent ambient. Accent (gold/orange) appears ONLY in the border
   weave, icon/indicator highlights and hover ambient — never as a
   flat fill. Presentation only: no markup, IDs, data or layout
   change. The image-first card structure is preserved exactly.
============================================================ */
#marketplace .mkt-card,
#marketplace .mkt-stat,
#marketplace .recent-card {
  border: 1px solid transparent;
  border-radius: var(--radius-m);
  background:
    radial-gradient(120% 85% at 50% 125%, rgba(224,170,60,0.30), rgba(224,170,60,0.07) 42%, transparent 68%) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.013)) padding-box,
    linear-gradient(150deg, rgba(255,255,255,0.20), rgba(255,255,255,0.03) 50%, rgba(201,162,39,0.16)) border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 40px rgba(0,0,0,0.34), 0 3px 10px rgba(0,0,0,0.26);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), background .4s var(--ease);
}
#marketplace .mkt-card:hover,
#marketplace .mkt-stat:hover,
#marketplace .recent-card:hover {
  transform: translateY(-3px);
  border-color: transparent;
  background:
    radial-gradient(120% 92% at 50% 125%, rgba(224,170,60,0.42), rgba(224,170,60,0.10) 44%, transparent 70%) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015)) padding-box,
    linear-gradient(150deg, rgba(255,255,255,0.24), rgba(255,255,255,0.04) 50%, rgba(201,162,39,0.24)) border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 22px 46px rgba(0,0,0,0.40), 0 0 32px rgba(201,162,39,0.10);
}
/* lead/rare card keeps a touch more warmth in its border weave */
#marketplace .mkt-card.card-rare {
  background:
    radial-gradient(120% 88% at 50% 125%, rgba(224,170,60,0.36), rgba(224,170,60,0.09) 42%, transparent 68%) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.013)) padding-box,
    linear-gradient(150deg, rgba(255,255,255,0.20), rgba(255,255,255,0.03) 50%, rgba(201,162,39,0.22)) border-box;
}
/* image media keeps its own top corners flush inside the new radius */
#marketplace .mkt-card .mkt-card-media { border-radius: 0; }
/* CINEMATIC IMAGE DISSOLVE — the MI signature: the product photo's lower
   edge melts into the card's warm graphite FLOOR (same top colour, 30,26,18)
   with a faint gold top-light, so image → body reads as one continuous lit
   object instead of a hard photo block above a strip. */
#marketplace .mkt-card .mkt-card-shade {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 24%),
    linear-gradient(180deg, transparent 48%, rgba(18,18,21,0.55) 80%, #17171b 100%);
}
/* stat value + price: MI weight/rhythm (tabular, tight) */
#marketplace .mkt-stat .v,
#marketplace .mkt-card-price { font-weight: 800; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
/* eyebrow dot reads as a lit accent indicator (matches MI) */
#marketplace .mkt-card-theme::before { box-shadow: 0 0 8px rgba(232,203,106,0.85); }
/* wishlist control: accent-tinted lit chip on hover, MI-style */
#marketplace .mkt-card .wishlist-btn:hover {
  border-color: rgba(232,203,106,0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 8px 20px rgba(0,0,0,0.36), 0 0 18px rgba(201,162,39,0.18);
}
@media (prefers-reduced-motion: reduce) {
  #marketplace .mkt-card, #marketplace .mkt-stat, #marketplace .recent-card { transition: none; }
  #marketplace .mkt-card:hover, #marketplace .mkt-stat:hover, #marketplace .recent-card:hover { transform: none; }
}
