/* ============================================================
   GoldbackHunter — Dark leather, hunter gold, rugged americana
   CSS variables are set per-brand in base.html via Django context.
   This file handles layout + brand-specific flourishes only.
   ============================================================ */

/* ── Layout ── */
.site-header {
  border-bottom: 2px solid var(--color-primary);
  background: color-mix(in srgb, var(--color-bg) 95%, black);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: .875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand-logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--color-primary);
  text-decoration: none;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  font-size: .95rem;
  color: var(--color-text);
  opacity: .8;
  transition: opacity .15s;
}
.nav-links a:hover { opacity: 1; color: var(--color-primary); }
.nav-links a.btn-cta-nav { color: #111; opacity: 1; }
.nav-links a.btn-cta-nav:hover { color: #111; }

/* ── Hamburger button (hidden on desktop) ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
  background: none;
  border: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  outline: none;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-hamburger--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger--open span:nth-child(2) { opacity: 0; }
.nav-hamburger--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav ── */
@media (max-width: 1199px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: color-mix(in srgb, var(--color-bg) 97%, black);
    border-bottom: 2px solid var(--color-primary);
    padding: .5rem 0;
    z-index: 99;
  }
  .nav-links.nav-open { display: flex; }
  .nav-links li { border-top: 1px solid var(--color-border); }
  .nav-links a {
    display: block;
    padding: .875rem 1.5rem;
    font-size: 1rem;
    opacity: 1;
  }
  .nav-links .btn-primary {
    margin: .75rem 1.5rem;
    text-align: center;
    display: block;
  }
  .nav-inner { position: relative; }
}

/* ── Buttons ── */
.btn-primary {
  background: var(--color-primary);
  color: #111;
  font-weight: 700;
  padding: .5rem 1.25rem;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  letter-spacing: .02em;
  transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.1); color: #111; opacity: 1; }
.btn-lg { padding: .75rem 2rem; font-size: 1.1rem; }
.btn-cta-nav { padding: .5rem 1.1rem; font-size: .9rem; color: #111; opacity: 1; box-shadow: 0 0 0 0 var(--color-primary); transition: filter .15s, box-shadow .2s; }
.btn-cta-nav:hover { filter: brightness(1.15); color: #111; opacity: 1; box-shadow: 0 0 12px 2px color-mix(in srgb, var(--color-primary) 40%, transparent); }

.btn-buy {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  padding: .3rem .85rem;
  border-radius: 3px;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.btn-buy:hover { background: var(--color-primary); color: #111; }

/* ── Hero ── */
.hero {
  max-width: 800px;
  margin: 5rem auto 3rem;
  padding: 0 1.5rem;
  text-align: center;
}
.hero-headline {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--color-primary);
  letter-spacing: -.02em;
  margin-bottom: 1rem;
  text-transform: uppercase;
}
.hero-sub {
  font-size: 1.15rem;
  opacity: .8;
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* ── Feature cards ── */
.features {
  max-width: 1000px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.5rem;
  background: var(--color-bg);
}
.feature-card h3 {
  color: var(--color-primary);
  margin-bottom: .5rem;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.feature-card p { opacity: .8; line-height: 1.5; font-size: .95rem; }

/* ── Price comparison table ── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 2rem; font-weight: 800; color: var(--color-primary); }
.page-sub { opacity: .7; margin-top: .35rem; }

.denom-section { margin-bottom: 3rem; }
.denom-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: .5rem;
  margin-bottom: 1rem;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.price-table th {
  text-align: left;
  padding: .6rem .75rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .6;
  border-bottom: 1px solid var(--color-border);
}
.price-table td {
  padding: .65rem .75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
}
.row-best { background: color-mix(in srgb, var(--color-primary) 8%, transparent); }
.price-best { color: var(--color-primary); font-weight: 700; }
.vendor-name { font-weight: 600; }

/* ── Messages ── */
.messages { max-width: 1200px; margin: 1rem auto; padding: 0 1.5rem; }
.message {
  padding: .75rem 1rem;
  border-radius: 4px;
  margin-bottom: .5rem;
  font-size: .9rem;
}
.message--success { background: #1a3a1a; border-left: 3px solid #7AB648; }
.message--error   { background: #3a1a1a; border-left: 3px solid #c94040; }
.message--info    { background: #1a2a3a; border-left: 3px solid var(--color-primary); }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem;
  text-align: center;
  font-size: .8rem;
  opacity: .5;
}
.footer-disclaimer { margin-top: .5rem; font-size: .75rem; }
.footer-links { margin-top: .75rem; display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: inherit; text-decoration: none; opacity: .7; }
.footer-links a:hover { opacity: 1; }
.footer-brand {
  cursor: help;
  position: relative;
}
.footer-brand::after {
  content: attr(data-sha);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.85);
  color: #fff;
  font-size: .7rem;
  font-family: monospace;
  padding: .2rem .5rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.footer-brand:hover::after {
  opacity: 1;
}

/* ── Prose (About page) ── */
.prose {
  max-width: 700px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  line-height: 1.7;
}
.prose h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 1rem;
}
.prose h2 { font-size: 1.25rem; font-weight: 700; color: var(--color-primary); margin: 1.75rem 0 .5rem; }
.prose p { margin-bottom: 1rem; opacity: .85; }
.prose ul { margin: 0 0 1rem 1.5rem; padding-left: 0.375rem; opacity: .85; }
.prose ul li { margin-bottom: .35rem; }
.prose-meta { font-size: .85rem; opacity: .55; margin-bottom: 1.5rem !important; }
.affiliate-notice { font-size: .8rem; opacity: .65; margin-bottom: 1rem; }
.history-upsell {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: .6rem 1rem;
  font-size: .875rem;
  margin-bottom: 1rem;
}

/* ── Auth forms ── */
.auth-hero {
  max-width: 800px;
  margin: 5rem auto 3rem;
  padding: 0 1.5rem;
  text-align: center;
}
.auth-hero-headline {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--color-primary);
  letter-spacing: -.02em;
  margin-bottom: .75rem;
  text-transform: uppercase;
}
.auth-hero-sub {
  font-size: 1.1rem;
  opacity: .75;
  margin-bottom: 2rem;
}
.auth-form-wrap {
  max-width: 420px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2rem 2rem 1.5rem;
  text-align: left;
}
.auth-switch { font-size: .85rem; opacity: .6; margin-top: 1rem; text-align: center; }
/* keep .auth-card for logout + verification pages */
.auth-card {
  max-width: 420px;
  margin: 4rem auto;
  padding: 2rem 2rem 2.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-align: center;
}
.auth-card h1 { font-size: 1.75rem; font-weight: 800; color: var(--color-primary); margin-bottom: .5rem; }
.auth-sub { font-size: .9rem; opacity: .7; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 1rem; margin-bottom: .35rem; opacity: .8; }
.form-group input {
  width: 100%;
  padding: .6rem .85rem;
  background: color-mix(in srgb, var(--color-bg) 70%, black);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text);
  font-size: 1rem;
}
.form-group input:focus { outline: none; border-color: var(--color-primary); }
.form-group--error input { border-color: #e05252; }
.form-error { font-size: .8rem; color: #e05252; margin-top: .25rem; }
.btn-block { width: 100%; text-align: center; margin-top: .5rem; padding: .75rem; font-size: 1rem; }

/* ── Empty state ── */
.empty-state {
  padding: 3rem;
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: 6px;
  opacity: .6;
}

/* ── S2 additions ── */
.premium { font-size: .85rem; opacity: .8; }
.stock-yes { color: var(--color-primary); }
.no-data { opacity: .5; font-size: .9rem; padding: .5rem 0; }

/* ── Price matrix table (S6) ── */
.matrix-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  min-width: 600px;
}
.matrix-table th {
  padding: .6rem .75rem;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .6;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}
.th-dealer { text-align: left; min-width: 130px; }
.th-denom  { text-align: center; }
.matrix-table td { border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent); }
.td-dealer {
  font-weight: 600;
  padding: .65rem .75rem;
  white-space: nowrap;
}
.td-price {
  text-align: center;
  padding: .45rem .5rem;
  vertical-align: middle;
}
.col-best { background: color-mix(in srgb, var(--color-primary) 10%, transparent); }

.price-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  text-decoration: none;
  border-radius: 4px;
  padding: .35rem .5rem;
  transition: background .15s;
}
.price-link:hover { background: color-mix(in srgb, var(--color-primary) 15%, transparent); }

.col-best .price-link .price-val {
  color: var(--color-primary);
  font-weight: 700;
}
.price-val { color: var(--color-text); font-size: .9rem; }
.price-prem { font-size: .72rem; opacity: .6; }
.price-delta { font-size: .72rem; opacity: .75; }
.price-none { opacity: .25; }

/* ── Delta shading (vs. average price per denomination) ── */
.cell-cold-2 { background: color-mix(in srgb, #22c55e 20%, transparent); }
.cell-cold-1 { background: color-mix(in srgb, #22c55e 9%, transparent); }
.cell-warm-1 { background: color-mix(in srgb, #f59e0b 9%, transparent); }
.cell-warm-2 { background: color-mix(in srgb, #ef4444 20%, transparent); }
/* col-best declared after so it wins when both classes apply */

/* ── Price alerts ── */
.alert-row td { padding: .4rem .75rem; background: color-mix(in srgb, var(--color-primary) 6%, transparent); }
.td-alert-label { font-size: .8rem; white-space: nowrap; opacity: .7; }
.td-alert-signup { font-size: .8rem; opacity: .7; }
.td-alert { text-align: center; }
.alert-form { display: inline-flex; align-items: center; gap: .25rem; }
.alert-input {
  width: 70px;
  padding: .2rem .4rem;
  background: color-mix(in srgb, var(--color-bg) 70%, black);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text);
  font-size: .75rem;
}
.alert-btn {
  padding: .2rem .5rem;
  background: var(--color-primary);
  color: #111;
  border: none;
  border-radius: 3px;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
}
.alert-set { font-size: .8rem; color: var(--color-primary); font-weight: 600; }
.alert-remove {
  background: none;
  border: none;
  color: var(--color-text);
  opacity: .45;
  cursor: pointer;
  font-size: .75rem;
  padding: 0 .2rem;
}
.alert-remove:hover { opacity: 1; }
.alerts-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.alerts-table th, .alerts-table td { padding: .65rem .75rem; border-bottom: 1px solid var(--color-border); font-size: .9rem; text-align: left; }
.alerts-table th { opacity: .6; font-weight: 600; font-size: .8rem; }
.btn-delete {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: .25rem .65rem;
  border-radius: 3px;
  font-size: .8rem;
  cursor: pointer;
  opacity: .7;
}
.btn-delete:hover { opacity: 1; border-color: #e05252; color: #e05252; }

/* ── Legend ── */
.matrix-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
  font-size: .78rem;
}
.legend-label { opacity: .5; }
.legend-sep   { opacity: .3; }
.legend-swatch {
  padding: .2rem .55rem;
  border-radius: 3px;
  opacity: .85;
}
.legend-swatch.cell-cold-2 { background: color-mix(in srgb, #22c55e 20%, transparent); }
.legend-swatch.cell-cold-1 { background: color-mix(in srgb, #22c55e 9%, transparent); }
.legend-swatch.cell-neutral { background: color-mix(in srgb, var(--color-border) 40%, transparent); }
.legend-swatch.cell-warm-1 { background: color-mix(in srgb, #f59e0b 9%, transparent); }
.legend-swatch.cell-warm-2 { background: color-mix(in srgb, #ef4444 20%, transparent); }

/* ── Price history charts (S7) ── */
.charts-section { margin-top: 3rem; }
.charts-heading {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: .5rem;
  margin-bottom: 1rem;
}
.chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.25rem;
}
.chart-tab {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: .3rem .85rem;
  border-radius: 3px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  opacity: .6;
  transition: opacity .15s, background .15s;
}
.chart-tab:hover { opacity: .9; }
.chart-tab.active {
  background: color-mix(in srgb, var(--color-primary) 15%, transparent);
  border-color: var(--color-primary);
  color: var(--color-primary);
  opacity: 1;
}
/* Goldback currency symbol + word */
.gb-word {
  display: inline-flex;
  align-items: center;
  gap: 0.05em;
  white-space: nowrap;
}
.gb-symbol {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  vertical-align: -0.1em;
  flex-shrink: 0;
}

/* Page-level tabs (Prices / Price History) */
.page-tabs {
  display: flex;
  gap: .5rem;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.75rem;
}
.page-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--color-text);
  padding: .55rem 1.25rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  opacity: .5;
  transition: opacity .15s, border-color .15s, color .15s;
}
.page-tab:hover { opacity: .85; }
.page-tab.active {
  border-bottom-color: var(--color-primary);
  color: var(--color-primary);
  opacity: 1;
}
.page-tab-panel { display: none; }
.page-tab-panel.active { display: block; }

/* Best Deals tab */
.deals-heroes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 600px) {
  .deals-heroes { grid-template-columns: 1fr; }
}
.deal-hero {
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-bg));
  border: 1px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
  border-radius: 8px;
  padding: 1.5rem;
}
.deal-hero-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-primary);
  margin-bottom: .4rem;
}
.deal-hero-vendor { font-size: 1.05rem; font-weight: 700; margin-bottom: .1rem; }
.deal-hero-denom  { font-size: .82rem; opacity: .55; margin-bottom: .85rem; }
.deal-hero-price  { font-size: 1.7rem; font-weight: 700; color: var(--color-primary); line-height: 1; }
.deal-hero-sub    { font-size: .78rem; opacity: .6; margin-top: .25rem; margin-bottom: 1rem; }
.deal-hero-cta    { display: inline-block; }

.deals-list { display: flex; flex-direction: column; gap: .65rem; }
.deal-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: color-mix(in srgb, var(--color-primary) 4%, var(--color-bg));
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: .85rem 1.1rem;
}
.deal-rank {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-primary);
  min-width: 1.6rem;
  text-align: center;
}
.deal-info { flex: 1; }
.deal-vendor { font-weight: 600; font-size: .95rem; }
.deal-denom  { font-size: .78rem; opacity: .55; }
.deal-prices { text-align: right; }
.deal-price  { font-weight: 700; }
.deal-norm   { font-size: .75rem; opacity: .55; }
.deal-cta    { margin-left: .5rem; white-space: nowrap; }

.chart-canvas-wrap {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.25rem;
  position: relative;
  height: 340px;
}
.chart-canvas-wrap.hidden { display: none; }
.chart-canvas-wrap canvas { width: 100% !important; height: 100% !important; }
