/* Mystic Hollow round 3: bag.css (owner: builder B). The bag page, bag/. Colours come from tokens only. Easing: --settle. */

.bg-page { position: relative; }
.bg-page .owner { white-space: normal; }
.bg-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 30px; padding: 26px 0 30px; border-bottom: 1px solid var(--line); }
.bg-head-count { margin: 0; font-size: 16px; color: var(--text-2); }

/* ---------- items + summary ---------- */
.bg-full { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 410px); gap: clamp(32px, 4.4vw, 70px); align-items: start; }
.bg-cols, .bg-item { display: grid; grid-template-columns: 136px minmax(0, 1fr) 132px 104px; gap: 22px; align-items: center; }
.bg-cols { padding: 18px 0 12px; border-bottom: 1px solid var(--line); font: 500 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.bg-cols span:first-child { grid-column: 1 / 3; }
.bg-cols span:last-child { text-align: right; }
.bg-list { list-style: none; margin: 0; padding: 0; }
.bg-item { padding: 22px 0; border-bottom: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) { .bg-item { animation: bg-in .6s var(--settle) both; } @keyframes bg-in { from { opacity: 0; transform: translateY(8px); } } }
.bg-img { position: relative; display: grid; place-items: end center; height: 164px; padding-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(70% 46% at 50% 76%, rgb(var(--key) / .2), transparent 72%), radial-gradient(50% 40% at 56% 60%, color-mix(in srgb, var(--c) 12%, transparent), transparent 70%), var(--bg-2); }
.bg-img::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 12px; height: 12px; background: radial-gradient(closest-side, rgb(var(--shade) / .85), transparent); }
.bg-img img { position: relative; z-index: 1; height: calc(var(--rh, .8) * 128px); width: auto; max-width: 84%; object-fit: contain; filter: drop-shadow(0 6px 6px rgb(var(--shade) / .6)); transition: transform .7s var(--settle); }
.bg-img:hover img { transform: translateY(-4px); }
.bg-info { min-width: 0; }
.bg-type { display: flex; align-items: center; gap: 10px; margin: 0; font: 500 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.bg-type::before { content: ''; width: 16px; height: 1px; background: var(--c); box-shadow: 0 0 8px var(--c); }
.bg-name { margin: 10px 0 0; font: 400 28px/1.08 var(--display); }
.bg-name a { text-decoration: none; }
.bg-name a:hover { color: var(--accent); }
.bg-sub { margin: 6px 0 0; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.bg-sub .mono { margin-left: 6px; font-size: 13.5px; white-space: nowrap; }
.bg-unit { margin: 10px 0 0; font-size: 14px; color: var(--text-3); }
.bg-unit .mono { color: var(--text-2); }
.bg-remove { margin-top: 8px; font-size: 14px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); transition: color .3s; }
.bg-remove:hover { color: var(--text); text-decoration-color: var(--accent); }
.bg-qty { justify-self: start; margin: 0; }
.bg-qty button { width: 40px; height: 44px; }
.bg-qty output { min-width: 34px; font-size: 15px; }
.bg-line { margin: 0; text-align: right; font-size: 19px; }
.bg-back { margin: 26px 0 0; }

/* ---------- on the stone (round 6): the products in the bag, standing together on the wet basalt ledge ----------
   A frame (frame.css) with one plate and a row of packs on the ledge line (--y of the world): each pack is its own outline
   box (.pk, site/parts/packs.mjs) at its true relative height (--pk-rel), so bottles stand tall and jars short. Every
   product's pack is in the markup, hidden; bag.mjs writes the :has() rules that show the ones in the bag. */
.bg-stage { margin: 30px 0 0; }
.bg-stage .fr-media { aspect-ratio: 21 / 9; }
.bg-stage .fr-pool { width: 58%; }
.bg-stage-row { --ph: 40%; position: absolute; z-index: 3; left: 0; right: 0; top: calc(var(--y) * 100% - var(--ph)); height: var(--ph); display: flex; justify-content: center; align-items: flex-end; gap: 0 2.4%; pointer-events: none; }
.bg-stage-pk { display: none; position: relative; flex: none; height: calc(var(--pk-rel) * 100%); aspect-ratio: var(--pk-car); }
.bg-stage-pk > .fr-pack { left: 50%; }
/* the key light only: at this size frame.css's dew beads on the pack read as dust */
.bg-stage .fr-key { background: linear-gradient(112deg, rgb(var(--key) / .3) 0%, rgb(var(--key) / .09) 30%, transparent 56%); }
/* a wet ledge: a clearer reflection, and a tight dark line where each pack meets the stone (over the reflection, under the pack) */
.bg-stage .fr-refl { opacity: .3; }
.bg-stage-pk::after { content: ''; position: absolute; z-index: 0; left: 3%; right: 3%; bottom: -2px; height: 6px; background: radial-gradient(closest-side, rgb(var(--shade) / .95), rgb(var(--shade) / .5) 55%, transparent); pointer-events: none; }
/* one pack alone stands taller, at its solo height (jars eased up, as a pack alone in its own frame); a line-up keeps
   every pack in true proportion */
.bg-page:has(.bg-list > .bg-item:only-child) .bg-stage-row { --ph: 45%; }
.bg-page:has(.bg-list > .bg-item:only-child) .bg-stage-pk { height: calc(var(--pk-solo) * 100%); }
@supports not selector(:has(*)) { .bg-stage { display: none; } }

.bg-sum { position: sticky; top: calc(var(--hdr-h) + 24px); padding: clamp(22px, 2.2vw, 30px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--atmos-band), var(--bg-2); }
.bg-sum-h { margin: 0 0 18px; font: 300 32px/1 var(--display); }
.bg-dl { margin: 0; border-top: 1px solid var(--line); }
.bg-dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.bg-dl dt { font-size: 15px; }
.bg-dl dt small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.bg-dl dd { margin: 0; max-width: 62%; text-align: right; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.bg-dl [data-bag-sub] { font-size: 23px; color: var(--text); }
.bg-co { margin-top: 22px; padding: 20px; border: 1px solid var(--line-2); border-left: 2px solid var(--accent); border-radius: 2px; background: var(--bg); }
.bg-co-h { margin: 0 0 8px; font: 400 21px/1.2 var(--display); }
.bg-co p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.bg-co-list { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--line); }
.bg-co-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 11px 0 11px 12px; border-bottom: 1px solid var(--line); box-shadow: inset 2px 0 0 var(--c); text-decoration: none; transition: background .3s; }
.bg-co-list a:hover { background: rgb(var(--key) / .05); }
.bg-co-name { font-size: 15px; font-weight: 600; }
.bg-co-q { font-size: 13.5px; color: var(--text-2); text-align: right; }
.bg-co-go { grid-column: 1 / -1; font-size: 13.5px; color: var(--accent); }
.bg-co-list a:hover .bg-co-go { text-decoration: underline; text-underline-offset: 3px; }
.bg-co-cart { width: 100%; }
.bg-co-note { margin-top: 12px; }
/* round 8: the one-button checkout (checkout.js) */
.bg-co.is-wix { border-left-color: var(--line-2); }
.bg-co.is-wix .bg-co-cart { height: 54px; font-size: 15px; }
.bg-co-cart[aria-disabled="true"] { opacity: .7; cursor: progress; }
.bg-co .bg-co-msg { margin: 12px 0 0; color: var(--text); }
.bg-co .bg-co-msg:empty { display: none; }
.bg-made { margin-top: 18px; }

