/*
 * CanadianPick — public-facing styles
 */

:root {
  --ink: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --bg: #fafafa;
  --card: #ffffff;
  --maple: #dc2626;
  --maple-soft: #fef2f2;
  --green: #059669;
  --green-bg: #ecfdf5;
  --radius: 10px;
  --shadow: 0 14px 40px rgba(17, 24, 39, .08);
}

* { box-sizing: border-box; margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; }

/* ---- Header ---- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .inner {
  max-width: 980px;
  margin: 0 auto;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.site-header .brand {
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  white-space: nowrap;
}
.site-header .brand .maple { color: var(--maple); }
.site-header .tag {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.3;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-left: auto;
}
.site-nav a {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); }
.site-header .header-cta {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .site-header .inner { flex-wrap: wrap; }
  .site-header .tag { display: none; }
  .site-nav { order: 3; width: 100%; margin-left: 0; }
  .site-header .header-cta { margin-left: auto; }
}

/* ---- Wrap ---- */
.wrap { max-width: 980px; margin: 0 auto; padding: 1.25rem 1rem 3rem; scroll-margin-top: 5rem; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  margin-top: 3rem;
}
.site-footer .inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: .82rem;
}
.site-footer .footer-copy { flex: 1; }
.site-footer nav { display: flex; gap: 1.25rem; }
.site-footer a {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: color .15s;
}
.site-footer a:hover { color: var(--ink); }

