/* ============================================================
   DealHunt — modern deals site
   Change the brand name in app.js (SITE_NAME) and in index.html.
   ============================================================ */
:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --ink: #101828;
  --ink-soft: #344054;
  --muted: #667085;
  --border: #e7e4dd;
  --accent: #ea580c;          /* vivid deal orange */
  --accent-dark: #c2410c;
  --accent-soft: #fff1e8;
  --header-bg: #0b1220;       /* deep ink navy */
  --header-bg-2: #111c33;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-hover: 0 4px 8px rgba(16, 24, 40, .08), 0 16px 32px rgba(16, 24, 40, .12);
  --amazon: #ff9900;
  --walmart: #0071dc;
  --target: #cc0000;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(180deg, var(--header-bg), var(--header-bg-2));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-mark {
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}
.brand-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #98a2b3;
  border-left: 1px solid #2e3a52;
  padding-left: 10px;
  margin-left: 2px;
}

/* Prominent search */
.search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  padding: 2px 6px 2px 16px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .12);
  transition: box-shadow .15s ease;
}
.search-wrap:focus-within {
  box-shadow: 0 0 0 3px var(--accent);
}
.search-icon { font-size: 17px; margin-right: 8px; opacity: .7; }
.search-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  padding: 11px 4px;
  color: var(--ink);
}
.search-wrap input::placeholder { color: #98a2b3; }
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-clear {
  border: 0;
  background: #eef0f3;
  color: var(--ink-soft);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.search-clear:hover { background: #e2e5ea; }

.header-count {
  font-size: 14px;
  color: #d0d5dd;
  white-space: nowrap;
  flex-shrink: 0;
}
.header-count strong { color: #fff; font-size: 18px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, #fff, var(--bg));
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 20px 28px;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4.5vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.hero-accent { color: var(--accent); }
.hero p {
  margin: 0 0 18px;
  max-width: 640px;
  font-size: 17px;
  color: var(--muted);
}
.hero-stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
}
.hero-stats strong { color: var(--ink); font-size: 16px; }

/* ---------- Toolbar ---------- */
.toolbar {
  position: sticky;
  top: 64px;
  z-index: 40;
  background: rgba(250, 249, 246, .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.toolbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 20px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}
.store-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.selects {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.select-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.select-label select {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23667085' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border-radius: 10px;
  padding: 9px 30px 9px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.select-label select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.clear-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.clear-btn:hover { background: var(--accent-soft); }
.result-line {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2px 20px 12px;
  font-size: 14px;
  color: var(--muted);
}
.result-line strong { color: var(--ink); }
.active-filters { margin-left: 8px; }
.active-filters .chip {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  margin: 0 2px;
}

/* ---------- Grid & cards ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 40px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #d8d3c8;
}
.card-media {
  position: relative;
  display: block;
  background: #f2f1ed;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
  transition: transform .25s ease;
}
.card:hover .card-media img { transform: scale(1.04); }
.badge-discount {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(234, 88, 12, .45);
}
.badge-store {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
.badge-store.amazon { background: var(--amazon); color: #1a1a1a; }
.badge-store.walmart { background: var(--walmart); }
.badge-store.target { background: var(--target); }

.card-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.card-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-title {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.35;
  font-weight: 650;
}
.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--accent-dark); text-decoration: underline; }
.card-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}
.price-now {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.price-was {
  font-size: 14px;
  color: var(--muted);
  text-decoration: line-through;
}
.price-save {
  font-size: 12px;
  font-weight: 700;
  color: #067647;
  background: #e7f6ee;
  padding: 2px 8px;
  border-radius: 999px;
}
.btn-deal {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  padding: 11px 16px;
  border-radius: 12px;
  margin-top: 10px;
  transition: background .15s ease, transform .1s ease;
}
.btn-deal:hover { background: var(--accent-dark); }
.btn-deal:active { transform: scale(.98); }
.btn-inline { display: inline-block; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 44px; margin-bottom: 8px; }
.empty h2 { color: var(--ink); margin: 0 0 6px; font-size: 22px; }
.empty p { margin: 0 0 20px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--header-bg);
  color: #98a2b3;
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 20px 44px;
}
.footer-brand {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}
.footer-brand .brand-mark { color: var(--accent); margin-right: 6px; }
.disclosure {
  font-size: 14px;
  line-height: 1.6;
  max-width: 760px;
  margin: 0 0 10px;
}
.footer-note { font-size: 13px; margin: 0; color: #667085; }

/* ---------- Header nav ---------- */
.site-nav {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.site-nav a {
  color: #d0d5dd;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.site-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.site-nav a.active { color: #fff; background: rgba(255, 255, 255, .14); }

/* ---------- Articles & guides ---------- */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 20px 56px;
}
.article h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.article h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 30px 0 10px;
}
.article p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.post-meta { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.post-meta a { color: var(--accent-dark); font-weight: 600; text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }
.post-nav { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 15px; }
.post-nav a { color: var(--accent-dark); font-weight: 700; text-decoration: none; }
.post-nav a:hover { text-decoration: underline; }

.deal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}
.deal-box h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.35; }
.deal-box p { margin: 0 0 12px; font-size: 15px; }
.deal-box .btn-deal { margin-top: 0; }
.deal-price { font-size: 20px; font-weight: 800; color: var(--ink); }
.deal-price s { color: var(--muted); font-size: 15px; font-weight: 400; margin-left: 6px; }
.deal-price .save {
  font-size: 12px;
  font-weight: 700;
  color: #067647;
  background: #e7f6ee;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  white-space: nowrap;
}
.deal-store { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Guides index */
.guides-index { max-width: 860px; margin: 0 auto; padding: 36px 20px 56px; }
.guides-index h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.02em; font-weight: 800; }
.guides-intro { font-size: 17px; line-height: 1.7; color: var(--muted); margin: 0 0 28px; max-width: 640px; }
.guides-list { display: grid; gap: 16px; }
.guide-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #d8d3c8; }
.guide-card h2 { margin: 0 0 4px; font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; }
.guide-card:hover h2 { color: var(--accent-dark); }
.guide-date { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.guide-card p:not(.guide-date) { margin: 0 0 10px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.6; }
.guide-link { font-size: 14px; font-weight: 700; color: var(--accent-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .brand-tag { display: none; }
  .search-wrap { order: 3; flex-basis: 100%; }
  .header-count { margin-left: auto; }
  .toolbar { top: 0; }
  .hero-inner { padding: 28px 16px 20px; }
  main { padding: 18px 16px 32px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card-media img { padding: 10px; }
  .card-body { padding: 12px; }
  .price-now { font-size: 19px; }
  .card-title { font-size: 14px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr 1fr; }
}
