/* ============================================================
 * Go Go Fun Learning — Build Your Own Bundle
 * Brand tokens sourced from the GGFL Design System (gogo-learning-club).
 * Grandma-proof: 18px base, ≥52px touch targets, no hover-only info.
 * ============================================================ */
:root {
  /* Brand core */
  --gg-coral: #ff6a45;
  --gg-coral-deep: #e8542f;
  --gg-coral-bright: #ff7d5a;
  --gg-gold: #ffc94d;
  --gg-gold-deep: #f0ab1f;
  --gg-ink: #2a0a52;
  --gg-ink-soft: #574766;
  --gg-muted: #6d6277;
  --gg-green: #3fa06a;
  --gg-green-text: #2b7a4f;
  --gg-mint: #eaf7ef;
  --gg-cream: #fdf6ec;
  --gg-cream-2: #fbeeda;
  --gg-cream-soft: #fff4e1;
  --gg-paper: #ffffff;
  --gg-lavender: #f3edff;
  --gg-line: #efe4d4;
  --gg-sky: #58b6e6;

  --grad-coral: linear-gradient(180deg, var(--gg-coral-bright), var(--gg-coral-deep));
  --grad-gold: linear-gradient(180deg, var(--gg-gold), var(--gg-gold-deep));

  --font-display: 'Baloo 2', 'Nunito', ui-rounded, system-ui, sans-serif;
  --font-body: 'Nunito', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(42, 10, 82, 0.06);
  --shadow-md: 0 12px 34px rgba(42, 10, 82, 0.10);
  --shadow-lg: 0 26px 64px rgba(42, 10, 82, 0.16);
  --shadow-cta: 0 10px 26px rgba(232, 84, 47, 0.34);

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur: 160ms;

  --wrap: 1140px;
  --barh: 0px; /* set by JS when the sticky bar is visible */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--gg-cream);
  color: var(--gg-ink);
  font-size: 18px;
  line-height: 1.6;
  padding-bottom: calc(var(--barh) + env(safe-area-inset-bottom));
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; margin: 0; line-height: 1.12; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
.wrap { width: min(var(--wrap), calc(100% - 32px)); margin: 0 auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Announcement + header ---------- */
.announce {
  background: var(--grad-gold);
  color: var(--gg-ink);
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  padding: 10px 16px;
}
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--gg-line);
}
.topbar-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 42px; height: 42px; }
.brand b { font-family: var(--font-display); font-size: 19px; font-weight: 800; color: var(--gg-coral); line-height: 0.95; white-space: nowrap; }
@media (max-width: 419px) { .brand b { font-size: 16px; } .brand small { font-size: 10px; } }
.brand small { display: block; color: var(--gg-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.topbar .help { font-size: 15px; font-weight: 800; color: var(--gg-ink-soft); text-decoration: none; white-space: nowrap; }
.topbar .help:hover { color: var(--gg-ink); }

/* ---------- Hero ---------- */
.hero {
  padding: 34px 0 26px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 201, 77, 0.30), transparent 60%),
    radial-gradient(700px 500px at -10% 20%, rgba(255, 106, 69, 0.12), transparent 60%),
    var(--gg-cream-2);
  border-bottom: 1px solid var(--gg-line);
  text-align: center;
}
.hero h1 { font-size: clamp(34px, 5vw, 52px); }
.hero .sub { color: var(--gg-ink-soft); font-size: clamp(18px, 2.4vw, 21px); max-width: 620px; margin: 12px auto 0; }
.tier-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin: 22px auto 4px; padding: 0; list-style: none;
}
@media (max-width: 619px) {
  .tier-chips { display: grid; grid-template-columns: 1fr 1fr; max-width: 420px; }
  .tier-chips li { text-align: center; padding: 10px 8px; }
}
.tier-chips li {
  background: var(--gg-paper);
  border: 2px solid var(--gg-line);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-weight: 800;
  font-size: 15px;
  color: var(--gg-ink-soft);
  transition: all var(--dur) var(--ease);
}
.tier-chips li b { color: var(--gg-ink); }
.tier-chips li.hit {
  background: var(--gg-mint);
  border-color: var(--gg-green);
  color: var(--gg-green-text);
}
.tier-chips li.hit b { color: var(--gg-green-text); }
.tier-chips li.next {
  border-color: var(--gg-gold-deep);
  background: var(--gg-cream-soft);
}
.hero .ship-note { font-size: 15px; font-weight: 700; color: var(--gg-ink-soft); margin-top: 10px; }
.hero .ship-note b { color: var(--gg-green-text); }

