:root {
  --bg: #f6f7f9;
  --bg-alt: #eef3f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-accent: #fff9f1;
  --border: #e5e7eb;
  --muted: #5f6b7a;
  --text: #111827;

  --link: #007185;
  --brand: #ff9900;
  --brand-2: #f08804;
  --brand-light: #fffbf5;

  --ring: rgba(0,113,133,.25);
  --radius: 14px;
  --shadow: 0 6px 20px rgba(17,24,39,.06);
  --shadow-strong: 0 10px 30px rgba(17,24,39,.10);
}

* { box-sizing: border-box }
html, body { height: 100% }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial; }
a { color: var(--link); text-decoration: none }
a:hover { text-decoration: underline }
.container { max-width: 1200px; margin: 0 auto; padding: 24px }
.muted { color: var(--muted) }

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, #ffffff, #fdfdfd);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.03)
}

.nav { display: flex; align-items: center; gap: 16px; padding: 12px 24px }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text) }
.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(255,153,0,.25)
}
.logo-mark::after {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 4px;
  transform: rotate(45deg)
}
.brand { font-size: 1.03rem }
.nav-links { margin-left: auto; display: flex; gap: 14px; align-items: center }
.nav-links a { color: var(--text) }
.nav-links a.muted { color: var(--muted) }
.nav-links a:hover { text-decoration: none; color: #0f172a }

.hero {
  padding: 22px 24px;
  border-top: 1px solid var(--border);
  background: linear-gradient(135deg, var(--brand-light), #fff)
}
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 16px;
  box-shadow: var(--shadow)
}
.hero h2 { margin: 0; font-size: 1.3rem }
.hero p { margin: 0; color: var(--muted) }

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface)
}
@media(min-width:900px){
  .toolbar { grid-template-columns:1fr 320px 220px 160px }
}

.input, select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none
}
.input:focus, select:focus { box-shadow: 0 0 0 4px var(--ring); border-color: #9ad5df }

.flow {
  display: grid;
  gap: 18px;
  padding: 8px 24px 0
}
.flow-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow)
}
.flow-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  border-left: 5px solid var(--brand);
  padding-left: 10px
}
.flow-title { margin: 0; font-size: 1.02rem }
.flow-sub { margin: 0; color: var(--muted); font-size: .95rem }

.flow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}
.flow-row .chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d7dcef;
  background: #f8faff;
  color: #3a4a64;
  cursor: pointer;
  font-weight: 600;
  font-size: .92rem
}
.flow-row .chip.active {
  border-color: #007185;
  background: rgba(0,113,133,.10);
  color: #0f4c5c
}

.grid {
  display: grid;
  gap: 14px;
  padding: 20px 24px
}
@media(min-width:680px){ .grid{ grid-template-columns:repeat(2,1fr) } }
@media(min-width:1000px){ .grid{ grid-template-columns:repeat(3,1fr) } }
@media(min-width:1280px){ .grid{ grid-template-columns:repeat(4,1fr) } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
  border-color: #d1d5db
}

.thumb {
  aspect-ratio: 4 / 3;
  background: #f3f4f6;
  display: grid;
  place-items: center
}
.thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain
}

.content {
  padding: 12px 12px 14px
}
.title {
  font-weight: 650;
  margin: 0 0 6px;
  font-size: 1rem;
  color: #0f172a
}
.brand-line { min-height: 1em; color: #4b5563 }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px
}
.price { font-weight: 800; color: #0f172a }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: .73rem;
  background: linear-gradient(180deg,#ffe08a,#ffc107);
  color: #2d2100;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid #f5ca57
}

.stars { display: inline-flex; gap: 2px }

.filters .chip {
  display: inline-block;
  margin: 6px 6px 0 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #bfe2ea;
  color: #0f172a;
  background: #f1f8fa;
  font-size: .85rem
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e08c00;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #111827;
  font-weight: 750;
  cursor: pointer;
  margin-top: 10px;
  text-decoration: none
}
.btn:hover { filter: brightness(.98) }
.btn:active { transform: translateY(1px) }

.pager {
  display: flex;
  justify-content: center;
  margin: 6px 0 20px
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: linear-gradient(180deg,#fff,#f8f9fc);
  color: #0f172a;
  font-weight: 700;
  cursor: pointer
}
.btn-secondary:hover { filter: brightness(.98) }

footer {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f7f9fa);
  color: var(--muted);
  padding: 22px 24px;
  text-align: center
}
.no-results { padding: 20px; color: var(--muted) }

/* --- Keep View buttons aligned while chips wrap --- */
.grid { align-items: stretch; }
.card { height: 100%; display: flex; flex-direction: column; }
.content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.content .btn { margin-top: auto; } /* pins CTA to bottom */

/* Back-to-top button */
.back-top{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: linear-gradient(180deg,#fff,#f7f9fc);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #111827;
}
.back-top.show { display: inline-flex; }
.back-top:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0,113,133,.25);
}

/* Mobile: tidy Quick Categories layout */
@media (max-width: 600px) {
  .flow-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .flow-row .chip {
    width: 100%;
    text-align: center;
  }
}

/* === Storefront About/Contact — center content on mobile only === */
@media (max-width: 640px) {
  body.about-page main.container,
  body.contact-page main.container {
    text-align: center;
  }

  body.about-page main.container h1,
  body.contact-page main.container h1,
  body.about-page main.container p,
  body.contact-page main.container p {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ===============================
   Affiliate / Legal Content Pages
   =============================== */

.affiliate-page {
  padding: 24px;
}

.affiliate-page h1 {
  margin-top: 0;
}

.affiliate-page h2 {
  margin-top: 22px;
}

.affiliate-page p {
  max-width: 720px;
}

@media (max-width: 640px) {
  .affiliate-page {
    padding: 20px 16px;
    text-align: center;
  }

  .affiliate-page p,
  .affiliate-page h1,
  .affiliate-page h2 {
    margin-left: auto;
    margin-right: auto;
  }
}