/* ===========================================================================
   MBSGG SNAX
   An independent snack window. Cream paper, grape ink, candy accents.
   =========================================================================== */

:root {
  /* Ground */
  --ink:        #2a0e45;
  --ink-70:     #5b4470;
  --ink-50:     #7d6b90;
  --cream:      #fff7ee;
  --cream-deep: #ffedd9;
  --paper:      #ffffff;

  /* Candy */
  --cherry:     #e0004d;
  --cherry-ink: #b0003c;
  --tang:       #ff9e1b;
  --butter:     #ffe08a;
  --bubble:     #ff7ac0;
  --mint:       #00a878;
  --mint-soft:  #c9f4e4;
  --grape:      #7b3fa0;
  --sky:        #2f5bea;

  --line:       #2a0e45;
  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     4px 4px 0 var(--line);
  --shadow-sm:  3px 3px 0 var(--line);
  --shadow-lg:  7px 7px 0 var(--line);

  --wrap:       1180px;
  --gap:        clamp(12px, 2.2vw, 22px);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 100;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  text-wrap: balance;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(14px, 4vw, 28px); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--cream); padding: 12px 18px; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }

/* --- Candy stripe rule ---------------------------------------------------- */

.stripe {
  height: 10px;
  background: repeating-linear-gradient(
    -45deg,
    var(--cherry) 0 14px,
    var(--butter) 14px 28px,
    var(--bubble) 28px 42px,
    var(--mint) 42px 56px
  );
  border-block: 2px solid var(--line);
}

/* --- Affiliate disclosure ------------------------------------------------- */
/* Rendered server-side, never injected. Body-size type, high contrast,
   first thing in the document so it is above the fold on a 360px screen. */

.disclosure-bar {
  background: var(--butter);
  border-bottom: 2px solid var(--line);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
}
.disclosure-bar p { margin: 0; padding: 11px 0; }
.disclosure-bar strong { font-weight: 800; }
.disclosure-bar a { color: var(--ink); text-underline-offset: 3px; }

.disclosure-inline {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--cream-deep);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 var(--gap);
  font-size: 1rem;
  line-height: 1.45;
}
.disclosure-inline svg { flex: none; margin-top: 2px; }
.disclosure-inline p { margin: 0; }

/* --- Header --------------------------------------------------------------- */

.masthead {
  background: var(--cream);
  border-bottom: 2px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.masthead__top {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px clamp(10px, 3vw, 28px);
  padding-block: 11px;
}
/* On a phone the search gets its own full-width row rather than being squeezed
   into a 120px sliver next to the wordmark. */
@media (max-width: 619px) {
  .search { order: 3; flex-basis: 100%; }
  .masthead__top { padding-bottom: 12px; }
}

.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.logo svg { width: 38px; height: auto; }
.logo__text { display: flex; flex-direction: column; line-height: .92; }
.logo__a {
  font-family: var(--font-display); font-weight: 900;
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144;
  font-size: 1.32rem; letter-spacing: -0.025em;
}
.logo__b {
  font-family: var(--font-body); font-weight: 800;
  font-size: .66rem; letter-spacing: .34em; text-transform: uppercase;
  color: var(--cherry);
}

.search { flex: 1 1 260px; min-width: 0; max-width: 520px; display: flex; margin-inline-start: auto; }
.search__field {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--paper); border: 2px solid var(--line);
  border-radius: 999px; padding: 6px 6px 6px 14px;
  box-shadow: var(--shadow-sm);
}
.search input {
  flex: 1 1 auto; min-width: 0; border: 0; background: none; font: inherit;
  font-size: .95rem; color: var(--ink); padding: 4px 0;
}
.search input::placeholder { color: var(--ink-50); }
.search input:focus { outline: none; }
.search button {
  flex: none; border: 2px solid var(--line); background: var(--cherry); color: #fff;
  font: inherit; font-weight: 700; font-size: .85rem;
  border-radius: 999px; padding: 5px 15px; cursor: pointer;
}
.search button:hover { background: var(--cherry-ink); }

.masthead__aside { flex: none; display: none; font-size: .82rem; font-weight: 600; color: var(--ink-70); text-align: right; line-height: 1.3; }
@media (min-width: 900px) { .masthead__aside { display: block; } }

/* Category rail */
.rail { border-top: 2px solid var(--line); background: var(--cream-deep); }
.rail__scroll {
  display: flex; gap: 8px; overflow-x: auto; padding-block: 9px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.rail__scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; text-decoration: none; font-size: .84rem; font-weight: 700;
  border: 2px solid var(--line); border-radius: 999px; padding: 5px 13px;
  background: var(--chip, var(--paper)); white-space: nowrap;
}
.chip:hover { background: var(--butter); }
.chip[aria-current="page"] { background: var(--ink); color: var(--cream); }
.chip--all { background: var(--bubble); }

/* --- Hero ----------------------------------------------------------------- */

