/* 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; }

.cd-crumb-sep {
  color: var(--text-muted);
  padding: 0 6px;
}

.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 strip (ahg-c9k83). Chips are >=44px tappable per DESIGN.md's
   mobile tap-target floor -- an owned sibling is a <a>, a not-owned one a
   <div> (never a dead 404 link). */
.cd-reprints {
  margin-top: 24px;
}

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

.cd-reprints-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cd-printing-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  min-width: 96px;
  padding: 8px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 100ms ease;
}
.cd-printing-chip:hover {
  border-color: var(--text-secondary);
}

.cd-printing-chip--current {
  border-color: var(--accent-amber);
  cursor: default;
}
.cd-printing-chip--current:hover {
  border-color: var(--accent-amber);
}

.cd-printing-chip-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.cd-printing-chip-icon--placeholder {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--bg-card-hover);
  border-radius: var(--radius-sm);
}

.cd-icon-hidden {
  display: none;
}

.cd-printing-chip-set {
  font-size: 14px;
  font-weight: 600;
}

.cd-printing-chip-year,
.cd-printing-chip-price {
  font-size: 14px;
  color: var(--text-muted);
  font-family: 'Geist Mono', monospace;
}

.cd-printing-chip-badge {
  font-size: 14px;
  color: var(--accent-amber);
  font-weight: 600;
}

/* 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; }
}
