/* =========================================================
   Sad Spending Club — styles
   Aesthetic: hand-drawn, refrigerator-magnet, Lisa Frank's
   depressed cousin. Imperfect, cheerful, slightly resigned.
   ========================================================= */

:root {
  /* Palette (from brand brief) */
  --banana:   #F9D65C; /* primary accent, happy but chaotic */
  --pink:     #FF7BA7; /* hand-colored feel */
  --blue:     #65C7E8; /* friendly, trust */
  --green:    #79C96B; /* charity / donation messaging */
  --orange:   #FF9B42; /* accent */
  --ink:      #333333; /* body text */
  --paper:    #FFF9EE; /* background */

  --ink-soft: #5b5b5b;
  --shadow:   rgba(51, 51, 51, 0.18);

  --radius:   18px;
  --maxw:     1080px;

  --font-head: "Patrick Hand", "Comic Sans MS", cursive;
  --font-accent: "Gloria Hallelujah", "Patrick Hand", cursive;
  --font-body: "Nunito", system-ui, sans-serif;
}

/* ----------------------- base ----------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  /* faint notebook texture: very light dotted grid */
  background-image: radial-gradient(rgba(51,51,51,0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .head { font-family: var(--font-head); font-weight: 400; line-height: 1.1; }
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); margin: 0 0 .2em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 .4em; }
h3 { font-size: 1.5rem; margin: 0 0 .3em; }

a { color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.center { text-align: center; }
.muted { color: var(--ink-soft); }
.tiny { font-size: .85rem; }

/* hand-drawn wobble underline used on accents */
.scribble {
  text-decoration: none;
  background-image: linear-gradient(transparent 60%, var(--banana) 60%);
  background-repeat: no-repeat;
  padding: 0 .1em;
}

/* ----------------------- buttons ----------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-head);
  font-size: 1.25rem;
  padding: .55em 1.2em;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--banana);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 3px 4px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease;
  /* slight hand-drawn tilt */
  transform: rotate(-.6deg);
}
.btn:hover { transform: rotate(0deg) translateY(-1px); box-shadow: 4px 6px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 1px 2px 0 var(--ink); }
.btn.pink  { background: var(--pink); }
.btn.blue  { background: var(--blue); }
.btn.green { background: var(--green); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { font-size: 1rem; padding: .4em .9em; box-shadow: 2px 3px 0 var(--ink); }

/* ----------------------- header ----------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 3px dashed var(--ink);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 42px; height: 42px; flex: none; }
.brand b { font-family: var(--font-head); font-size: 1.5rem; line-height: 1; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { font-family: var(--font-head); font-size: 1.2rem; text-decoration: none; }
.nav a:hover { color: var(--pink); }

.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--ink);
}
.cart-btn svg { width: 30px; height: 30px; }
.cart-count {
  position: absolute;
  top: -4px; right: -6px;
  background: var(--pink);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: .75rem;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

/* ----------------------- hero ----------------------- */
.hero { padding: 56px 0 36px; text-align: center; }
.hero .mark { width: clamp(96px, 22vw, 150px); height: auto; margin: 0 auto 6px; display: block; }
.hero .tagline {
  font-family: var(--font-accent);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--pink);
  margin: 0 0 10px;
}
.hero .sub { font-size: 1.15rem; max-width: 560px; margin: 0 auto 26px; }
.rotator { min-height: 1.6em; }

/* ----------------------- sections / cards ----------------------- */
section { padding: 40px 0; }

.card {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 5px 6px 0 var(--shadow);
  padding: 26px;
}

/* price comparison */
.compare {
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 7px 0 var(--ink);
  padding: 28px;
  transform: rotate(-.5deg);
}
.compare h2 { margin-bottom: .2em; }

