/* Slim public nav header (ahg-hxlw4). Sits above .cd-page so it spans the
   full viewport edge-to-edge, matching how the landing/features header works.
   No sidebar, no dashboard chrome — just wordmark + one CTA. */
.cd-pub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.cd-pub-logo {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.cd-pub-logo:hover { color: var(--accent-amber); }

.cd-pub-nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
}
.cd-pub-nav-link:hover { color: var(--text-primary); }

.cd-pub-signin-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--bg-primary);
  background: var(--accent-amber);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: opacity 100ms ease;
}
.cd-pub-signin-btn:hover { opacity: 0.88; }

/* Individual item detail page (ahg-wt7u7). Scoped to .cd-page — follows
   DESIGN.md Vault Industrial tokens (--bg-secondary/--border-subtle/--radius-lg
   etc, defined globally in layouts/application.html.erb) rather than inventing
   new ones. Mobile-first hard minimums: 14px body, 44px tap targets. */

.cd-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

/* Catalog breadcrumb (ahg-25j3e IA): Market / {game} / {set} / {card},
   matching the /market bar convention (market.css .bar-*, scoped to .mkt-page
   and not loaded here, so restated). Segments wrap on mobile rather than
   overflow; links clear the 44px tap floor. */
.cd-breadcrumb {
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 14px;
}

.cd-crumb-link,
.cd-crumb-text,
.cd-crumb-current {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.cd-crumb-link {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 100ms ease;
}
.cd-crumb-link:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-secondary);
}

.cd-crumb-text { color: var(--text-secondary); }
.cd-crumb-current { color: var(--text-primary); font-weight: 600; }

/* Separator as a ::before on each crumb but the first, not a separate flex
   sibling -- a standalone " / " span could wrap onto its own line, stranding
   a bare "/" at the end of the previous line on mobile. This way the
   separator always travels with the crumb that follows it. */
.cd-crumb-link + .cd-crumb-link,
.cd-crumb-link + .cd-crumb-text,
.cd-crumb-link + .cd-crumb-current,
.cd-crumb-text + .cd-crumb-link,
.cd-crumb-text + .cd-crumb-text,
.cd-crumb-text + .cd-crumb-current {
  margin-left: 2px;
}
.cd-crumb-link + .cd-crumb-link::before,
.cd-crumb-link + .cd-crumb-text::before,
.cd-crumb-link + .cd-crumb-current::before,
.cd-crumb-text + .cd-crumb-link::before,
.cd-crumb-text + .cd-crumb-text::before,
.cd-crumb-text + .cd-crumb-current::before {
  content: '/';
  color: var(--text-muted);
  margin-right: 8px;
}

.cd-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.cd-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Header stat strip */
.cd-stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
}

.cd-stat {
  flex: 1 1 100px;
  min-width: 100px;
  padding: 4px 12px;
}

.cd-stat-label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cd-stat-value {
  display: block;
  font-family: 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}
/* "Preorder" is a word, not a number -- drop the mono/large numeric treatment
   so it doesn't masquerade as a price. */
.cd-stat-value--text {
  font-family: 'Geist', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
}
/* Preorder context line under the stat strip: why the market price is blank. */
.cd-preorder-note {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 4px 0 0;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
}

.cd-status-pill {
  display: inline-block;
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full, 999px);
  white-space: nowrap;
}
.cd-status-pill--success { background: var(--green-tint); color: var(--accent-green); }
.cd-status-pill--warning { background: var(--amber-tint); color: var(--accent-amber); }
.cd-status-pill--error   { background: var(--rose-tint);  color: var(--accent-rose); }
.cd-status-pill--neutral { background: var(--bg-card-hover); color: var(--text-secondary); }

/* Two-column layout: card image left, chart right. Stacks on tablet. */
.cd-columns {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
}

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

.cd-col-img {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cd-card-img {
  width: 100%;
  border-radius: var(--radius-lg);
  display: block;
}

.cd-no-img {
  width: 100%;
  aspect-ratio: 5 / 7;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}

.cd-set-line {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Secondary "View on TCGplayer" action (ahg-rb2rf): demoted below the card
   image now that the market page itself is the omnisearch destination. */
.cd-tcg-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
}

.cd-tcg-link:hover {
  color: var(--text-primary);
  border-color: var(--accent-amber);
}

.cd-col-chart {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.cd-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px;
}

.cd-no-history {
  font-size: 14px;
  color: var(--text-muted);
  padding: 24px 8px;
  text-align: center;
}

/* Link pattern: internal action (see DESIGN.md > Links). Same rule as
   dashboard.css.erb's .link-internal, duplicated here so this page doesn't
   need to load the dashboard stylesheet for one class. */
.cd-page .link-internal {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-muted);
  transition: border-color 100ms ease;
  cursor: pointer;
}
.cd-page .link-internal:hover {
  border-bottom-color: var(--text-secondary);
}

