/* V3 round 2, lane A: Build-A-Box (Matt, Nov 1). Behaviour in v4/r2/lane-a.js.
   One column like live: box on top filling its frame, sizes under it, full-width flavor list.
   Variants: html[data-v-r2alist] a rows typed in / b rows bounce in / c photo tiles;
             html[data-v-r2asize] a snap chips / b big numbers / c slot dots;
             html[data-v-r2abadge] a quiet + proof / b shimmer / c video peek / d live counter (preview sample). */

/* ---------- One column; the V3 carousels stay as the size engine but never show ---------- */
html.r2a #boxBuilder.active { display: block !important; }
html.r2a #boxBuilder > .box-size-carousel { display: none !important; }
html.r2a #boxBuilder > .builder-header { display: none !important; }
html.r2a #customBoxOptions > div > h3, html.r2a #customBoxOptions > div > div:first-of-type { display: none !important; }

/* ---------- The box: centered, hugging properly sized slots (2 / 4 / 6 / 12 / Big Box) ---------- */
html.r2a #boxBuilder > .box-stage { display: flex; justify-content: center; padding: 22px 0 6px; margin: 0; }
html.r2a #boxBuilder > .box-stage > .box-visual { margin: 0 !important; padding: 14px 0 0 !important; background: none !important; box-shadow: none !important; overflow: visible !important; width: auto !important; max-width: 100%; display: flex; justify-content: center; }
html.r2a #boxBuilder > .box-stage > .box-visual[hidden] { display: none !important; }
html.r2a #boxBuilder > .box-stage .box-container { display: inline-block !important; width: auto !important; max-width: 100%; margin: 0 !important; padding: 30px 18px 18px !important; box-sizing: border-box; }
html.r2a #boxBuilder > .box-stage .box-grid {
  --cols: 2; --slot: min(128px, calc((100vw - 120px) / 2)); --gap: 12px;
  display: grid !important; grid-template-columns: repeat(var(--cols), var(--slot)) !important; gap: var(--gap) !important;
  width: auto !important; max-width: none !important; margin: 0 auto !important; padding: 0 !important; justify-content: center;
}
html.r2a #boxBuilder > .box-stage .box-grid.grid-4 { --cols: 2; --slot: min(112px, calc((100vw - 120px) / 2)); }
html.r2a #boxBuilder > .box-stage .box-grid.grid-6 { --cols: 3; --slot: min(84px, calc((100vw - 126px) / 3)); --gap: 10px; }
html.r2a #boxBuilder > .box-stage .box-grid.grid-12 { --cols: 4; --slot: min(64px, calc((100vw - 128px) / 4)); --gap: 8px; }
html.r2a #boxBuilder > .box-stage .box-grid:has(> .roll-slot:nth-child(13)) { --cols: 5; --slot: min(50px, calc((100vw - 132px) / 5)); --gap: 6px; }
html.r2a #boxBuilder > .box-stage .roll-slot {
  width: var(--slot) !important; height: var(--slot) !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important;
  aspect-ratio: 1; padding: 0 !important; margin: 0 !important; box-sizing: border-box;
}
html.r2a #boxBuilder > .box-stage .roll-slot .roll-svg { width: calc(100% - 4px) !important; height: calc(100% - 4px) !important; }
@media (min-width: 900px) {
  html.r2a #boxBuilder > .box-stage { padding-top: 30px; }
  html.r2a #boxBuilder > .box-stage .box-container { padding: 36px 26px 24px !important; }
  html.r2a #boxBuilder > .box-stage .box-grid { --slot: 164px; --gap: 16px; }
  html.r2a #boxBuilder > .box-stage .box-grid.grid-4 { --slot: 140px; }
  html.r2a #boxBuilder > .box-stage .box-grid.grid-6 { --slot: 128px; --gap: 14px; }
  html.r2a #boxBuilder > .box-stage .box-grid.grid-12 { --cols: 6; --slot: 104px; --gap: 12px; }
  html.r2a #boxBuilder > .box-stage .box-grid:has(> .roll-slot:nth-child(13)) { --cols: 8; --slot: 72px; --gap: 10px; }
}