/* ---------- Section tabs (anchor-scroll) ---------- */
.tabs-bar {
  position: sticky; top: 64px; z-index: 35;
  background: rgba(253, 246, 236, 0.98);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gg-line);
  padding: 10px 0;
}
.tabs {
  display: flex; gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.tabs::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .tabs { justify-content: center; } }
.tabs a { flex: 0 0 auto; white-space: nowrap; }
.tabs a {
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  color: var(--gg-ink-soft);
  background: var(--gg-paper);
  border: 2px solid var(--gg-line);
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  min-height: 48px;
  display: inline-flex; align-items: center;
  transition: all var(--dur) var(--ease);
}
.tabs a:hover { transform: translateY(-2px); }
.tabs a.active {
  background: var(--grad-coral);
  border-color: var(--gg-coral-deep);
  color: #fff;
  box-shadow: var(--shadow-cta);
}

.tabs-hint { text-align: center; font-size: 13.5px; font-weight: 800; color: var(--gg-muted); margin: 0 0 8px; }

/* ---------- Catalog sections ---------- */
.cat-section { padding: 34px 0 10px; scroll-margin-top: 140px; }
.cat-section header { text-align: center; margin-bottom: 18px; }
.cat-section .eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--gg-coral-deep);
  background: rgba(255, 106, 69, 0.10);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
}
.cat-section h2 { font-size: clamp(26px, 3.4vw, 33px); margin-top: 10px; }
.cat-section .cat-lead { color: var(--gg-ink-soft); max-width: 560px; margin: 8px auto 0; font-size: 17px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1020px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  background: var(--gg-paper);
  border: 1px solid var(--gg-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card.in-bundle { border: 2px solid var(--gg-green); }
.card .imgbox { position: relative; background: var(--gg-cream-soft); padding-bottom: 100%; height: 0; }
.card .imgbox img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.card .picked-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--gg-green); color: #fff;
  font-size: 13px; font-weight: 900;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  display: none;
}
.card.in-bundle .picked-badge { display: inline-block; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 17px; line-height: 1.2; min-height: 2.4em; }
.card .meta { font-size: 14px; font-weight: 700; color: var(--gg-muted); }
.card .price { font-size: 18px; font-weight: 900; }
.card .price .was { color: var(--gg-muted); text-decoration: line-through; font-weight: 700; font-size: 15px; margin-right: 6px; display: none; }
.card .price .save-tag {
  display: none;
  background: var(--gg-mint); color: var(--gg-green-text);
  font-size: 13px; font-weight: 900;
  border-radius: var(--radius-pill);
  padding: 3px 9px; margin-left: 6px; vertical-align: 2px;
}
body.tier-active .card .price .was,
body.tier-active .card .price .save-tag { display: inline-block; }

.card .actions { margin-top: auto; }
.add-btn {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--grad-coral);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  box-shadow: var(--shadow-cta);
  transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.add-btn:hover { transform: translateY(-2px); filter: brightness(1.04); }
.add-btn:active { transform: translateY(0); }
.stepper {
  display: none;
  align-items: center; justify-content: space-between;
  background: var(--gg-mint);
  border: 2px solid var(--gg-green);
  border-radius: var(--radius-pill);
  min-height: 52px;
  padding: 4px;
}
.stepper button {
  width: 46px; height: 44px;
  border: 0; border-radius: var(--radius-pill);
  background: #fff;
  color: var(--gg-green-text);
  font-size: 24px; font-weight: 900;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}
.stepper .qty { font-size: 18px; font-weight: 900; color: var(--gg-green-text); }
.card.in-bundle .add-btn {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); display: none; }
.card.in-bundle .stepper { display: flex; }