.hero { padding-block: clamp(30px, 6vw, 66px); position: relative; overflow: hidden; }
.hero__grid { display: grid; gap: clamp(22px, 4vw, 46px); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 880px) { .hero__grid { grid-template-columns: 1.05fr .95fr; } }

.hero h1 {
  font-size: clamp(2.6rem, 8.5vw, 4.6rem);
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144;
  margin-bottom: .32em;
}
.hero h1 em { font-style: normal; color: var(--cherry); }
.hero__lede { font-size: clamp(1.03rem, 2.4vw, 1.18rem); max-width: 46ch; margin: 0 0 1.3em; }
.hero__lede + .hero__lede { margin-top: -.7em; }

.eyebrow {
  display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; background: var(--mint-soft); color: var(--ink);
  border: 2px solid var(--line); border-radius: 999px; padding: 5px 13px; margin-bottom: 18px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  font-family: var(--font-body); font-weight: 800; font-size: 1rem;
  border: 2px solid var(--line); border-radius: 999px; padding: 11px 22px;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
  cursor: pointer;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn--primary { background: var(--cherry); color: #fff; }
.btn--primary:hover { background: var(--cherry-ink); }
.btn--sun { background: var(--tang); }
.btn--block { width: 100%; justify-content: center; }

/* Hero collage of real product photos from the feed */
.collage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.collage a {
  display: block; border: 2px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--paper); box-shadow: var(--shadow-sm);
  aspect-ratio: 1 / 1;
}
.collage img { width: 100%; height: 100%; object-fit: cover; }
.collage a:nth-child(1) { grid-row: span 2; grid-column: span 2; aspect-ratio: auto; }
.collage a:hover { transform: rotate(-1.5deg); }

.facts { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 26px; padding-top: 20px; border-top: 2px dashed var(--ink-50); }
.fact { font-size: .9rem; font-weight: 600; display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.fact b { font-family: var(--font-display); font-size: 1.35rem; font-weight: 900; font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144; }

/* --- Sections ------------------------------------------------------------- */

.section { padding-block: clamp(30px, 5vw, 58px); }
.section--tint { background: var(--cream-deep); border-block: 2px solid var(--line); }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: clamp(16px, 3vw, 28px); }
.section__head h2 { font-size: clamp(1.75rem, 4.4vw, 2.6rem); margin: 0; }
.section__head p { margin: .35em 0 0; color: var(--ink-70); max-width: 58ch; }
.section__link { font-weight: 800; text-decoration: none; border-bottom: 3px solid var(--cherry); white-space: nowrap; }
.section__link:hover { background: var(--butter); }

.prose { max-width: 68ch; }
.prose p { margin: 0 0 1.05em; }
.prose h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-top: 1.6em; }
.prose h3 { font-size: 1.22rem; margin-top: 1.5em; }
.prose ul { padding-left: 1.15em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .4em; }
.prose a { font-weight: 600; }

.steps { display: grid; gap: var(--gap); grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 22px; box-shadow: var(--shadow);
}
.step::before {
  counter-increment: step; content: counter(step);
  font-family: var(--font-display); font-weight: 900; font-size: 2rem;
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144;
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 2px solid var(--line); border-radius: 50%; background: var(--butter);
  margin-bottom: 12px;
}
.step h3 { margin: 0 0 .35em; font-size: 1.2rem; }
.step p { margin: 0; font-size: .96rem; color: var(--ink-70); }

/* --- Category tiles ------------------------------------------------------- */

.cat-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.cat-tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 132px; padding: 15px; text-decoration: none;
  border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); background: var(--paper);
  transition: transform .12s ease, box-shadow .12s ease;
}
.cat-tile:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.cat-tile__name { font-family: var(--font-display); font-weight: 800; font-size: 1.14rem; font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 90; line-height: 1.08; }
.cat-tile__count { font-size: .82rem; font-weight: 700; color: var(--ink-70); }
.cat-tile__dot { width: 26px; height: 26px; border: 2px solid var(--line); border-radius: 50%; margin-bottom: 10px; }

/* --- Product grid --------------------------------------------------------- */

.grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); } }

.card {
  display: flex; flex-direction: column;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.card__accent { height: 6px; border-bottom: 2px solid var(--line); }
.card__media { display: block; aspect-ratio: 1 / 1; background: var(--cream); border-bottom: 2px solid var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1 1 auto; }
.card__brand { font-size: .69rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-50); }
.card__title { margin: 0; font-family: var(--font-body); font-weight: 700; font-size: .93rem; line-height: 1.3; letter-spacing: 0; }
.card__title a { text-decoration: none; }
.card__title a:hover { text-decoration: underline; text-underline-offset: 2px; }
.card__spacer { flex: 1 1 auto; }
.card__foot { display: flex; flex-direction: column; gap: 9px; }

