/* ==========================================================
   WOWM! — products page (wheel-driven category stage)
   ========================================================== */
.page-products { overflow: hidden; background: var(--cream); }

.pp { transition: transform 1s cubic-bezier(.77, 0, .18, 1); will-change: transform; }

/* ---------- stage ---------- */
.stage {
  --ht: clamp(70px, 10vh, 96px);                                   /* one title row */
  --hp: clamp(300px, calc(100vh - var(--ht) * 3 - 150px), 470px);  /* open product panel */
  position: relative; height: 100vh; overflow: hidden;
  padding: calc(var(--header-h) + 28px) var(--gutter) 0;
}
.stage::before { /* category-tinted glow, follows the active category */
  content: ""; position: absolute; z-index: 0; right: -10vw; top: 10vh; width: 70vw; height: 80vh; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow, var(--cat-nuts)), transparent);
  opacity: .9; transition: background .9s var(--ease);
}
.stage .burst-deco { position: absolute; z-index: 0; right: 13vw; top: 15vh; width: 120px; height: 80px; color: var(--lime); transform: rotate(16deg); opacity: .7; }

.cat-list {
  position: relative; z-index: 1;
  transform: translateY(calc((1 - var(--i, 0)) * var(--ht)));
  transition: transform .95s cubic-bezier(.77, 0, .18, 1);
}
.stage-mask { /* fade titles that sit below the "next" slot */
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 140px), transparent 100%);
          mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 140px), transparent 100%);
  height: 100%;
}

.cat-block .cat-head {
  height: var(--ht); display: flex; align-items: center; gap: 22px; cursor: pointer;
}
.cat-head .t-main {
  font-size: clamp(32px, 3.8vw, 56px); line-height: 1; font-weight: 700; letter-spacing: -.02em; text-transform: uppercase;
  color: rgba(17,17,17,.14);
  transition: color .7s var(--ease), font-size .9s var(--ease);
  white-space: nowrap;
}
.cat-head .t-sub {
  font-size: clamp(16px, 1.5vw, 22px); font-weight: 600; color: rgba(17,17,17,.14);
  transition: color .7s var(--ease), font-size .9s var(--ease);
  white-space: nowrap;
}
.cat-head:hover .t-main, .cat-head:hover .t-sub { color: rgba(17,17,17,.32); }

.cat-block.is-active .cat-head { cursor: default; }
.cat-block.is-active .t-main { color: var(--ink); font-size: clamp(44px, 4.8vw, 80px); }
.cat-head .t-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cat-block.is-active .t-sub { color: var(--olive); font-size: clamp(18px, 1.8vw, 26px); }
.cat-block.is-active .t-main::after { /* lime underline swipe */
  content: ""; display: block; height: 8px; margin-top: -6px; border-radius: 8px; background: var(--lime);
  transform-origin: left; animation: swipe .9s var(--ease) .3s both; opacity: .9;
}
@keyframes swipe { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.cat-panel { height: 0; overflow: hidden; transition: height .95s cubic-bezier(.77, 0, .18, 1); }
.cat-block.is-active .cat-panel { height: var(--hp); }

/* ---------- product row ---------- */
.p-row {
  display: flex; gap: 22px; height: 100%;
  padding: 18px 4px 28px; margin: 0 -4px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-behavior: smooth; scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 90px), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 90px), transparent);
}
.p-row.at-end { -webkit-mask-image: none; mask-image: none; }
.p-row::-webkit-scrollbar { display: none; }
.p-row.is-dragging { scroll-behavior: auto; scroll-snap-type: none; cursor: grabbing; }