/* ---------- Trust / how-it-works / FAQ ---------- */
.band { padding: 44px 0; }
.band.alt { background: var(--gg-cream-2); border-top: 1px solid var(--gg-line); border-bottom: 1px solid var(--gg-line); }
.band h2 { text-align: center; font-size: clamp(26px, 3.4vw, 33px); margin-bottom: 24px; }
.steps { display: grid; gap: 14px; grid-template-columns: 1fr; max-width: 720px; margin: 0 auto; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--gg-paper); border: 1px solid var(--gg-line); border-radius: var(--radius);
  padding: 20px; text-align: center; box-shadow: var(--shadow-sm);
}
.step .num {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--grad-gold); color: var(--gg-ink);
  font-family: var(--font-display); font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.step h3 { font-size: 19px; }
.step p { color: var(--gg-ink-soft); font-size: 16px; margin: 6px 0 0; }

.quotes { display: grid; gap: 14px; grid-template-columns: 1fr; max-width: 980px; margin: 0 auto; }
@media (min-width: 780px) { .quotes { grid-template-columns: repeat(3, 1fr); } }
.quote {
  background: var(--gg-paper); border: 1px solid var(--gg-line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); margin: 0;
}
.quote .stars { color: var(--gg-gold-deep); font-size: 15px; letter-spacing: 2px; }
.quote p { font-size: 16.5px; margin: 8px 0 10px; }
.quote footer { font-size: 13.5px; font-weight: 800; color: var(--gg-muted); }

.assure { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin-top: 26px; }
.assure span { font-size: 14.5px; font-weight: 800; color: var(--gg-ink-soft); }
.assure b { color: var(--gg-green); }

.faq { max-width: 720px; margin: 0 auto; }
.faq details {
  background: var(--gg-paper); border: 1px solid var(--gg-line); border-radius: var(--radius);
  padding: 4px 20px; margin-bottom: 10px;
}
.faq summary { font-weight: 900; font-size: 17px; padding: 14px 0; cursor: pointer; list-style-position: outside; }
.faq p { color: var(--gg-ink-soft); margin: 0 0 16px; font-size: 16.5px; }

/* ---------- Sticky savings bar ---------- */
.savings-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--gg-paper);
  border-top: 2px solid var(--gg-line);
  box-shadow: 0 -12px 34px rgba(42, 10, 82, 0.12);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  visibility: hidden;
  transition: transform 240ms var(--ease), visibility 0s linear 240ms;
}
.savings-bar.show { transform: translateY(0); visibility: visible; transition-delay: 0s; }
.savings-bar .inner { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; gap: 12px; }
@media (max-width: 619px) {
  .savings-bar .inner { flex-direction: column; align-items: stretch; gap: 8px; }
  .savings-bar .line1 { white-space: normal; text-align: center; }
  .savings-bar .line2 { text-align: center; }
  .review-btn { width: 100%; }
}
.savings-bar .sums { flex: 1; min-width: 0; }
.savings-bar .line1 { font-weight: 900; font-size: 16.5px; }
@media (min-width: 620px) { .savings-bar .line1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
.savings-bar .line1 .was { color: var(--gg-muted); text-decoration: line-through; font-weight: 700; margin-right: 5px; }
.savings-bar .line1 .save { color: var(--gg-green-text); }
.savings-bar .line2 { font-size: 14px; font-weight: 800; color: var(--gg-ink-soft); }
.savings-bar .line2.unlocked { color: var(--gg-green-text); }
.review-btn {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  border: 0; border-radius: var(--radius-pill);
  background: var(--grad-coral); color: #fff;
  min-height: 54px; padding: 0 22px;
  font-size: 17px; font-weight: 900;
  box-shadow: var(--shadow-cta);
  white-space: nowrap;
}
.review-btn .count-pill {
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  padding: 2px 10px; margin-left: 6px;
}

/* ---------- Bundle drawer ---------- */
.overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60;
  background: rgba(25, 1, 50, 0.45);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms var(--ease);
}
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 70;
  background: var(--gg-cream);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  /* mobile: bottom sheet */
  left: 0; right: 0; bottom: 0;
  max-height: 88vh; /* fallback */
  max-height: 88dvh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transform: translateY(105%);
  visibility: hidden;
  transition: transform 260ms var(--ease), visibility 0s linear 260ms;
}
.drawer.show { transform: translateY(0); visibility: visible; transition-delay: 0s; }
@media (min-width: 720px) {
  .drawer {
    top: 0; bottom: 0; left: auto; right: 0;
    width: 440px; max-height: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    transform: translateX(105%);
  }
  .drawer.show { transform: translateX(0); }
}
.drawer header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 10px;
}
.drawer header h2 { font-size: 22px; }
.drawer .close {
  border: 0; background: var(--gg-paper);
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 20px; font-weight: 900; color: var(--gg-ink-soft);
  box-shadow: var(--shadow-sm);
}
.drawer .meters { padding: 0 20px 12px; display: grid; gap: 10px; }
.meter { background: var(--gg-paper); border: 1px solid var(--gg-line); border-radius: var(--radius-sm); padding: 10px 12px; }
.meter .label { font-size: 14px; font-weight: 800; color: var(--gg-ink-soft); display: flex; justify-content: space-between; gap: 8px; }
.meter .label.unlocked { color: var(--gg-green-text); }
.meter .track { height: 10px; border-radius: var(--radius-pill); background: var(--gg-cream-2); margin-top: 7px; overflow: hidden; position: relative; }
.meter .fill { height: 100%; border-radius: var(--radius-pill); background: var(--gg-gold-deep); width: 0%; transition: width 300ms var(--ease); }
.meter.ship .fill { background: linear-gradient(90deg, var(--gg-sky), var(--gg-green)); }
.meter .ticks { position: absolute; inset: 0; }
.meter .ticks i { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(42, 10, 82, 0.28); z-index: 1; }

