:root {
  --yellow: #FFD000;
  --yellow-soft: #FFF3A8;
  --magenta: #E11D74;
  --magenta-dark: #C01462;
  --cyan: #2EC4E0;
  --ink: #1C120C;
  --muted: #6B5346;
  --line: #F0D9B8;
  --bg: #FFF8E8;
  --surface: #ffffff;
  --danger: #B42318;
  --ok: #1B7A4A;
  --shadow: 0 10px 30px rgba(28, 18, 12, 0.12);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: Nunito, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 14px;
  background: var(--yellow);
  border-bottom: 3px solid #111;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.brand-logo { display: block; height: 42px; width: auto; max-width: 210px; object-fit: contain; }
.brand-meta { font-size: 0.72rem; font-weight: 800; color: #4a341f; white-space: nowrap; }

.icon-btn {
  position: relative; border: 2px solid #111; background: #fff; border-radius: 999px;
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
}
.icon-btn em[hidden] { display: none !important; }
.icon-btn em {
  position: absolute; top: -6px; right: -6px;
  background: var(--magenta); color: #fff; font-style: normal;
  font-size: 11px; font-weight: 800; min-width: 18px; height: 18px;
  border-radius: 999px; display: grid; place-items: center; padding: 0 4px;
  border: 2px solid #111;
}

.hero {
  margin: 14px 14px 8px;
  background: linear-gradient(145deg, #e11d74 0%, #c01462 58%, #ff6b2d 130%);
  border-radius: 22px; border: 3px solid #111; min-height: 168px;
  position: relative; overflow: hidden;
  display: flex; align-items: center;
  padding: 18px 130px 18px 16px;
}
.hero-copy { position: relative; z-index: 1; max-width: 15.5rem; }
.hero h1 { margin: 0; font-family: Fredoka, sans-serif; font-size: 1.45rem; color: #fff; line-height: 1.15; }
.hero p { margin: 6px 0 0; color: rgba(255,255,255,.95); font-size: 0.88rem; }
.hero-mascot {
  position: absolute; right: -10px; bottom: -22px;
  height: 168px; width: auto; pointer-events: none;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.12));
}
.ok-mascot, .empty-mascot {
  display: block; width: 150px; height: auto; margin: 0 auto 10px;
}
.empty-state { text-align: center; padding: 24px 10px 40px; }
.empty-state h1 { margin: 0 0 6px; }
.empty-state .empty-mascot { width: 168px; margin: 4px auto 14px; }

.notice {
  margin: 8px 14px 0; padding: 10px 12px; border-radius: 12px;
  background: #fff; border: 1.5px solid var(--line); font-size: 0.9rem;
}
.notice.warn { background: #fff4e5; border-color: #f5c16c; }
.notice.danger { background: #fdecea; border-color: #f0a8a0; color: var(--danger); }

.cats {
  position: sticky; top: 65px; z-index: 15;
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px 8px;
  background: linear-gradient(var(--bg) 80%, transparent);
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cats button {
  flex: none; border: 2px solid #111; background: #fff; border-radius: 999px;
  padding: 6px 12px; font-weight: 700; font-size: 0.88rem; cursor: pointer;
}
.cats button.active { background: var(--magenta); color: #fff; }

.section { padding: 4px 14px 8px; }
.section h2 {
  margin: 12px 0 8px; font-family: Fredoka, sans-serif; font-size: 1.2rem;
  display: flex; align-items: baseline; gap: 8px;
}
.section h2 small { font-family: Nunito, sans-serif; font-weight: 700; color: var(--muted); font-size: 0.8rem; }

.item {
  display: grid; grid-template-columns: 1fr 96px; gap: 10px;
  background: var(--surface); border: 2px solid #111; border-radius: var(--radius);
  padding: 10px; margin-bottom: 10px; cursor: pointer; text-align: left; width: 100%;
  box-shadow: 0 3px 0 #111;
}
.item.sold { opacity: 0.6; cursor: not-allowed; }
.item h3 { margin: 0 0 4px; font-size: 1.02rem; }
.item p { margin: 0; color: var(--muted); font-size: 0.82rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .price { margin-top: 8px; font-weight: 800; color: var(--magenta-dark); }
.item .thumb { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; border: 2px solid #111; background: var(--yellow-soft); }
.badge { display: inline-block; background: #111; color: #fff; font-size: 0.7rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; }

.cart-bar {
  position: sticky; bottom: 0; padding: 10px 14px 16px; background: linear-gradient(transparent, var(--bg) 30%);
}
.cart-bar button, .btn {
  width: 100%; border: 2px solid #111; background: var(--magenta); color: #fff;
  font-weight: 800; border-radius: 999px; padding: 13px 16px; cursor: pointer;
  box-shadow: 0 3px 0 #111;
}
.btn.secondary { background: #fff; color: var(--ink); }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink); width: auto; padding: 4px 8px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }

.page { padding: 14px 14px 40px; }
.page h1 { font-family: Fredoka, sans-serif; margin: 0 0 12px; font-size: 1.6rem; }

.cart-line {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 10px;
  background: #fff; border: 2px solid #111; border-radius: 16px; padding: 10px; margin-bottom: 10px;
}
.cart-line img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 1.5px solid #111; }
.cart-line h3 { margin: 0; font-size: 0.98rem; }
.cart-line .opts { margin: 2px 0 0; color: var(--muted); font-size: 0.8rem; }
.qty { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 2px solid #111; background: var(--yellow); font-weight: 800; cursor: pointer; }
.totals { background: #fff; border: 2px solid #111; border-radius: 16px; padding: 12px; margin: 12px 0; }
.totals div { display: flex; justify-content: space-between; gap: 10px; margin: 4px 0; align-items: flex-start; }
.totals div > span:last-child { text-align: right; }
.totals .stack { display: block; }
.totals .stack span { display: block; text-align: left; max-width: 100%; }
.totals .grand { font-weight: 800; font-size: 1.1rem; border-top: 1.5px dashed var(--line); padding-top: 8px; margin-top: 8px; }

.sheet[hidden] { display: none !important; }
.sheet {
  position: fixed; inset: 0; background: rgba(28,18,12,.45); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet .panel {
  background: var(--bg); width: min(520px, 100%); max-height: 92dvh; overflow: auto;
  border-radius: 24px 24px 0 0; border-top: 3px solid #111; padding-bottom: 20px;
}
.sheet .photo { width: 100%; height: 200px; object-fit: cover; background: var(--magenta); }
.sheet .body { padding: 14px; }
.sheet h2 { margin: 0 0 6px; font-family: Fredoka, sans-serif; }
.close-x {
  position: absolute; right: 12px; top: 12px; width: 36px; height: 36px;
  border-radius: 999px; border: 2px solid #111; background: #fff; font-weight: 800; cursor: pointer;
}
.group { margin: 14px 0; }
.group h3 { margin: 0 0 8px; font-size: 0.95rem; }
.opt {
  display: flex; align-items: flex-start; gap: 10px;
  border: 2px solid #111; background: #fff; border-radius: 14px; padding: 10px 12px; margin-bottom: 8px;
}
.opt input { margin-top: 3px; accent-color: var(--magenta); width: 18px; height: 18px; }
.opt.sold { opacity: 0.55; }
.opt .grow { flex: 1; }
.opt .pr { font-weight: 800; }

label.field, .field { display: block; margin: 12px 0; }
.field span, .field > .lbl { display: block; font-weight: 800; font-size: 0.86rem; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; border: 2px solid #111; border-radius: 12px; padding: 10px 12px; background: #fff;
}
.field textarea { min-height: 80px; resize: vertical; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 14px; }
.seg button {
  border: 2px solid #111; background: #fff; border-radius: 14px; padding: 10px; font-weight: 800; cursor: pointer;
}
.seg button.on { background: var(--yellow); }
.pay { display: grid; gap: 8px; }
.pay label {
  display: flex; gap: 10px; align-items: center; border: 2px solid #111; border-radius: 14px; padding: 10px 12px; background: #fff;
}
.pay label.disabled { opacity: 0.55; }
.error { color: var(--danger); font-weight: 700; font-size: 0.9rem; margin: 8px 0; }
.ok-card {
  text-align: center; background: #fff; border: 3px solid #111; border-radius: 22px; padding: 22px 16px; margin: 8px 0 16px;
}
.ok-card .tick { font-size: 2rem; }
.ok-card h1 { margin: 8px 0 4px; }
.ok-card .btn { margin-top: 14px; }
.code { font-family: Fredoka, sans-serif; font-size: 1.6rem; color: var(--magenta-dark); }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.muted { color: var(--muted); font-size: 0.9rem; }
.footer-note { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 20px 14px 40px; }
#square-card { min-height: 90px; margin: 8px 0; background: #fff; border: 2px solid #111; border-radius: 12px; padding: 10px 12px; }

.hero-rating { margin-top: 6px; font-weight: 700; }
.hero-rating a { color: inherit; text-decoration: none; }
.store-info { display: grid; gap: 4px; text-align: center; font-style: normal; color: var(--muted); font-size: 0.85rem; padding: 24px 14px 48px; }
.store-info strong { color: var(--ink, #1a1a1a); font-family: Fredoka, sans-serif; font-size: 1rem; }
.store-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.store-links a { color: #0b5cab; font-weight: 700; }
.review-summary { font-weight: 800; margin: 0 0 12px; }
.review { background: #fff; border-radius: 16px; padding: 14px 16px; margin: 0 0 10px; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.review header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.review .stars { color: #c48a00; letter-spacing: 1px; font-size: 0.9rem; }
.review p { margin: 8px 0 0; }

.upsell-section { margin: 16px 0 8px; }
.upsell-section h2 { font-family: Fredoka, sans-serif; font-size: 1.15rem; margin: 0 0 8px; }
.upsell-item {
  background: #fff; border: 2px solid #111; border-radius: 16px;
  padding: 10px; margin-bottom: 10px;
}
.upsell-head { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.upsell-head img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 1.5px solid #111; }
.upsell-head h3 { margin: 0; font-size: 1rem; }
.upsell-item .btn { margin-top: 4px; }
.upsell-item .group { margin: 8px 0; }
