/* ==========================================================================
   Project Rocks — visual design layer
   Loaded after brand.css. Uses the single Boulderix palette tokens (--brand-*).
   design-system.css supplies the shared typography and layout contract.
   Open-source stack only.
   ========================================================================== */

:root {
  --font-display: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --surface-2: #ffffff;
  --muted: #626b7a;
  --line: rgba(17, 24, 39, 0.08);
  --radius-sm: 0.6rem;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --shadow-1: 0 1px 2px rgba(17, 24, 39, .05), 0 1px 3px rgba(17, 24, 39, .06);
  --shadow-2: 0 10px 30px -12px rgba(17, 24, 39, .22);
  --ring: 0 0 0 3px rgba(var(--brand-primary-rgb, 30, 58, 138), .25);
  --container: 1200px;
}

:root[data-bs-theme="dark"] {
  --surface-2: #1b2026;
  --muted: #a5abb4;
  --line: rgba(255, 255, 255, .09);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, .7);
}

/* --- Base ---------------------------------------------------------------- */
body.layout-fluid { font-family: var(--brand-font, var(--font-body)); }
h1, h2, h3, h4, h5, .display-5, .display-6, .page-title, .card-title {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.page-title { font-weight: 700; }

/* Branded page hero: every page header follows the home-page concept. Pages with
   their own banner (vendor storefront) or the staff console opt out via
   ``.page-header--bare``. */
.page-header:not(.page-header--bare) {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  background-image: linear-gradient(135deg, rgba(var(--brand-primary-rgb), .12), rgba(var(--brand-accent-rgb), .12));
  box-shadow: var(--shadow-1);
}
.page-header:not(.page-header--bare) .page-title { margin-bottom: .25rem; }
.page-header:not(.page-header--bare) .text-secondary { max-width: 70ch; }
.section { margin-block: 3rem; }
.section-title { font-weight: 700; font-size: 1.5rem; margin-bottom: .25rem; }
.section-sub { color: var(--muted); margin-bottom: 1.25rem; }

/* Distinct divider between the home page's stacked sections/rows. */
.section-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
  opacity: 1;
  background: linear-gradient(90deg, transparent, rgba(var(--brand-primary-rgb), .35), transparent);
  height: 1px;
}
.container-xl { max-width: var(--container); }
.text-secondary { color: var(--muted) !important; }

/* --- Top navigation ------------------------------------------------------ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  backdrop-filter: saturate(160%) blur(10px);
  background: color-mix(in srgb, var(--brand-surface) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.navbar-brand { font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em; }
.navbar .nav-link { font-weight: 600; border-radius: var(--radius-sm); padding-inline: .65rem; }
.navbar .nav-link:hover { background: rgba(var(--brand-primary-rgb, 0,0,0), .08); }
.nav-search {
  flex: 1; max-width: 520px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .45rem .9rem;
}
.nav-search input { border: 0; background: transparent; outline: none; width: 100%; }

/* --- Buttons ------------------------------------------------------------- */
.btn-brand {
  background-image: linear-gradient(135deg, var(--brand-primary), var(--brand-accent)) !important;
  border: 0 !important; color: #fff !important; font-weight: 700;
  border-radius: 999px; box-shadow: var(--shadow-1);
  /* Grow every size uniformly: Bootstrap exposes per-size padding vars, so a
     fixed multiplier adds ~30% without hard-coding .btn / .btn-sm / .btn-lg. */
  padding: calc(var(--bs-btn-padding-y, .375rem) * 1.3) calc(var(--bs-btn-padding-x, .75rem) * 1.3);
  transition: filter .18s ease, box-shadow .18s ease, transform .18s ease;
}
/* Rollover: darken the gradient, deepen the shadow, and lift slightly. */
.btn-brand:hover,
.btn-brand:focus-visible {
  filter: brightness(.9) saturate(1.05);
  box-shadow: var(--shadow-2);
  color: #fff !important;
}
@media (prefers-reduced-motion: no-preference) {
  .btn-brand:hover,
  .btn-brand:focus-visible { transform: translateY(-2px); }
}
.btn-brand:active { filter: brightness(.85); transform: translateY(0); }
/* Dark mode: a solid fill, not the light gradient (whose light end loses
   boundary contrast on the dark surface), with a thin accent border. */