/* ---------- empty ---------- */
.bg-empty { padding-top: clamp(36px, 4vw, 56px); padding-bottom: 10px; }
.bg-empty-in { max-width: 680px; }
.bg-empty-big { margin: 0 0 14px; font: 300 clamp(30px, 2.6vw, 38px)/1.15 var(--display); }
.bg-empty-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- suggestions ---------- */
.bg-suggest { margin-top: clamp(80px, 8vw, 120px); }
.bg-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .bg-full { grid-template-columns: 1fr; }
  .bg-sum { position: static; }
  .bg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* one column: the summary and checkout come straight after the items, the stone stage after them */
  .bg-full { row-gap: 0; }
  .bg-items { display: contents; }
  .bg-sum { order: 1; margin-top: 32px; }
  .bg-stage { order: 2; margin-top: 32px; }
}
@media (max-width: 860px) {
  .bg-cols { display: none; }
  .bg-item { grid-template-columns: 92px minmax(0, 1fr) auto; grid-template-areas: "img info info" "img qty line"; gap: 10px 16px; }
  .bg-img { grid-area: img; height: 124px; align-self: start; }
  .bg-img img { height: calc(var(--rh, .8) * 92px); }
  .bg-info { grid-area: info; }
  .bg-qty { grid-area: qty; }
  .bg-line { grid-area: line; align-self: center; }
  .bg-name { font-size: 22px; }
  .bg-dl dd { max-width: 58%; }
  .bg-stage { margin-top: 26px; }
  .bg-stage .fr-media { aspect-ratio: 2 / 1; }
  .bg-stage-row { --ph: 46%; }
  .bg-page:has(.bg-list > .bg-item:only-child) .bg-stage-row { --ph: 48%; }
}