/* Reprints table (ahg-hxlw4, replaces chip blobs). */
.cd-reprints {
  margin-top: 24px;
}

.cd-reprints-note {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.cd-reprints-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

.cd-reprints-table thead th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 12px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

/* Col widths: icon | set name | year | price | badge */
.cd-reprints-table col:nth-child(1),
.cd-reprint-td-icon { width: 32px; }
.cd-reprint-td-year  { width: 52px; }
.cd-reprint-td-price { width: 88px; }
.cd-reprint-td-badge { width: 72px; text-align: right; }

.cd-printing-row td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.cd-printing-row:last-child td { border-bottom: none; }

.cd-printing-row--current td { background: var(--bg-glass); }

.cd-reprint-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}

.cd-reprint-icon--placeholder {
  display: inline-block;
  width: 16px;
  height: 16px;
  background: var(--bg-card-hover);
  border-radius: 3px;
}

.cd-reprint-link {
  color: var(--text-primary);
  text-decoration: none;
}
.cd-reprint-link:hover .cd-printing-row-set { text-decoration: underline; }

.cd-printing-row-set {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.cd-reprint-td-year {
  font-family: 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.cd-reprint-td-price {
  font-family: 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.cd-reprint-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--radius-full, 999px);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.cd-reprint-badge--current {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
}

.cd-reprint-badge--owned {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
}

/* Set-icon/release-date axis markers overlaid on the weekly chart SVG
   (card_detail.js). Additive-only: price_bucket_chart.js's own render never
   emits these elements. */
.cd-chart-marker-icon {
  pointer-events: none;
}

.cd-chart-marker-dot {
  fill: var(--text-muted);
  pointer-events: none;
}

/* Normal/Foil finish toggle (ahg-25j3e). Switches the chart's printing AND
   the header Market stat -- both server-rendered for both finishes up front,
   swapped client-side, no re-fetch on toggle. */
.cd-finish-toggle {
  display: flex;
  gap: 4px;
}

.cd-finish-btn {
  min-height: 44px;
  padding: 4px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.cd-finish-btn--active {
  color: var(--text-primary);
  border-color: var(--accent-amber);
}

/* Holdings overlay (ahg-25j3e): the seller's own condition/finish rows for
   this product, never a page gate. */
.cd-holdings {
  margin-top: 24px;
}

/* ahg-z4fqa: bidirectional link back to the dashboard manage panel
   (reprice/watch/QR) for an owned SKU. */
.cd-manage-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-amber);
  text-decoration: none;
}

.cd-manage-link:hover {
  text-decoration: underline;
}

.cd-holdings-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}


.cd-holdings-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.cd-holdings-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .cd-page { padding: 16px 12px 32px; }
  .cd-title { font-size: 22px; }
  .cd-stat { flex: 1 1 45%; }
  .cd-holdings-table { font-size: 14px; }
  .cd-holdings-table th, .cd-holdings-table td { padding: 8px 4px; }
  .cd-holdings-table th:nth-child(1), .cd-holdings-table td:nth-child(1) { width: 22%; }
  .cd-holdings-table th:nth-child(2), .cd-holdings-table td:nth-child(2) { width: 16%; }
  .cd-holdings-table th:nth-child(3), .cd-holdings-table td:nth-child(3) { width: 12%; }
  .cd-holdings-table th:nth-child(4), .cd-holdings-table td:nth-child(4) { width: 24%; }
  .cd-holdings-table th:nth-child(5), .cd-holdings-table td:nth-child(5) { width: 26%; }
  .cd-status-pill { padding: 4px 8px; }

  /* Reprints table: the fixed icon/year/price/badge widths (32+52+88+72=244px)
     leave too little room for Set at this viewport, wrapping a name like
     "Portal Second Age" across 3 lines. Shrink the fixed columns so Set gets
     the room it needs for one line; badge stays put since "Viewing"/"Owned"
     already fit it tightly at the current size. */
  .cd-printing-row td { padding: 8px 6px; }
  .cd-reprints-table thead th { padding: 0 6px 8px; }
  .cd-reprints-table col:nth-child(1),
  .cd-reprint-td-icon { width: 24px; }
  .cd-reprint-td-year  { width: 38px; }
  .cd-reprint-td-price { width: 60px; }
}