/* ---------- Summary: progress ring, count, price, the live line ---------- */
html.r2a .r2a-controls { display: grid; gap: 12px; justify-items: center; margin: 6px auto 18px; max-width: 760px; }
html.r2a .r2a-summary { display: grid; grid-template-columns: 48px minmax(0, 1fr) max-content; grid-template-areas: "ring text price" "ring live live"; align-items: center; column-gap: 16px; row-gap: 2px; width: min(100%, 440px); box-sizing: border-box; padding: 2px 4px; }
html.r2a .r2a-ring { grid-area: ring; width: 48px; height: 48px; transform: rotate(-90deg); overflow: visible; border-radius: 50%; background: radial-gradient(circle at 50% 46%, #FBF6EE 58%, #EFE4D4 71%, transparent 72%); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
html.r2a .r2a-ring circle { fill: none; stroke-width: 5; }
html.r2a .r2a-ring-bg { stroke: #E4D4C0; }
html.r2a .r2a-ring-fg { stroke: #C9A24A; stroke-linecap: round; transition: stroke-dashoffset .45s cubic-bezier(.22, 1, .36, 1); }
html.r2a .r2a-ring.is-full .r2a-ring-fg { stroke: #C99A2E; }
html.r2a .r2a-ring-n { transform: rotate(90deg); transform-origin: 24px 24px; font: 700 15px/1 'DM Sans', sans-serif; fill: var(--plum, #4A1942); }
html.r2a .r2a-sum-text { grid-area: text; margin: 0; min-width: 0; font: 600 16px/1.3 'DM Sans', sans-serif; color: var(--ink, #2D1928); }
html.r2a .r2a-sum-price { grid-area: price; margin: 0; padding-left: 4px; font: 600 20px/1 'Glaze Display', Georgia, serif; color: var(--plum, #4A1942); font-variant-numeric: tabular-nums; display: inline-block; white-space: nowrap; justify-self: end; letter-spacing: .01em; }
html.r2a .r2a-sum-live { grid-area: live; margin: 0; font: 500 12.5px/1.35 'DM Sans', sans-serif; color: #7A6A5E; }
html.r2a .r2a-sum-live:empty { display: none; }
html.r2a .r2a-summary.r2a-bump .r2a-sum-price { animation: r2aBump .5s cubic-bezier(.22, 1, .36, 1) 1; }
@keyframes r2aBump { 0% { transform: scale(1); } 35% { transform: scale(1.14); } 100% { transform: scale(1); } }

/* ---------- #13 Size picker: snap scroller ---------- */
html.r2a .r2a-sizes { display: grid; gap: 10px; justify-items: center; width: 100%; }
html.r2a #boxBuilder .r2a-snap {
  display: flex !important; grid-template-columns: none !important; gap: 6px !important; width: 100%; max-width: 100%; box-sizing: border-box;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 12px; scrollbar-width: none;
  justify-content: safe center; margin: 0 !important; padding: 5px !important; border-radius: 20px !important; background: #F4ECE0; box-shadow: inset 0 1px 2px rgba(45, 25, 40, .08);
}
html.r2a #boxBuilder .r2a-snap::-webkit-scrollbar { display: none; }
html.r2a #boxBuilder .r2a-snap > button {
  flex: 0 0 auto; min-width: 84px; min-height: 58px; scroll-snap-align: center; padding: 8px 14px !important;
  display: grid !important; place-items: center; gap: 2px; position: relative; z-index: 1;
  border: 0 !important; border-radius: 15px !important; background: transparent !important; color: var(--ink, #2D1928) !important;
  font: 600 13px/1.1 'DM Sans', sans-serif; cursor: pointer; transition: transform .25s ease !important; -webkit-tap-highlight-color: transparent;
}
html.r2a #boxBuilder .r2a-snap > button b { font-size: 15px; color: inherit; }
html.r2a #boxBuilder .r2a-snap > button small { display: none; font: 500 11px/1 'DM Sans', sans-serif; opacity: .8; }
html.r2a #boxBuilder .r2a-snap > button:active { transform: scale(.96); }
html.r2a #boxBuilder .r2a-snap > button:focus-visible { outline: 3px solid var(--plum, #4A1942); outline-offset: -3px; }
html.r2a #boxBuilder .r2a-snap > button[aria-pressed="true"], html.r2a #boxBuilder .r2a-snap > button[aria-pressed="true"] * { color: #FDF8F0 !important; }
/* The savory row and the Custom chip have no sliding indicator: they fill themselves. */
html.r2a #boxBuilder .r2a-savory-sizes > button[aria-pressed="true"],
html.r2a #boxBuilder .glz-sizes > .r2a-custom[aria-pressed="true"] { background: var(--plum, #4A1942) !important; box-shadow: 0 8px 18px -10px rgba(74, 25, 66, .7); }
html.r2a #boxBuilder .glz-sizes:has(> .r2a-custom[aria-pressed="true"]) > .glz-size-ind { opacity: 0 !important; }
html.r2a #boxBuilder .r2a-savory-sizes { display: none !important; }
html.r2a #boxBuilder.r2a-savory .r2a-savory-sizes { display: flex !important; }
html.r2a #boxBuilder.r2a-savory .r2a-controls .glz-sizes, html.r2a #boxBuilder.r2a-savory .r2a-controls .glz-cadence,
html.r2a #boxBuilder.r2a-savory .r2a-controls .glz-price-note, html.r2a #boxBuilder.r2a-savory .r2a-stepper { display: none !important; }
html.r2a .r2a-controls .glz-price-note { margin: 0; text-align: center; max-width: 34rem; }
html.r2a .r2a-controls .glz-cadence { width: 100%; max-width: 560px; margin: 0; }
/* On change: a glow pulse on the chip and the box (a gold halo that fades and grows: opacity and transform only). */
html.r2a #boxBuilder .r2a-snap > button::after, html.r2a .box-stage .box-container > .r2a-halo {
  content: ''; position: absolute; inset: -3px; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 3px rgba(212, 168, 67, .85), 0 0 22px 4px rgba(212, 168, 67, .45);
}
html.r2a .box-stage .box-container > .r2a-halo { inset: -6px; border-radius: 26px; z-index: 0; }
html.r2a #boxBuilder .r2a-snap > button.r2a-glow::after, html.r2a .box-stage .box-container.r2a-glow > .r2a-halo { animation: r2aGlow .9s ease-out 1; }
@keyframes r2aGlow { 0% { opacity: .95; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08); } }
/* Custom count stepper (Big Box, 13+ rolls). */
html.r2a .r2a-stepper { display: inline-flex; align-items: center; gap: 14px; padding: 6px; border-radius: 999px; background: #fff; border: 1px solid rgba(74, 25, 66, .14); box-shadow: 0 6px 16px -10px rgba(45, 25, 40, .4); }
html.r2a .r2a-stepper[hidden] { display: none !important; }
html.r2a .r2a-stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--plum, #4A1942); color: #FDF8F0; font: 500 24px/1 'DM Sans', sans-serif; cursor: pointer; transition: transform .2s ease; }
html.r2a .r2a-stepper button:active { transform: scale(.92); }
html.r2a .r2a-stepper button:focus-visible { outline: 3px solid var(--plum, #4A1942); outline-offset: 3px; }
html.r2a .r2a-stepper output { min-width: 84px; text-align: center; font: 600 18px/1 'Glaze Display', Georgia, serif; color: var(--plum, #4A1942); }
/* Variant b: big numbers with the per-roll price. */
html[data-v-r2asize="b"].r2a #boxBuilder .r2a-snap > button { min-width: 96px; min-height: 74px; }
html[data-v-r2asize="b"].r2a #boxBuilder .r2a-snap > button b { font: 600 22px/1 'Glaze Display', Georgia, serif; }
html[data-v-r2asize="b"].r2a #boxBuilder .r2a-snap > button small { display: block; }
html[data-v-r2asize="b"].r2a #boxBuilder .r2a-snap > button > span { font-size: 12px; opacity: .85; }
/* Variant c: each size drawn as its slots. */
html.r2a .r2a-glyph { display: none; }
html[data-v-r2asize="c"].r2a .r2a-glyph { display: grid; grid-template-columns: repeat(2, 6px); gap: 3px; justify-content: center; margin: 2px 0; }
html[data-v-r2asize="c"].r2a .r2a-glyph[data-n="6"] { grid-template-columns: repeat(3, 6px); }
html[data-v-r2asize="c"].r2a .r2a-glyph[data-n="12"], html[data-v-r2asize="c"].r2a .r2a-glyph[data-n="13"] { grid-template-columns: repeat(4, 6px); }
html[data-v-r2asize="c"].r2a .r2a-glyph > i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
html[data-v-r2asize="c"].r2a #boxBuilder .r2a-snap > button { min-height: 78px; }

/* ---------- #14 Tap a flavor: the words are the button ---------- */
html.r2a #boxBuilder .r2a-tap {
  display: inline-flex !important; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 10px; margin: 4px auto 14px; width: auto; max-width: 100%; box-sizing: border-box; text-align: left; padding: 12px 20px; min-height: 48px;
  border: 1.5px solid rgba(74, 25, 66, .18); border-radius: 999px; background: #fff; cursor: pointer;
  font: 700 12.5px/1.2 'DM Sans', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--plum, #4A1942);
  box-shadow: 0 8px 20px -14px rgba(45, 25, 40, .5); transition: transform .25s ease;
}
html.r2a #boxBuilder .flavor-picker:has(> .r2a-tap) { text-align: center; }
html.r2a #boxBuilder .flavor-picker > :not(.r2a-tap) { text-align: initial; }
html.r2a #boxBuilder .r2a-tap-text { flex: 0 1 auto; }
html.r2a #boxBuilder .flavor-picker > .glz-jump { justify-content: center; }
html.r2a #boxBuilder .r2a-tap-go { flex: none;  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--plum, #4A1942); color: #FDF8F0; font-size: 14px; letter-spacing: 0; transition: transform .3s ease; }
html.r2a #boxBuilder .r2a-tap:hover { border-color: var(--plum, #4A1942); box-shadow: 0 12px 26px -14px rgba(74, 25, 66, .6); }
html.r2a #boxBuilder .r2a-tap:hover .r2a-tap-go { transform: translateY(2px); }
html.r2a #boxBuilder .r2a-tap:active { transform: scale(.97); background: #FBF4EC; }
html.r2a #boxBuilder .r2a-tap:focus-visible { outline: 3px solid var(--plum, #4A1942); outline-offset: 3px; }
html.r2a .r2a-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.r2a #flavorButtons > .flavor-btn.r2a-nudge .flavor-art { animation: r2aNudge .8s cubic-bezier(.22, 1, .36, 1) 1; }
@keyframes r2aNudge { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ---------- #6 / #8 Flavor list: full width; rows (a, b) or photo tiles (c) ---------- */
@media (min-width: 900px) {
  html.r2a:not([data-v-r2alist="c"]) #boxBuilder #flavorButtons { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  html.r2a:not([data-v-r2alist="c"]) #boxBuilder #flavorButtons > .flavor-btn { display: grid !important; grid-template-columns: 128px 1fr !important; align-items: center !important; gap: 18px !important; padding: 12px 18px 12px 12px !important; min-height: 152px !important; }
  html.r2a:not([data-v-r2alist="c"]) #boxBuilder #flavorButtons > .flavor-btn .flavor-art { width: 128px !important; height: 128px !important; aspect-ratio: auto; border-radius: 18px !important; }
  html.r2a:not([data-v-r2alist="c"]) #boxBuilder #flavorButtons > .flavor-btn .flavor-info { padding: 0 !important; gap: 6px; }
  html.r2a:not([data-v-r2alist="c"]) #boxBuilder #flavorButtons > .flavor-btn .flavor-name { padding-right: 0; font-size: 19px !important; }
  html.r2a:not([data-v-r2alist="c"]) #boxBuilder #flavorButtons > .flavor-btn .premium-tag { position: static; margin-left: 0; background: #F7EFE3 !important; }
  html.r2a:not([data-v-r2alist="c"]) #boxBuilder #flavorButtons > .flavor-btn::after { left: 100px !important; top: auto !important; bottom: 20px !important; right: auto !important; }
  html.r2a:not([data-v-r2alist="c"]) #boxBuilder #flavorButtons > .flavor-btn .flavor-count-badge { top: 8px; left: 8px; }
}
@media (min-width: 1100px) {
  html[data-v-r2alist="c"].r2a #boxBuilder #flavorButtons { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
/* Descriptions in the Glaze display italic, typed in (a) or bounced in (b), once. */
html.r2a:not([data-v-r2alist="c"]) #boxBuilder #flavorButtons .flavor-short-desc { font: italic 400 15px/1.42 'Glaze Display', Georgia, serif !important; color: #5E4F46 !important; }
html.r2a #flavorButtons .r2a-w { display: inline-block; }
html.r2a:not(.glz-static) #flavorButtons .flavor-short-desc[data-r2a-words]:not(.r2a-in) .r2a-w { opacity: 0; }
html.r2a:not(.glz-static):not([data-v-r2alist="b"]):not([data-v-r2alist="c"]) #flavorButtons .flavor-short-desc.r2a-in .r2a-w { animation: r2aType .16s steps(2, end) calc(var(--i) * 55ms) 1 both; }
html[data-v-r2alist="b"].r2a:not(.glz-static) #flavorButtons .flavor-short-desc.r2a-in .r2a-w { animation: r2aRise .55s cubic-bezier(.34, 1.56, .64, 1) calc(var(--i) * 32ms) 1 both; }
html[data-v-r2alist="c"].r2a:not(.glz-static) #flavorButtons .flavor-short-desc.r2a-in .r2a-w { animation: r2aFade .7s ease-out 1 both; }
@keyframes r2aType { from { opacity: 0; } to { opacity: 1; } }
@keyframes r2aRise { from { opacity: 0; transform: translateY(.5em); } to { opacity: 1; transform: none; } }
@keyframes r2aFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { html.r2a #flavorButtons .r2a-w { animation: none !important; opacity: 1 !important; } }

/* ---------- #7 Badges and real proof ---------- */
html.r2a #flavorButtons .glz-badge { display: none !important; }
html.r2a #flavorButtons .r2a-badge {
  position: relative; overflow: hidden; display: inline-block; font: 700 10.5px/1 'DM Sans', sans-serif; letter-spacing: .08em; text-transform: uppercase;
  padding: .34rem .5rem; border-radius: 999px; color: var(--plum, #4A1942); background: #FBF5EA; border: 1px solid rgba(201, 154, 46, .6);
}
html.r2a #flavorButtons .r2a-badge[data-kind="viral"] { background: var(--plum, #4A1942); color: #FDF8F0; border-color: var(--plum, #4A1942); }
html.r2a #flavorButtons .r2a-badge[data-kind="fan"] { background: #F6E7C3; border-color: #D4A843; }
html.r2a #flavorButtons .r2a-badge[data-kind="again"] { background: #EEF4E4; color: #3F5A2E; border-color: rgba(65, 91, 51, .35); }
html.r2a #flavorButtons .r2a-proof { display: flex; align-items: center; gap: 6px; font: 600 12px/1.3 'DM Sans', sans-serif; color: #8B6420; }
html.r2a #flavorButtons .r2a-proof::before { content: ''; width: 0; height: 0; border-left: 7px solid currentColor; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }
/* b: one shimmer across the badge when the row first shows. */
html[data-v-r2abadge="b"].r2a #flavorButtons .r2a-badge::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .75) 50%, transparent 70%); transform: translateX(-120%); }
html[data-v-r2abadge="b"].r2a:not(.glz-static) #flavorButtons .flavor-btn:has(.flavor-short-desc.r2a-in) .r2a-badge::after { animation: r2aShimmer 1.3s .35s ease-in-out 1 both; }
@keyframes r2aShimmer { to { transform: translateX(120%); } }
/* c: a round peek of the real post; plays muted only while the card is hovered or focused. */
html.r2a #flavorButtons .r2a-peek { display: none; }
html[data-v-r2abadge="c"].r2a #flavorButtons > .flavor-btn .r2a-peek {
  display: block; position: absolute; z-index: 2; top: 10px; right: 12px; width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px rgba(201, 154, 46, .8), 0 8px 18px -8px rgba(45, 25, 40, .5); background: #EFE4D4; pointer-events: none;
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}
html[data-v-r2abadge="c"].r2a #flavorButtons > .flavor-btn .r2a-peek img, html[data-v-r2abadge="c"].r2a #flavorButtons > .flavor-btn .r2a-peek video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
html[data-v-r2abadge="c"].r2a #flavorButtons > .flavor-btn .r2a-peek.is-playing { transform: scale(1.5); transform-origin: 100% 0; }
html[data-v-r2abadge="c"].r2a #flavorButtons > .flavor-btn:has(.r2a-peek) .flavor-name { padding-right: 58px; }
/* d: the per-flavor order counter, as a labelled sample on preview hosts only. */
html.r2a #flavorButtons .r2a-stub { display: inline-block; width: fit-content; font: 600 11.5px/1.2 'DM Sans', sans-serif; color: #6B5E55; padding: .3rem .55rem; border: 1.5px dashed rgba(74, 25, 66, .35); border-radius: 8px; background: #FFFDF8; }
html.r2a #flavorButtons .r2a-stub[hidden] { display: none !important; }

/* ---------- #1 The cart bar steps aside while it would cover the Glaze Window ---------- */
#stickyBar { transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .3s ease, visibility 0s linear 0s; }
body.r2a-bar-yield #stickyBar { transform: translateY(140%) !important; opacity: 0 !important; visibility: hidden; pointer-events: none; transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .3s ease, visibility 0s linear .45s; }

html.glz-static .r2a-glow::after, html.glz-static .r2a-halo, html.glz-static .r2a-bump .r2a-sum-price, html.glz-static .r2a-nudge .flavor-art { animation: none !important; }
@media (prefers-reduced-motion: reduce) { html.r2a .r2a-glow::after, html.r2a .r2a-halo, html.r2a .r2a-bump .r2a-sum-price, html.r2a .r2a-nudge .flavor-art, html.r2a #stickyBar { animation: none !important; transition: none !important; } }
@media (min-width: 900px) {
  html[data-v-r2alist="c"][data-v-r2abadge="c"].r2a #boxBuilder #flavorButtons > .flavor-btn:has(.r2a-peek) .premium-tag { right: 74px !important; }
  html[data-v-r2alist="c"][data-v-r2abadge="c"].r2a #flavorButtons > .flavor-btn:has(.r2a-peek) .flavor-name { padding-right: 44px; }
}

/* Coordinator fix (Nov 1): the Special Occasion and Big Box cards inside the special-sizes list kept the
   desktop .reveal start state (opacity 0) because the reveal observer never sees them there, so they
   showed as blank space at 1440. Size controls are always visible, as on phones. */
.compact-special-sizes .size-card.reveal,
html.reveal-ready .compact-special-sizes .size-card.reveal:not(.visible) { opacity: 1; transform: none; }