.p-card {
  flex: none; width: calc((var(--hp) - 90px) * .8); scroll-snap-align: start;
  display: flex; flex-direction: column; text-align: left;
  opacity: 0; transform: translateY(50px);
  transition: opacity .7s var(--ease), transform .9s var(--ease);
}
.cat-block.is-active .p-card { opacity: 1; transform: none; transition-delay: calc(var(--k) * 70ms + 450ms); }
.p-media {
  position: relative; flex: 1; min-height: 0; border-radius: 28px; overflow: hidden;
  background: var(--tint);
  transition: box-shadow .5s var(--ease), transform .6s var(--ease);
}
.p-media::before { /* soft spotlight */
  content: ""; position: absolute; inset: 15% 10% 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.75), transparent); pointer-events: none;
}
.p-media img { position: relative; width: 100%; height: 100%; transition: transform .8s var(--ease); }
.p-card.is-pack .p-media img { object-fit: contain; padding: 9% 12% 11%; filter: drop-shadow(0 18px 22px rgba(17,17,17,.22)); }
.p-card.is-photo .p-media img { object-fit: cover; }
.p-card.is-photo .p-media::before { display: none; }
.p-media .plus {
  position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.65); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 22px; line-height: 1; font-weight: 400;
  opacity: 0; transform: scale(.6); transition: opacity .35s, transform .45s var(--ease-bounce), background-color .3s;
}
.p-card:hover .p-media { box-shadow: 0 28px 50px -28px rgba(17,17,17,.4); transform: translateY(-6px); }
.p-card:hover.is-pack .p-media img { transform: translateY(-10px) rotate(-4deg) scale(1.05); }
.p-card:hover.is-photo .p-media img { transform: scale(1.07); }
.p-card:hover .plus { opacity: 1; transform: none; }
.p-card:hover .plus:hover { background: var(--lime); }
.p-info { padding: 14px 6px 0; }
.p-info strong { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; }
.p-info small { display: block; margin-top: 4px; font-size: 13px; color: var(--mute); }

/* scroll hint */
.hint {
  position: absolute; z-index: 2; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute);
  transition: opacity .5s;
}
.hint .mouse { position: relative; width: 20px; height: 30px; border: 1.5px solid currentColor; border-radius: 12px; }
.hint .mouse::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 6px; margin-left: -1.5px; border-radius: 2px; background: var(--olive); animation: wheel 1.6s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(-3px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(8px); } }


/* ---------- product modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 40px;
  background: rgba(17,17,17,.28); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: opacity .45s var(--ease), visibility .45s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal-card {
  position: relative; width: min(980px, 100%); max-height: calc(100vh - 80px);
  display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border-radius: 34px;
  background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.9);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 50px 100px -40px rgba(17,17,17,.5);
  transform: translateY(40px) scale(.96); transition: transform .6s var(--ease);
}
.modal.is-open .modal-card { transform: none; }
.modal-media { position: relative; background: var(--tint); min-height: 520px; }
.modal-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.modal-media.is-pack img { object-fit: contain; padding: 10% 14%; filter: drop-shadow(0 24px 30px rgba(17,17,17,.25)); animation: floaty 4s ease-in-out infinite; }
.modal-media.is-photo img { object-fit: cover; }
@keyframes floaty { 50% { transform: translateY(-12px) rotate(-1.5deg); } }
.modal-body { padding: 54px 48px 44px; display: flex; flex-direction: column; overflow-y: auto; }
.modal-body .eyebrow { color: var(--olive); }
.modal-body h3 { margin-top: 18px; font-size: 38px; line-height: 1.12; font-weight: 700; letter-spacing: -.01em; }
.modal-body .alt { margin-top: 8px; font-size: 16px; color: var(--mute); }
.modal-body p { margin-top: 22px; font-size: 16px; line-height: 1.8; color: var(--ink-2); }
.modal-facts { display: grid; gap: 18px; margin-top: 30px; padding-top: 24px; border-top: 1px solid rgba(17,17,17,.08); }
.modal-facts dt { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.modal-facts dd { margin: 8px 0 0; font-size: 16px; font-weight: 600; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-grid; place-items: center; height: 32px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.tag.crunch { background: var(--yellow); transform: rotate(-3deg); }
.tag.juicy { background: var(--orange); transform: rotate(2deg); }
.tag.nutty { background: var(--ink); color: #fff; transform: rotate(-2deg); }
.tag.sweet { background: var(--lime); transform: rotate(3deg); }
.modal-close {
  position: absolute; right: 18px; top: 18px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(17,17,17,.06); transition: background-color .3s, transform .4s var(--ease);
}
.modal-close:hover { background: var(--lime); transform: rotate(90deg); }
.modal-close svg { width: 18px; height: 18px; }