:root[data-bs-theme="dark"] .btn-brand {
  background-image: none !important;
  background-color: var(--brand-btn-fill) !important;
  border: 1px solid var(--brand-accent) !important;
}
:root[data-bs-theme="dark"] .btn-brand:hover,
:root[data-bs-theme="dark"] .btn-brand:focus-visible { filter: brightness(1.08); }
.btn-pill { border-radius: 999px; }
.btn-outline-secondary { border-radius: 999px; }

/* --- Hero ---------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 4rem);
  color: #fff;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(var(--brand-fill-2-rgb, 29,78,216), .55), transparent 55%),
    radial-gradient(120% 120% at 100% 20%, rgba(var(--brand-fill-rgb, 30,58,138), .75), transparent 60%),
    var(--brand-deep);
}
.hero h1 { font-weight: 800; line-height: 1.05; }
.hero .hero-search {
  display: flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.96); color: #111;
  border-radius: 999px; padding: .5rem .5rem .5rem 1.1rem;
  box-shadow: var(--shadow-2); max-width: 560px;
}
.hero .hero-search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 1.05rem; }
.hero .stat { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; }
.hero .stat-label { opacity: .85; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.hero-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  color: #fff; border-radius: 999px; padding: .35rem .8rem; font-size: .85rem; font-weight: 600;
  text-decoration: none;
}
.hero-chip:hover { background: rgba(255,255,255,.28); color: #fff; }

/* --- Category tiles ------------------------------------------------------ */
.tile {
  display: block; border-radius: var(--radius); padding: 1.25rem;
  color: #fff; text-decoration: none; height: 100%;
  border: 0; box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); color: #fff; }
.tile .tile-icon { font-size: 1.6rem; }
.tile .tile-name { font-family: var(--font-display); font-weight: 700; margin-top: .5rem; }
.tile .tile-sub { opacity: .85; font-size: .8rem; }
.tile-1 { background-image: linear-gradient(135deg, var(--brand-fill), color-mix(in oklab, var(--brand-fill), var(--brand-fill-2) 0%)); }
.tile-2 { background-image: linear-gradient(135deg, var(--brand-fill), color-mix(in oklab, var(--brand-fill), var(--brand-fill-2) 20%)); }
.tile-3 { background-image: linear-gradient(135deg, var(--brand-fill), color-mix(in oklab, var(--brand-fill), var(--brand-fill-2) 40%)); }
.tile-4 { background-image: linear-gradient(135deg, var(--brand-fill), color-mix(in oklab, var(--brand-fill), var(--brand-fill-2) 60%)); }
.tile-5 { background-image: linear-gradient(135deg, var(--brand-fill), color-mix(in oklab, var(--brand-fill), var(--brand-fill-2) 80%)); }

/* --- Product card -------------------------------------------------------- */
.specimen-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2);
  box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.specimen-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: transparent; }
.specimen-card .specimen-thumb,
.specimen-card img { transition: transform .35s ease; }
.specimen-card:hover img { transform: scale(1.06); }
.specimen-card .thumb-wrap { position: relative; overflow: hidden; }
.specimen-card .sale-flag {
  position: absolute; top: .6rem; left: .6rem;
  background: linear-gradient(135deg, #ef4444, #f97316); color: #fff;
  border-radius: 999px; padding: .15rem .6rem; font-size: .72rem; font-weight: 700;
}
.specimen-card .card-body { padding: .9rem 1rem 1rem; }
.specimen-card .price-tag { font-family: var(--font-display); font-weight: 800; }
.specimen-card .vendor-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-primary); display: inline-block; margin-right: .35rem; }
/* Home: New arrivals images are half the height of catalog cards. */
.home-new-arrivals .specimen-thumb { aspect-ratio: 2 / 1; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  background: rgba(var(--brand-primary-rgb, 0,0,0), .08); color: var(--brand-primary);
  border-radius: 999px; padding: .2rem .6rem; font-size: .75rem; font-weight: 600; text-decoration: none;
}

/* --- Detail / buy box ---------------------------------------------------- */
.buy-box { position: sticky; top: 84px; }
.price-hero { font-family: var(--font-display); font-weight: 800; font-size: 2rem; }
.detail-title { font-family: var(--font-display); font-weight: 800; letter-spacing: -.01em; }
.trust-row { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.trust-row i { color: var(--brand-accent); }

/* Grouped capability sections in the buy box: a consistent border and a
   display-font title make it easy to tell vendor, community, and detail blocks
   apart at a glance. */
.detail-group {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); padding: .85rem 1rem; margin-top: 1rem;
}
.detail-group-title {
  font-family: var(--font-display); font-weight: 700; font-size: .98rem;
  margin: 0 0 .35rem; display: flex; align-items: center;
}
.detail-group-title i { color: var(--brand-primary); }
.detail-group-help { color: var(--muted); font-size: .8rem; margin: 0 0 .6rem; }
.detail-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.detail-group .detail-label.mt-2 { margin-top: .75rem; }

