/* Deal Heat — page-specific styles. Builds on styles.css tokens. */

:root {
  --heat-cold: #5b6573;
  --heat-warm: #c98a00;
  --heat-hot: #d2603a;
  --heat-blaze: #e0408a;
  --good: #1ca672;
}

/* ---------- controls ---------- */
.controls { margin: 4px 0 16px; display: flex; flex-direction: column; gap: 10px; }
.control-row { display: flex; gap: 10px; }
.search { flex: 1; padding: 12px 14px; }
.icon-btn {
  flex: 0 0 auto; width: 48px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow);
  transition: transform 0.15s var(--ease), color 0.15s;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn.is-spinning { color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sort-seg { margin-top: 0; }
.sort-seg .seg-btn { font-size: 0.85rem; padding: 8px 6px; }

.heat-slider { display: flex; align-items: center; gap: 12px; font-size: 0.82rem; font-weight: 700; color: var(--text-dim); }
.heat-slider span { white-space: nowrap; }
.heat-slider b { color: var(--text); }
.heat-slider input[type="range"] { flex: 1; accent-color: var(--accent); }

.chip-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto; appearance: none; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim);
  font: inherit; font-size: 0.74rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-chip .n { opacity: 0.6; font-weight: 700; margin-left: 4px; }

/* ---------- deal cards ---------- */
.deal-list { display: flex; flex-direction: column; gap: 10px; }

.deal {
  display: flex; gap: 12px; align-items: stretch; width: 100%; text-align: left;
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 16px; padding: 13px 14px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.08s ease, border-color 0.15s;
  position: relative;
}
.deal:active { transform: scale(0.99); }
.deal.is-new { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.deal.is-new::before {
  content: "NEW"; position: absolute; top: -7px; left: 12px;
  background: var(--accent); color: #fff; font-size: 0.6rem; font-weight: 800;
  letter-spacing: 0.08em; padding: 2px 7px; border-radius: 6px;
}

/* color-graded heat badge */
.heat-badge {
  flex: 0 0 auto; width: 46px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  border-radius: 12px; color: #fff; font-weight: 800;
  background: var(--heat-cold);
}
.heat-badge .h-num { font-size: 1.25rem; line-height: 1; }
.heat-badge .h-lbl { font-size: 0.52rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.heat-cold  { background: var(--heat-cold); }
.heat-warm  { background: var(--heat-warm); }
.heat-hot   { background: linear-gradient(160deg, var(--heat-hot), var(--heat-blaze)); }
.heat-blaze { background: linear-gradient(160deg, var(--heat-blaze), #ff5a5f);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--heat-blaze) 40%, transparent), 0 4px 14px color-mix(in srgb, var(--heat-blaze) 35%, transparent); }

.deal .body { min-width: 0; flex: 1; }
.deal .d-title { font-weight: 700; font-size: 0.98rem; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.deal .d-meta { margin-top: 5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.d-price { font-weight: 800; font-size: 1.02rem; }
.d-list { color: var(--text-dim); text-decoration: line-through; font-size: 0.85rem; }
.d-off { color: var(--good); font-weight: 800; font-size: 0.82rem; }
.d-sub { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.74rem; color: var(--text-dim); }
.src-chip { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); }
.d-coupon { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; color: var(--accent); }
.d-dot { opacity: 0.4; }

/* ---------- why-this-heat sheet ---------- */
.heat-ring-wrap { display: flex; justify-content: center; margin-bottom: 6px; }
.heat-ring {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.7rem; font-weight: 800; color: #fff; background: var(--heat-cold);
}
.score-bars { display: flex; flex-direction: column; gap: 9px; margin: 6px 0 14px; }
.score-bars .row { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 10px; font-size: 0.8rem; }
.score-bars .lbl { color: var(--text-dim); font-weight: 700; }
.score-bars .track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.score-bars .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.score-bars .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-bars .row.is-penalty .fill { background: var(--heat-hot); }

/* ---------- watchlist ---------- */
.watch-form { margin: 6px 0 18px; display: flex; flex-direction: column; gap: 10px; }
.watch-row2 { display: flex; gap: 10px; }
.watch-row2 .target { flex: 0 0 96px; }
.watch-hint { margin: 0; font-size: 0.76rem; color: var(--text-dim); }

.watch-list { display: flex; flex-direction: column; gap: 10px; }
.watch-card {
  border: 1px solid var(--border); background: var(--surface); border-radius: 16px;
  padding: 13px 14px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center;
}
.watch-card .wc-body { flex: 1; min-width: 0; }
.watch-card .wc-title { font-weight: 700; font-size: 0.96rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-card .wc-sub { margin-top: 3px; font-size: 0.78rem; color: var(--text-dim); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wc-price { font-weight: 800; color: var(--text); }
.wc-flag { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 999px; }
.wc-flag.low { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.wc-flag.target { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.wc-flag.stale { background: var(--surface-2); color: var(--text-dim); }
.spark { flex: 0 0 auto; }
.wc-del { appearance: none; border: 0; background: transparent; color: var(--text-dim); font-size: 1.1rem; cursor: pointer; padding: 4px 6px; }

.loading, .feed-empty { text-align: center; color: var(--text-dim); padding: 50px 20px; }
.feed-empty .big { font-size: 2rem; margin-bottom: 8px; }

@media (min-width: 560px) {
  .heat-badge { width: 52px; }
}