/* ---- Hero banner (home) ---- */
.hero {
  background:
    linear-gradient(135deg, rgba(17,24,39,.96), rgba(55,65,81,.92)),
    radial-gradient(circle at 12% 20%, rgba(220,38,38,.22), transparent 24%);
  color: #fff;
  padding: 3.25rem 1rem 2rem;
}
.hero-inner { max-width: 980px; margin: 0 auto; }
.hero .eyebrow {
  color: #fca5a5;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.hero h1 {
  max-width: 680px;
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
  margin-bottom: .75rem;
}
.hero h1 .maple { color: #f87171; }
.hero p { color: rgba(255,255,255,.72); font-size: 1rem; max-width: 560px; margin-bottom: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem; margin-top: 1.25rem; }
.hero .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: .85rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .15s;
}
.hero .hero-cta:hover { transform: scale(1.03); }
.hero-link {
  color: rgba(255,255,255,.82);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.hero-link:hover { color: #fff; }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 2rem;
}
.hero-stats span {
  display: inline-flex;
  gap: .35rem;
  align-items: baseline;
  padding: .45rem .7rem;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.76);
  font-size: .82rem;
}
.hero-stats strong { color: #fff; font-size: .95rem; }
.hero-stats a { color: rgba(255,255,255,.9); text-decoration: none; font-weight: 600; }
.hero-stats a:hover { color: #fff; text-decoration: underline; }
@media (max-width: 600px) {
  .hero { padding: 2.25rem .75rem 1.5rem; }
  .hero h1 { font-size: 1.55rem; line-height: 1.18; max-width: 21rem; }
  .hero p { font-size: .92rem; }
}

/* ---- Filters ---- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: .75rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(17,24,39,.03);
}
.filters .search-form { display: contents; }
.filters .search-wrap {
  flex: 1 1 280px;
  display: flex;
  gap: .4rem;
}
.filters .search-wrap input[type=text] {
  flex: 1;
  padding: .5rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: .875rem;
  background: var(--card);
  transition: border-color .15s;
}
.filters .search-wrap input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,24,39,.06); }
.filter-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  min-width: 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: .3rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover { border-color: #d1d5db; color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.maple.active { background: var(--maple); border-color: var(--maple); }
.results-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin: .85rem 0 1rem;
  color: var(--muted);
  font-size: .88rem;
}
.results-bar strong { color: var(--ink); }
.text-link { color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }

/* ---- Offer list ---- */
.offer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }

/* ---- Offer card ---- */
.offer-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  text-decoration: none;
  min-height: 100%;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.offer-card:hover { border-color: #d1d5db; box-shadow: var(--shadow); transform: translateY(-1px); }
.offer-card .card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.badge-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.kind-badge,
.category-badge {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 4px;
  white-space: nowrap;
}
.kind-badge { color: var(--muted); background: #f3f4f6; }
.category-badge { color: #065f46; background: var(--green-bg); }
.offer-card .deal-value {
  font-size: .85rem;
  font-weight: 700;
  color: var(--maple);
  white-space: nowrap;
}
.offer-card h2 {
  margin: .3rem 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}
.offer-card .meta {
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .5rem;
  align-items: center;
}
.offer-card .meta span + span::before,
.offer-detail .meta span::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 .45rem .12rem 0;
  border-radius: 999px;
  background: #d1d5db;
}
.offer-card .maple-dot { color: var(--maple); font-weight: 600; }
.offer-card .desc {
  margin: .4rem 0 0;
  font-size: .85rem;
  color: #4b5563;
  line-height: 1.45;
}
.card-footer {
  margin-top: .75rem;
  padding-top: .65rem;
  border-top: 1px solid #f3f4f6;
  color: var(--faint);
  font-size: .78rem;
}

/* ---- Offer detail ---- */
.offer-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.5rem;
}
.offer-detail h1 { font-size: 1.75rem; font-weight: 800; margin: .5rem 0; line-height: 1.18; letter-spacing: 0; }
.offer-detail .meta { font-size: .875rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .15rem .5rem; align-items: center; margin-bottom: .75rem; }
.offer-detail .maple-dot { color: var(--maple); font-weight: 600; }
.offer-detail .deal-highlight {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--maple);
  background: var(--maple-soft);
  padding: .35rem .75rem;
  border-radius: 8px;
  margin-bottom: .75rem;
}
.offer-detail .description { font-size: .95rem; color: #374151; line-height: 1.6; margin-bottom: .75rem; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.shop-panel {
  border-left: 1px solid var(--line);
  padding-left: 1.25rem;
}
.shop-panel h2 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: .75rem;
}
.shop-panel dl { display: grid; gap: .8rem; }
.shop-panel dt {
  font-size: .72rem;
  color: var(--faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.shop-panel dd { font-size: .9rem; color: var(--ink); margin-top: .12rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; color: var(--muted); text-decoration: none; margin-bottom: 1rem; }
.back-link:hover { color: var(--ink); }
.tracked-action { margin-top: 1rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: #1f2937; }
.btn:active { transform: scale(.98); }
.btn.outline { background: transparent; color: var(--ink); }
.btn.outline:hover { background: #f3f4f6; }
.btn.small { padding: .35rem .7rem; font-size: .8rem; }

/* ---- Forms (subscribe, etc.) ---- */
.form-page { max-width: 480px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.form-page h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: .35rem; }
.form-page .subtitle { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; line-height: 1.5; }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.form-card .field { margin-bottom: .85rem; }
.form-card .field:last-of-type { margin-bottom: 0; }
.form-card label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin-bottom: .25rem;
}
.form-card input[type=text],
.form-card input[type=email],
.form-card select,
.form-card textarea {
  width: 100%;
  padding: .55rem .7rem;
  font: inherit;
  font-size: .875rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color .15s;
}
.form-card textarea { resize: vertical; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,24,39,.06); }
.form-footer { margin-top: 1rem; }
.form-footer .fine-print { font-size: .75rem; color: var(--faint); margin-top: .5rem; line-height: 1.45; }

/* ---- Auth ---- */
.auth-page {
  min-height: calc(100vh - 4rem);
  padding: 3rem 1rem;
  background:
    linear-gradient(135deg, rgba(17,24,39,.04), rgba(220,38,38,.03)),
    var(--bg);
}
.auth-panel {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 2rem;
  align-items: center;
}
.auth-copy .eyebrow {
  color: var(--maple);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .55rem;
}
.auth-copy h1 {
  max-width: 560px;
  font-size: 2.25rem;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: .75rem;
}
.auth-copy p {
  max-width: 500px;
  color: var(--muted);
  font-size: 1rem;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}
.auth-card h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.auth-form { display: grid; gap: .85rem; }
.auth-form .field label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin-bottom: .25rem;
}
.auth-form input[type=email],
.auth-form input[type=password] {
  width: 100%;
  padding: .7rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17,24,39,.06);
}
.check-row {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .88rem;
}
.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: .15rem;
}
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: .85rem;
}
.auth-links a { text-decoration: none; }
.auth-links a:hover { color: var(--ink); text-decoration: underline; }
.form-errors {
  padding: .65rem .75rem;
  border-radius: 8px;
  background: var(--maple-soft);
  color: var(--maple);
  font-size: .85rem;
}