/* desktop-only column headers above the two sides */
.compare-heads {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px 18px;
  margin-top: 20px;
  font-family: var(--font-head);
  font-size: 1.2rem;
}
.compare-heads .left  { text-align: right; color: #234; }
.compare-heads .right { text-align: left; }

/* each comparison is a self-contained pair: meh | vs | better */
.compare-pairs { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.compare-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px 18px;
  align-items: center;
}
.compare-pair .meh  { text-align: right; color: #2a4a55; }
.compare-pair .good { text-align: left; font-weight: 800; }
.compare-pair .vs {
  font-family: var(--font-accent);
  color: var(--ink);
  background: var(--banana);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: .9rem;
  white-space: nowrap;
}

/* cause block */
.cause {
  display: flex;
  gap: 22px;
  align-items: center;
  background: var(--green);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 7px 0 var(--ink);
  padding: 26px;
  transform: rotate(.4deg);
}
.cause svg { width: 120px; height: 120px; flex: none; }
.cause .pct {
  font-family: var(--font-head);
  font-size: 1.4rem;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 2px 14px;
  display: inline-block;
  margin-top: 6px;
}

/* product grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 26px;
}
/* shop layout: centered, wraps + stays centered for any number of cards */
.shop-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 26px;
}
.shop-grid .product-card { flex: 0 1 300px; max-width: 340px; }
.product-card {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 5px 6px 0 var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .1s ease;
}
.product-card:hover { transform: translateY(-3px) rotate(-.4deg); }
.product-card .thumb {
  background: var(--banana);
  border-bottom: 3px solid var(--ink);
  display: grid;
  place-items: center;
  padding: 22px;
}
.product-card .thumb svg { width: 160px; height: 160px; }
.product-card .body { padding: 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .name { font-family: var(--font-head); font-size: 1.4rem; }
.product-card .price { font-family: var(--font-head); font-size: 1.3rem; color: var(--pink); }
.product-card .supports { font-size: .9rem; color: var(--ink-soft); }
.product-card .btn { margin-top: auto; align-self: flex-start; }

/* ----------------------- product page ----------------------- */
.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.product .visual {
  background: var(--banana);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 7px 0 var(--ink);
  display: grid;
  place-items: center;
  padding: 40px;
  transform: rotate(-.5deg);
}
.product .visual svg { width: min(320px, 70vw); height: auto; }
.product .price-big { font-family: var(--font-head); font-size: 2.4rem; color: var(--pink); margin: 0; }

.list-includes, .list-excludes { list-style: none; padding: 0; margin: 8px 0; }
.list-includes li, .list-excludes li { margin: 4px 0; }
.list-includes li::before { content: "✔"; color: var(--green); font-weight: 900; margin-right: 8px; }
.list-excludes li { color: var(--ink-soft); }
.list-excludes li::before { content: "✘"; color: var(--pink); font-weight: 900; margin-right: 8px; }

.cause-callout {
  background: var(--green);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
}
.cause-callout strong { font-family: var(--font-head); font-size: 1.2rem; }

.sizes { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 18px; }
.size-opt {
  font-family: var(--font-head);
  font-size: 1.1rem;
  border: 3px solid var(--ink);
  background: #fff;
  border-radius: 12px;
  width: 54px; height: 48px;
  cursor: pointer;
  transition: transform .08s ease;
}
.size-opt:hover { transform: translateY(-2px); }
.size-opt.active { background: var(--pink); color: #fff; box-shadow: 2px 3px 0 var(--ink); }

/* ----------------------- cart drawer ----------------------- */
.scrim {
  position: fixed; inset: 0;
  background: rgba(51,51,51,.45);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 50;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--paper);
  border-left: 3px solid var(--ink);
  z-index: 60;
  transform: translateX(105%);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 3px dashed var(--ink);
}
.drawer header h3 { margin: 0; }
.drawer .items { flex: 1; overflow-y: auto; padding: 14px 20px; }
.drawer footer { border-top: 3px dashed var(--ink); padding: 18px 20px; }

.close-x { background: none; border: none; cursor: pointer; font-size: 1.6rem; font-family: var(--font-head); }

.line-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px dotted var(--ink); }
.line-item .li-thumb { width: 54px; height: 54px; background: var(--banana); border: 2px solid var(--ink); border-radius: 10px; display: grid; place-items: center; flex: none; }
.line-item .li-thumb svg { width: 36px; height: 36px; }
.line-item .li-name { font-family: var(--font-head); font-size: 1.1rem; line-height: 1.1; }
.line-item .li-meta { font-size: .85rem; color: var(--ink-soft); }
.line-item .li-price { margin-left: auto; font-weight: 800; }
.qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.qty button { width: 24px; height: 24px; border: 2px solid var(--ink); background: #fff; border-radius: 6px; cursor: pointer; font-weight: 800; line-height: 1; }
.remove { background: none; border: none; color: var(--pink); cursor: pointer; font-size: .8rem; text-decoration: underline; margin-left: 8px; }

.cart-totals { display: flex; justify-content: space-between; margin: 4px 0; }
.cart-totals.donation { color: #2f6b27; font-weight: 800; }
.cart-totals.total { font-family: var(--font-head); font-size: 1.4rem; }

.empty-cart { text-align: center; color: var(--ink-soft); padding: 40px 10px; }
.empty-cart svg { width: 110px; height: 110px; margin-bottom: 10px; }

/* ----------------------- modal (mock checkout) ----------------------- */
.modal {
  position: fixed; inset: 0;
  display: none;
  place-items: center;
  z-index: 70;
  padding: 20px;
}
.modal.open { display: grid; }
.modal .sheet {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 8px 10px 0 var(--ink);
  max-width: 460px; width: 100%;
  padding: 26px;
  position: relative;
}
.mock-badge {
  display: inline-block;
  background: var(--orange);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-head);
  padding: 2px 12px;
  font-size: .85rem;
  margin-bottom: 10px;
}
.field { margin: 10px 0; }
.field label { font-family: var(--font-head); font-size: 1rem; display: block; margin-bottom: 2px; }
.field input {
  width: 100%; padding: 10px 12px;
  border: 3px solid var(--ink); border-radius: 12px;
  font-family: var(--font-body); font-size: 1rem;
  background: #fff;
}

/* ----------------------- footer ----------------------- */
.site-footer {
  border-top: 3px dashed var(--ink);
  margin-top: 40px;
  padding: 30px 0;
  text-align: center;
}
.site-footer .lines { font-family: var(--font-accent); color: var(--ink-soft); margin-bottom: 8px; }
.site-footer .nav { justify-content: center; flex-wrap: wrap; }

/* ----------------------- thank you ----------------------- */
.thanks-hero { text-align: center; padding: 56px 0 20px; }
.thanks-hero svg { width: clamp(120px, 28vw, 180px); height: auto; margin-bottom: 10px; }
.receipt {
  max-width: 420px; margin: 26px auto 0;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 5px 6px 0 var(--shadow);
  padding: 22px;
  font-family: "Nunito", monospace;
}
.receipt .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dotted var(--ink); }
.receipt .row.big { font-family: var(--font-head); font-size: 1.3rem; border-bottom: none; }
.receipt .donation { color: #2f6b27; font-weight: 800; }

/* ----------------------- responsive ----------------------- */
@media (max-width: 760px) {
  .product { grid-template-columns: 1fr; }
  .cause { flex-direction: column; text-align: center; }
  .compare-heads { display: none; }
  .compare-pair {
    grid-template-columns: 1fr;
    gap: 8px;
    justify-items: center;
    text-align: center;
    background: rgba(255,255,255,.5);
    border: 2px solid var(--ink);
    border-radius: 14px;
    padding: 16px;
  }
  .compare-pair .meh, .compare-pair .good { text-align: center; }
  .nav a.hide-sm { display: none; }
}

/* tiny floating wobble for decorative bits */
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1deg);} 50% { transform: translateY(-6px) rotate(1deg);} }
.bob { animation: bob 4s ease-in-out infinite; }