/* Price region: empty in the HTML. Filled only by a live check. */
.price { min-height: 1.5em; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.price__now { font-family: var(--font-display); font-weight: 900; font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144; font-size: 1.28rem; letter-spacing: -.01em; }
.price__was { font-size: .86rem; color: var(--ink-50); text-decoration: line-through; }
.price__save { font-size: .72rem; font-weight: 800; background: var(--butter); border: 1.5px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.price__pending { font-size: .86rem; color: var(--ink-50); }
.price__fallback { font-size: .85rem; color: var(--ink-70); font-weight: 600; }

.stock { font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); border: 1.5px solid var(--line); }
.stock--out::before { background: var(--ink-50); }
.stock[hidden] { display: none; }

.buy {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none; text-align: center;
  font-weight: 800; font-size: .88rem; line-height: 1.2;
  background: var(--cherry); color: #fff;
  border: 2px solid var(--line); border-radius: 999px; padding: 9px 12px;
}
.buy:hover { background: var(--cherry-ink); }
.buy svg { flex: none; }

/* --- Pagination ----------------------------------------------------------- */

.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: clamp(24px, 4vw, 40px); }
.pager a, .pager span {
  min-width: 42px; text-align: center; text-decoration: none; font-weight: 700; font-size: .9rem;
  border: 2px solid var(--line); border-radius: 999px; padding: 7px 13px; background: var(--paper);
}
.pager [aria-current="page"] { background: var(--ink); color: var(--cream); }
.pager .pager__gap { border: 0; background: none; min-width: 0; padding: 7px 2px; }

/* --- Product detail ------------------------------------------------------- */

.crumbs { font-size: .84rem; font-weight: 600; color: var(--ink-70); padding-block: 16px 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li::after { content: "›"; margin-left: 6px; color: var(--ink-50); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.detail { display: grid; gap: clamp(20px, 4vw, 44px); grid-template-columns: 1fr; padding-block: clamp(20px, 3vw, 34px) clamp(30px, 5vw, 56px); }
@media (min-width: 860px) { .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }

.gallery__main { border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); box-shadow: var(--shadow); aspect-ratio: 1 / 1; }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: 9px; margin-top: 12px; flex-wrap: wrap; }
.gallery__thumbs button {
  width: 62px; height: 62px; padding: 0; cursor: pointer; background: var(--paper);
  border: 2px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
.gallery__thumbs button[aria-current="true"] { outline: 3px solid var(--cherry); outline-offset: 2px; }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 860px) { .buybox { position: sticky; top: 132px; } }
.buybox h1 { font-size: clamp(1.5rem, 3.4vw, 2.15rem); font-variation-settings: "SOFT" 45, "WONK" 1, "opsz" 100; margin-bottom: .4em; }
.buybox .brandline { font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-50); margin: 0 0 .6em; }
.buybox .brandline a { text-decoration: none; border-bottom: 2px solid var(--bubble); }

.pricebox {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-block: 20px;
}
.pricebox .price__now { font-size: 2rem; }
.pricebox .price { min-height: 2.2em; }
.pricebox .checked { font-size: .76rem; color: var(--ink-50); margin: 6px 0 0; }
.pricebox .buy { font-size: 1.05rem; padding: 13px 20px; margin-top: 14px; box-shadow: var(--shadow); }
.pricebox .buy:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }

.spec { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: 22px; }
.spec th, .spec td { text-align: left; padding: 9px 0; border-bottom: 1.5px dashed var(--ink-50); vertical-align: top; }
.spec th { width: 40%; font-weight: 800; color: var(--ink-70); }

.desc h3 { font-family: var(--font-body); font-weight: 800; font-size: 1rem; letter-spacing: .01em; margin: 1.4em 0 .4em; }
.desc p { margin: 0 0 1em; }
.desc ul { margin: 0 0 1.1em; padding-left: 0; list-style: none; }
.desc li { position: relative; padding-left: 24px; margin-bottom: .35em; }
.desc li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 9px; height: 9px; border-radius: 50%; background: var(--bubble); border: 1.5px solid var(--line); }

/* --- Search page ---------------------------------------------------------- */

.searchpage__bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.searchpage__bar .search { max-width: 520px; }
.result-count { font-weight: 700; margin: 0 0 var(--gap); }
.empty { background: var(--paper); border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; }
.empty h2 { margin-top: 0; }

/* --- Footer --------------------------------------------------------------- */

.footer { background: var(--ink); color: var(--cream); padding-block: clamp(34px, 5vw, 54px) 28px; margin-top: clamp(30px, 5vw, 60px); }
.footer a { color: var(--cream); }
.footer__grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h2 { font-size: 1.3rem; color: var(--cream); }
.footer h3 { font-family: var(--font-body); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--bubble); font-weight: 800; margin-bottom: .9em; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .5em; }
.footer p { color: #e5d9ef; font-size: .95rem; }
.footer__note { border-top: 1px solid #4b2b68; margin-top: 30px; padding-top: 18px; font-size: .88rem; color: #cbb9dc; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.footer .logo__a, .footer .logo__b { color: var(--cream); }
.footer .logo__b { color: var(--bubble); }

/* --- Utility -------------------------------------------------------------- */

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.noscript-note { background: var(--butter); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: var(--gap); font-size: .95rem; }