.drawer .items { flex: 1; overflow-y: auto; padding: 4px 20px; }
.drawer .empty { text-align: center; color: var(--gg-ink-soft); padding: 30px 10px; font-weight: 700; }
.ditem {
  display: flex; align-items: center; gap: 12px;
  background: var(--gg-paper); border: 1px solid var(--gg-line); border-radius: var(--radius-sm);
  padding: 8px; margin-bottom: 8px;
}
.ditem img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--gg-cream-soft); }
.ditem .t { flex: 1; min-width: 0; }
.ditem .t b { display: block; font-size: 15.5px; line-height: 1.25; }
.ditem .t span { font-size: 13.5px; font-weight: 800; color: var(--gg-muted); }
.ditem .stepper { display: flex; min-height: 50px; padding: 3px; }
.ditem .stepper button { width: 44px; height: 44px; font-size: 22px; }
.ditem .stepper .qty { min-width: 22px; text-align: center; font-size: 16px; }

.drawer .checkout-zone {
  border-top: 1px solid var(--gg-line);
  background: var(--gg-paper);
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
}
.drawer .totals { display: flex; justify-content: space-between; align-items: baseline; font-weight: 900; font-size: 18px; }
.drawer .totals .was { color: var(--gg-muted); text-decoration: line-through; font-weight: 700; font-size: 15.5px; margin-right: 7px; }
.drawer .saveline { color: var(--gg-green-text); font-weight: 900; font-size: 15.5px; margin-top: 2px; }
.drawer .nudge {
  background: var(--gg-cream-soft); border: 1px dashed var(--gg-gold-deep); border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 800; color: var(--gg-ink-soft);
  padding: 9px 12px; margin-top: 10px;
}
.checkout-btn {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 58px; margin-top: 12px;
  line-height: 1.25; text-align: center; padding: 10px 18px;
  border: 0; border-radius: var(--radius-pill);
  background: var(--grad-coral); color: #fff;
  font-size: 18.5px; font-weight: 900;
  box-shadow: var(--shadow-cta);
  text-decoration: none;
}
.checkout-btn[aria-disabled="true"] { filter: grayscale(0.5) opacity(0.6); pointer-events: none; }
.drawer .secure-note { text-align: center; font-size: 15px; font-weight: 700; color: var(--gg-muted); margin-top: 9px; }

/* ---------- Footer ---------- */
.footer { padding: 36px 0 46px; text-align: center; color: var(--gg-ink-soft); font-size: 14.5px; }
.footer a { color: var(--gg-coral-deep); font-weight: 800; }
.footer .fine { color: var(--gg-muted); font-size: 14px; max-width: 640px; margin: 10px auto 0; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