/* Vendor storefront logo (uploaded, stored 200 px, shown at 100 px). */
.store-logo {
  width: 100px; height: 100px; object-fit: cover;
  border-radius: var(--radius); background: #fff; display: block;
}

/* Home news column (admin-managed NewsItem list). */
.news-item { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .6rem; }
.news-item:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.news-title { font-family: var(--font-display); font-weight: 700; display: block; }

/* Barter trade lines: small specimen previews in tables/lists. */
.barter-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: .4rem; background: #eee; }
.barter-row { display: flex; align-items: center; gap: .6rem; }

/* Shared share block (visible detail + attribution). */
.share-block .share-detail { font-weight: 600; }

/* Specimen like badge (card overlay) and detail like button. */
.like-flag {
  position: absolute; top: .6rem; right: .6rem;
  background: rgba(0,0,0,.55); color: #fff; border-radius: 999px;
  padding: .1rem .5rem; font-size: .72rem; font-weight: 700;
}
.like-flag i { color: var(--brand-accent); }


/* --- Filter toolbar ------------------------------------------------------ */
.filter-bar {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-1);
}

/* --- Footer -------------------------------------------------------------- */
.app-footer {
  margin-top: 4rem; padding: 3rem 0 2rem;
  background: var(--brand-deep);
  color: rgba(255,255,255,.8);
}
.app-footer a { color: rgba(255,255,255,.75); text-decoration: none; }
.app-footer a:hover { color: #fff; }
.app-footer .footer-link {
  background: none; border: 0; padding: 0; text-align: left;
  color: rgba(255,255,255,.75); font: inherit;
}
.app-footer .footer-link:hover { color: #fff; }
.app-footer .footer-brand { font-family: var(--font-display); font-weight: 800; color: #fff; }

/* --- Motion -------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .specimen-card, .tile, .specimen-card img { transition: none; }
}

/* --- Misc ---------------------------------------------------------------- */
.avatar-brand { background-image: linear-gradient(135deg, var(--brand-fill), var(--brand-fill-2)); color: #fff; }
.stat-pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; }

/* --- Redesign additions -------------------------------------------------- */
/* Collapsible header search panel. */
.pr-nav-search { background: var(--surface-2); border-bottom: 1px solid var(--line); }

/* Cart line thumbnail: medium preview beside the item title. */
.cart-thumb { width: 104px; height: 104px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* Flat card: surface + top hairline, replacing gradient washes. */
.pr-flat-card { background: var(--surface-2); border: 0; border-top: 3px solid var(--brand-primary); box-shadow: var(--shadow-1); }
.news-rail { background: rgba(var(--brand-primary-rgb), .06); border-radius: var(--radius); padding: .85rem 1rem; }

/* Hero specimen photo + mono caption. */
.hero-specimen-link { display: block; }
.hero-specimen img { width: 100%; max-height: 340px; object-fit: contain; display: block; }
.hero-caption { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; color: rgba(255,255,255,.75); margin-top: .5rem; }

.stage-caption { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; color: var(--muted); }
.rating-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }

/* Ruled split between "Dealer says" and "Collectors say". */
.pr-ruled-split { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .5rem; }
.pr-ruled-split .detail-group { margin-top: .75rem; }

.like-btn.liked,
.like-btn.liked i { color: var(--brand-accent); border-color: var(--brand-accent); }

/* Shop result bar. */
.shop-toolbar { position: sticky; top: 3.6rem; z-index: 5; background: var(--brand-surface); padding: .5rem 0; border-bottom: 1px solid var(--line); }
.shop-count { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }

/* Sticky mini buy bar on the product page. */
.mini-buy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
  background: var(--surface-2); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px -12px rgba(0, 0, 0, .4); padding: .6rem 0;
}
.mini-buy-bar .price-tag { font-size: 1.1rem; }

/* Account avatars (django-avatar). */
.account-avatar img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.account-avatar-sm img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
/* Compact card action icon used across listing and profile cards. */
.card-view-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--muted); text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.card-view-icon:hover,
.card-view-icon:focus-visible {
  background: rgba(var(--brand-primary-rgb), .1);
  color: var(--brand-primary);
}