/* ---- Content pages ---- */
.content-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}
.content-hero {
  max-width: 720px;
  margin-bottom: 2rem;
}
.content-hero .eyebrow {
  color: var(--maple);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .55rem;
}
.content-hero h1 {
  font-size: 2.2rem;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: .75rem;
}
.content-hero p {
  color: var(--muted);
  font-size: 1rem;
}
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}
.content-grid article,
.policy-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.content-grid h2,
.policy-card h2 {
  font-size: 1rem;
  margin-bottom: .35rem;
}
.content-grid p,
.policy-card p {
  color: #4b5563;
  font-size: .92rem;
  line-height: 1.65;
}
.policy-card {
  max-width: 760px;
}
.policy-section { margin-bottom: 1.25rem; }
.policy-section:last-child { margin-bottom: 0; }
.policy-section h2 { margin-bottom: .35rem; }
.policy-section ul { margin: .35rem 0 0 1.25rem; color: #4b5563; font-size: .92rem; line-height: 1.65; }
.policy-section li { margin-bottom: .2rem; }
.article-icon { color: var(--maple); margin-bottom: .5rem; }
.content-cta {
  margin-top: 2.5rem;
  text-align: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.content-cta h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: .35rem; }
.content-cta p { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; line-height: 1.5; }
.cta-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.cta-actions .btn { display: inline-flex; align-items: center; gap: .4rem; }

/* ---- Status pages (confirmed, unsubscribed, etc.) ---- */
.status-page { max-width: 480px; margin: 0 auto; padding: 3rem 1rem; text-align: center; }
.status-page .status-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.status-page h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: .5rem; }
.status-page p { color: var(--muted); font-size: .9rem; line-height: 1.5; margin-bottom: .5rem; }
.status-page .action { margin-top: 1.25rem; }

/* ---- Toast notifications ---- */
.toast {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1rem .7rem .85rem; border-radius: var(--radius);
  font-size: .85rem; font-weight: 500; line-height: 1.3;
  box-shadow: 0 4px 24px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.08);
  animation: toast-in .3s ease-out;
  max-width: min(480px, calc(100vw - 2rem));
}
.toast.notice { background: #fff; color: var(--green); border: 1px solid var(--green-bg); }
.toast.alert  { background: #fff; color: var(--maple); border: 1px solid var(--maple-soft); }
.toast svg { flex-shrink: 0; }
.toast span { flex: 1; color: var(--text); }
.toast-close {
  background: none; border: none; cursor: pointer; font-size: 1.1rem;
  color: var(--muted); padding: 0 0 0 .25rem; line-height: 1;
}
.toast-close:hover { color: var(--text); }
.toast-out { animation: toast-out .3s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-.75rem); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(-50%) translateY(0); } to { opacity: 0; transform: translateX(-50%) translateY(-.75rem); } }

/* ---- Empty state ---- */
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; font-size: .9rem; line-height: 1.6; }

/* ---- Breadcrumbs ---- */
.breadcrumbs { font-size: .82rem; color: var(--muted); margin-bottom: 1rem; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); text-decoration: none; font-weight: 500; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .sep { color: var(--faint); }

/* ---- Browse / SEO pages ---- */
.browse-header { margin-bottom: 1.25rem; }
.browse-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: .25rem; }
.browse-subtitle { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.browse-related { margin-top: 2.5rem; }
.browse-related h2 { font-size: .95rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .6rem; }

/* ---- Shop profile (public) ---- */
.shop-profile { margin-bottom: 1.25rem; }
.shop-profile h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: .25rem; }
.shop-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .88rem; color: var(--muted); }

/* ---- Mobile tweaks ---- */
@media (max-width: 600px) {
  .wrap { padding: 1rem .75rem 2rem; }
  .filters { padding: .65rem; }
  .filters .search-wrap { flex-basis: 100%; }
  .filter-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .15rem;
    width: 100%;
    max-width: 100%;
  }
  .results-bar { align-items: flex-start; flex-direction: column; gap: .35rem; }
  .offer-list { grid-template-columns: 1fr; }
  .offer-card { padding: .85rem 1rem; }
  .offer-detail { padding: 1.15rem; grid-template-columns: 1fr; gap: 1.1rem; }
  .offer-detail h1 { font-size: 1.45rem; }
  .shop-panel { border-left: 0; border-top: 1px solid var(--line); padding: 1rem 0 0; }
  .form-page { padding: 1.5rem 1rem 2rem; }
  .auth-page { padding: 1.5rem .75rem 2rem; }
  .auth-panel { grid-template-columns: 1fr; gap: 1.25rem; }
  .auth-copy h1 { font-size: 1.55rem; max-width: 22rem; }
  .auth-copy p { font-size: .92rem; }
  .auth-card { padding: 1rem; }
  .content-page { padding: 1.5rem .75rem 2.5rem; }
  .content-hero h1 { font-size: 1.55rem; }
  .content-grid { grid-template-columns: 1fr; }
}
