/* BidSpot — Shared layout for data-driven pages: categories, analytics, today,
   product detail. These reuse the full navbar (main.css) and card styles
   (leaderboard.css) — this file is just the page-specific scaffolding around them. */

.page-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 28px 8px;
  text-align: center;
}

.page-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.page-content {
  max-width: 900px;
  margin: 24px auto 60px;
  padding: 0 28px;
  width: 100%;
  flex: 1;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.section-heading-row h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.see-all-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: color var(--transition-fast);
}
.see-all-link:hover { color: var(--accent-primary-hover); }

/* Stat cards — used on today.html and analytics.html */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0;
}

@media (max-width: 640px) {
  .stat-cards-row { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
}

.stat-card-value {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.stat-card-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Category overview grid — categories.html */
.category-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .category-overview-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .category-overview-grid { grid-template-columns: 1fr; }
}

.category-overview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Grid items default to min-width:auto, so this card sized itself to its widest
     unbreakable descendant (the nowrap listing title inside .mini-rank-row) instead
     of to its 1fr track — on a 375px screen that made a 319px track render a 497px
     card, pushing every category card off the right edge of the phone. */
  min-width: 0;
  transition: border-color var(--transition-normal), background-color var(--transition-normal), transform var(--transition-normal);
}
.category-overview-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}

.category-overview-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-overview-icon {
  font-size: 1.15rem;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-light);
}

.category-overview-name {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
}

.category-overview-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.category-overview-top {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

/* "Most active categories" highlighted panel, plus the per-category mini-rankings
   inside every grid card — modeled on outbid.lol's categories page. */
.most-active-panel {
  background: linear-gradient(160deg, var(--accent-light), var(--bg-secondary) 60%);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 28px;
}

.most-active-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.most-active-title .pulse-dot { position: static; }

.most-active-subtitle {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.most-active-rank-badge {
  display: inline-block;
  /* It's a flex item in a column card, so the default stretch made this short badge
     span the card's full width and read as a banner rather than a tag. */
  align-self: flex-start;
  color: var(--accent-primary);
  background: var(--badge-bg);
  border: 1px solid var(--accent-border);
  font-weight: 800;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.mini-rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  min-width: 0; /* same reason as the card above — it's a flex item in a column */
}

.mini-rank-num {
  font-weight: 700;
  color: var(--text-muted);
  width: 18px;
  flex-shrink: 0;
}

.mini-rank-logo {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  overflow: hidden;
}

.mini-rank-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-weight: 500;
}

.mini-rank-price {
  color: var(--accent-primary);
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ============================================================
   Product detail page — product.html
   Laid out as a real page (breadcrumb → hero → rank cards → explanation →
   rest of the category) rather than the single centered box it used to be,
   which gave a listing nowhere to say what its rank actually means.
   ============================================================ */
.product-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.product-breadcrumb a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.product-breadcrumb a:hover { color: var(--accent-primary); }

.product-hero-card {
  background: var(--bg-card);
  border: 1.5px solid var(--accent-border);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  position: relative;
}

.product-hero-logo {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.7rem;
  color: #ffffff;
  overflow: hidden;
}

.product-hero-main {
  flex: 1;
  min-width: 0; /* let long titles/taglines wrap instead of widening the card */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.product-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.product-hero-tagline {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.55;
}

.product-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.btn-secondary:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

/* Two rank cards — the page's headline facts: where this listing sits in its
   own category, and where it sits on the whole board. */
.product-rank-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.product-rank-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-rank-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.product-rank-value {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}

.product-rank-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.product-about {
  margin-top: 36px;
}

.product-about h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.product-about h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 22px 0 6px;
}

.product-about p {
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.product-about-lede {
  color: var(--text-secondary);
  padding-bottom: 6px;
}

/* Inline prose links only — :not(.btn-primary) because the claim button is also an
   <a> inside this section, and inheriting the accent color here painted its label
   maroon on a maroon fill, i.e. an apparently empty button. */
.product-about a:not(.btn-primary) {
  color: var(--accent-primary);
  font-weight: 600;
}

.product-claim-btn {
  margin-top: 24px;
  color: #ffffff;
}

.product-peers {
  margin-top: 40px;
}

.peer-rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.peer-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.peer-rank-row:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.peer-rank-num {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-muted);
  width: 26px;
  flex-shrink: 0;
}

.peer-rank-logo {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  overflow: hidden;
}

.peer-rank-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
}

.peer-rank-price {
  font-family: var(--font-serif);
  color: var(--accent-primary);
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .product-hero-card {
    flex-direction: column;
    padding: 22px;
    gap: 16px;
  }
  .product-hero-logo { width: 60px; height: 60px; font-size: 1.4rem; }
  .product-rank-cards { grid-template-columns: 1fr; }
  .product-hero-actions .btn-primary,
  .product-hero-actions .btn-secondary { flex: 1; justify-content: center; }
  .peer-rank-row { padding: 12px 16px; }

  /* The meta row wraps onto 2-3 lines at this width, which left a "·" dangling at
     the end of a line. Spacing alone separates the items once they're stacked. */
  .meta-sep { display: none; }
  .product-hero-meta { gap: 8px 14px; }

  .product-about h2 { font-size: 1.2rem; }
  .product-about h3 { font-size: 0.95rem; }
  .product-claim-btn { width: 100%; justify-content: center; }
}

.empty-state-block {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-secondary);
}
.empty-state-block h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}
/* "Back to the leaderboard" in these blocks is a real link but rendered as plain
   body text, so it read as a dead end on the not-found page. */
.empty-state-block a {
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: underline;
}
