/* =====================================================================
   On-site cart ('cart' checkout mode only; layout() loads it on every page)
   Header cart button · Add to cart on product cards · the product page purchase form (one-time or
   Subscribe & save, months, quantity) · the cart drawer (lines, subscriptions, delivery, totals).
   Behaviour: assets/js/cart.js. Everything here needs JavaScript, so it stays hidden without it.
   ===================================================================== */

html:not(.js) :is(.cart-btn, .pcard__add, [data-cart-add], .buy__plans, .qty) { display: none !important; }

/* ------------------------------------------------------------ header button */
.cart-btn { position: relative; } /* its 44px touch target is shared by every header icon button (base.css) */
.cart-btn__n {
  position: absolute; top: -5px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--amanita); color: var(--amanita-ink);
  font-size: 11px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--bg);
  animation: cart-pop .45s var(--ease-out) both;
}
[data-glow="on"] .cart-btn__n { background: var(--glow); color: var(--moss-ink); box-shadow: 0 0 0 2px var(--bg), 0 0 14px -2px var(--glow); }
@keyframes cart-pop { from { transform: scale(.4); opacity: 0; } }

/* ------------------------------------------------------- Add to cart (cards) */
/* A full-width button under the price. The card's link still covers the whole card and keeps room for it at the
   bottom; the button rides on a layer the size of the card that takes the link's tilt (base.css), so they move
   as one. Its side and bottom insets are the card body's padding (--pc-px / --pc-pb, retuned per grid). */
.pcard--cart { --add-h: 46px; --add-gap: 12px; position: relative; }
.js .pcard--cart .pcard__go { display: none; } /* the whole card opens the product; the button adds it */
.js .pcard--cart .pcard__price { line-height: 1.2; } /* no 38px arrow beside it any more: a tighter row */
.js .pcard--cart .pcard__body { padding-bottom: calc(var(--pc-pb, 20px) + var(--add-h) + var(--add-gap)); }
.pcard__buy {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: flex-end;
  padding: 0 var(--pc-px, 20px) var(--pc-pb, 20px);
  pointer-events: none;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s var(--ease);
}
.pcard__add { pointer-events: auto; width: 100%; height: var(--add-h); padding: 0 14px; gap: 8px; font-size: 14.5px; }
.pcard__add .i { width: 17px; height: 17px; }
/* a softer glow than a page's main button (base.css): there is one on every card */
[data-glow="on"] .pcard--cart .pcard__buy .btn.pcard__add { box-shadow: 0 0 0 1px color-mix(in srgb, var(--glow) 18%, transparent), 0 10px 26px -14px color-mix(in srgb, var(--glow) 50%, transparent); }

/* --------------------------------------------------------- product: buy form */
.buy { margin-top: 22px; }

/* Subscribe & save on: two option cards, "Subscribe & save" (with its SAVE tab) and "Buy once", side by side; the
   perks panel under both (in the DOM it sits between the cards, so stacked it stays under Subscribe & save). The
   form's own width decides: below 380px (phones) the cards stack. */
.buy--subs { container: buy / inline-size; }
.buy__plans {
  border: 0; margin: 0; min-width: 0;
  padding: 24px 0 0; /* room for the tab */
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.buy__plan--sub { grid-area: 1 / 1; }
.buy__plan--once { grid-area: 1 / 2; }
.buy__perks { grid-area: 2 / 1 / 3 / -1; }
@container buy (max-width: 379px) {
  .buy__plans { grid-template-columns: minmax(0, 1fr); }
  .buy__plan--sub, .buy__plan--once, .buy__perks { grid-area: auto; }
}

/* one option card: radio dot, name and sub-line, price on the right (wide card) or under them (narrow card) */
.buy__plan { position: relative; display: grid; cursor: pointer; container: plan / inline-size; }
.buy__plan input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.buy__plan-box {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name price" "sub price";
  align-items: center; align-content: center; gap: 1px 14px;
  min-height: 70px; padding: 14px 16px 14px 48px;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel);
  transition: border-color .3s var(--ease), background-color .3s var(--ease), box-shadow .3s var(--ease);
}
/* the radio dot */
.buy__plan-box::before {
  content: ""; position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--bg);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.buy__plan:hover .buy__plan-box { border-color: var(--moss); }
.buy__plan input:checked ~ .buy__plan-box { border-color: var(--moss); background: var(--moss-tint); box-shadow: inset 0 0 0 1px var(--moss); }
.buy__plan input:checked ~ .buy__plan-box::before { border-color: var(--moss); box-shadow: inset 0 0 0 5px var(--moss); }
.buy__plan input:focus-visible ~ .buy__plan-box { outline: 2px solid var(--moss); outline-offset: 2px; }
[data-glow="on"] .buy__plan:hover .buy__plan-box { border-color: color-mix(in srgb, var(--glow) 55%, transparent); }
[data-glow="on"] .buy__plan input:checked ~ .buy__plan-box { border-color: var(--glow); box-shadow: inset 0 0 0 1px var(--glow), 0 0 30px -14px var(--glow); }
[data-glow="on"] .buy__plan input:checked ~ .buy__plan-box::before { border-color: var(--glow); box-shadow: inset 0 0 0 5px var(--glow); }
[data-glow="on"] .buy__plan input:focus-visible ~ .buy__plan-box { outline-color: var(--glow); }
.buy__plan-name { grid-area: name; font-size: 15.5px; font-weight: 800; line-height: 1.3; color: var(--ink); }
.buy__plan-sub { grid-area: sub; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.buy__plan-price { grid-area: price; display: grid; justify-items: end; line-height: 1.1; white-space: nowrap; }
.buy__plan-now { font-family: var(--font-display); font-size: 25px; letter-spacing: -.01em; color: var(--ink); }
.buy__plan-price s { font-size: 13.5px; font-weight: 700; color: var(--muted); text-decoration-thickness: 1.5px; }
/* "Buy once" has no sub-line: one row, so its name sits level with the dot and the price */
@container plan (min-width: 300px) { .buy__plan--once .buy__plan-box { grid-template-areas: "name price"; } }
/* narrow cards (side by side in a narrow column): the price goes under the name, both cards' prices on one line */
@container plan (max-width: 299px) {
  .buy__plan-box {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "sub" "price"; grid-template-rows: auto auto 1fr;
    align-items: start; align-content: stretch; padding: 14px 14px 14px 44px;
  }
  .buy__plan-box::before { left: 14px; top: 15px; margin-top: 0; }
  .buy__plan-price { display: flex; align-items: baseline; gap: 8px; align-self: end; margin-top: 10px; }
}
/* the SAVE tab on top of the Subscribe & save card */
.buy__plan-tab {
  position: absolute; left: 16px; bottom: 100%;
  display: inline-flex; align-items: center; height: 24px; padding: 0 11px;
  border-radius: 8px 8px 0 0;
  background: var(--amanita); color: var(--amanita-ink);
  font-size: 10.5px; font-weight: 800; letter-spacing: .16em; line-height: 1; text-transform: uppercase; white-space: nowrap;
}

/* the perks, a soft panel under the cards with a notch pointing up at Subscribe & save; the months join them once
   it is chosen */
.buy__perks {
  position: relative;
  padding: 14px 16px; border-radius: var(--r);
  background: color-mix(in srgb, var(--moss-tint) 65%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--moss) 16%, transparent);
  transition: border-color .3s var(--ease);
}
.buy__perks::before {
  content: ""; position: absolute; left: 20px; top: -7px; width: 12px; height: 12px;
  background: inherit; border: inherit; border-right: 0; border-bottom: 0; border-radius: 3px 0 0 0;
  transform: rotate(45deg);
  transition: border-color .3s var(--ease);
}
.buy__plans:has(.buy__plan--sub input:checked) .buy__perks { border-color: color-mix(in srgb, var(--moss) 38%, transparent); }
[data-glow="on"] .buy__perks { background: color-mix(in srgb, var(--glow) 5%, var(--panel)); border-color: color-mix(in srgb, var(--glow) 16%, transparent); }
[data-glow="on"] .buy__plans:has(.buy__plan--sub input:checked) .buy__perks { border-color: color-mix(in srgb, var(--glow) 40%, transparent); }
.buy__perk-list { display: grid; gap: 7px; }
.buy__perk-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink-2); }
.buy__tick { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--moss); color: var(--moss-ink); }
.buy__tick .i { width: 12px; height: 12px; }
[data-glow="on"] .buy__tick { background: var(--glow); }

.buy__months {
  display: grid; grid-template-columns: auto minmax(0, 220px); justify-content: start; align-items: center; gap: 10px 14px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed color-mix(in srgb, var(--moss) 30%, transparent);
  animation: buy-open .45s var(--ease) both;
}
[data-glow="on"] .buy__months { border-top-color: color-mix(in srgb, var(--glow) 24%, transparent); }
@keyframes buy-open { from { opacity: 0; transform: translateY(-6px); } }
.buy__months-label { font-size: 14px; font-weight: 800; color: var(--ink); }
.buy__terms { grid-column: 1 / -1; font-size: 13px; line-height: 1.45; color: var(--muted); }
.buy__months .buy__select { max-width: none; }
/* narrow phones: the label goes above a full-width select, so "6 months" is never clipped */
@container buy (max-width: 319px) { .buy__months { grid-template-columns: minmax(0, 1fr); } }

/* the call to action under the options: quantity and a wide Add to cart, "Ask a question" on its own line */
.buy--subs .buy__ctas { flex-direction: column; }
.buy--subs .buy__row { flex: none; width: 100%; }
.buy--subs .pdp__ask { flex: none; width: 100%; }
.buy--subs .buy__add { font-size: 16.5px; }
.buy--subs .buy__add .i { width: 20px; height: 20px; }
.buy--subs .buy__add:hover .i { transform: translateX(3px); }

/* the native select, dressed like the site's pills (also used on /checkout/) */
.buy__select { position: relative; display: block; max-width: 240px; }
.buy__select select {
  appearance: none; -webkit-appearance: none;
  width: 100%; min-height: 44px; padding: 0 44px 0 16px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.buy__select select:hover { border-color: var(--moss); }
.buy__select select:focus { outline: none; border-color: var(--moss); box-shadow: 0 0 0 4px color-mix(in srgb, var(--moss) 18%, transparent); }
[data-glow="on"] .buy__select select:focus { border-color: var(--glow); box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 16%, transparent); }
.buy__select select option { background: var(--panel); color: var(--ink); }
.buy__select > .i { position: absolute; right: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; pointer-events: none; color: var(--muted); transition: transform .3s var(--ease); }
.buy__select:focus-within > .i { color: var(--ink); transform: rotate(180deg); }

/* .buy prefixes: product.css loads after this file and styles .pdp__ctas / .pdp__order too */
.buy .buy__ctas { margin-top: 16px; }
.buy__row { display: flex; gap: 12px; flex: 3 1 320px; min-width: 0; }
.buy .buy__row .buy__add { flex: 1 1 auto; min-width: 0; width: auto; }
.buy__note:empty { display: none; }
.buy__note { margin-top: 12px; font-size: 13.5px; font-weight: 700; color: var(--amanita); }

/* quantity stepper (product form and drawer lines) */
.qty {
  display: inline-flex; align-items: center; flex: none;
  height: 58px; padding: 0 6px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--panel);
}
.qty__btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink);
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.qty__btn:hover { background: var(--chip); }
.qty__btn:active { transform: scale(.9); }
.qty__btn .i { width: 18px; height: 18px; }
.qty__btn[aria-disabled="true"] { color: var(--muted); opacity: .45; cursor: not-allowed; }
.qty__btn[aria-disabled="true"]:hover { background: none; }
.qty__input {
  width: 40px; height: 44px; border: 0; background: none; padding: 0;
  text-align: center; font-size: 17px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty__input:focus { outline: none; }
.qty:focus-within:has(.qty__input:focus-visible) { border-color: var(--moss); box-shadow: 0 0 0 4px color-mix(in srgb, var(--moss) 18%, transparent); }
.qty__n { min-width: 28px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.qty--sm { height: 44px; padding: 0; }
.qty--sm .qty__btn { width: 44px; height: 44px; margin-block: -1px; } /* full 44px targets, over the 1px border */

@media (max-width: 760px) {
  .buy__row { flex: none; width: 100%; }
}

/* the sticky bar's price when Subscribe & save is chosen */
.pdp-bar__price small { font-family: var(--font-sans); font-size: 11.5px; font-weight: 700; color: var(--muted); }

/* ------------------------------------------------------------------ the drawer */
html:has(.cart[open]) { overflow: hidden; }
.cart {
  position: fixed; inset: 0 0 0 auto;
  width: min(460px, 100%); height: 100%; max-width: none; max-height: none;
  margin: 0 0 0 auto; padding: 0; border: 0;
  background: var(--bg); color: var(--ink);
  overflow: hidden;
  box-shadow: -40px 0 80px -40px rgba(var(--shadow), .55);
}
.cart::backdrop { background: rgba(12, 17, 11, .46); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
[data-glow="on"] .cart { border-left: 1px solid color-mix(in srgb, var(--glow) 18%, var(--line)); box-shadow: -30px 0 90px -40px color-mix(in srgb, var(--glow) 40%, transparent); }
.cart[open] { animation: cart-in .55s var(--ease-out) both; }
.cart[open]::backdrop { animation: cart-fade .4s var(--ease) both; }
.cart.is-closing { animation: cart-out .26s var(--ease-in) both; }
.cart.is-closing::backdrop { animation: cart-fade .26s var(--ease-in) reverse both; }
@keyframes cart-in { from { transform: translateX(100%); } }
@keyframes cart-out { to { transform: translateX(100%); } }
@keyframes cart-fade { from { opacity: 0; } }

.cart__panel { display: flex; flex-direction: column; height: 100%; }
.cart__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--cart-pad, 24px); border-bottom: 1px solid var(--line);
}
.cart__title { font-size: 30px; letter-spacing: -.025em; line-height: 1; outline: none; }
.cart__title:focus-visible { outline: 2px solid var(--moss); outline-offset: 4px; }
.cart__title-n { font-family: var(--font-sans); font-size: 15px; font-weight: 800; letter-spacing: 0; color: var(--muted); }
.cart__close { width: 44px; height: 44px; }
.cart__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px var(--cart-pad, 24px) 24px; }
@media (max-width: 420px) { .cart { --cart-pad: 16px; } }

.cart__empty { display: grid; justify-items: center; gap: 10px; padding: 56px 12px; text-align: center; color: var(--muted); }
.cart__empty img { width: 52px; height: auto; margin-bottom: 6px; transform: rotate(-8deg); }
.cart__empty-title { font-family: var(--font-display); font-size: 26px; color: var(--ink); letter-spacing: -.02em; }
.cart__empty .btn { margin-top: 12px; }

.cart__sec { padding-top: 14px; }
.cart__sec + .cart__sec { margin-top: 10px; border-top: 1px solid var(--line); }
.cart__sec-title { font-family: var(--font-sans); font-size: 11px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); line-height: 1.4; margin-bottom: 4px; }

/* one line */
.cart-line {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  animation: line-in .45s var(--ease) both;
}
.cart__lines > .cart-line:last-child { border-bottom: 0; }
@keyframes line-in { from { opacity: 0; transform: translateY(6px); } }
.cart-line.is-problem { background: color-mix(in srgb, var(--amanita) 7%, transparent); border-radius: var(--r-s); box-shadow: 0 0 0 8px color-mix(in srgb, var(--amanita) 7%, transparent); }
.cart-line__media { display: block; width: 72px; height: 72px; border-radius: 14px; overflow: hidden; background: #e9e4d8; }
.cart-line__media img { width: 100%; height: 100%; object-fit: contain; padding: 6%; mix-blend-mode: darken; }
.cart-line__info { min-width: 0; display: grid; gap: 4px; }
.cart-line__name { font-family: var(--font-display); font-size: 18.5px; line-height: 1.2; color: var(--ink); text-decoration: none; }
.cart-line__name:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.cart-line__meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.cart-line__meta .i { width: 14px; height: 14px; flex: none; color: var(--moss); }
[data-glow="on"] .cart-line__meta .i { color: var(--glow); }
.cart-line__ctrl { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.cart-line__remove {
  min-height: 44px; padding: 0 8px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 4px;
}
.cart-line__remove:hover { color: var(--amanita); text-decoration-color: currentColor; }
.cart-line__price { text-align: right; font-family: var(--font-display); font-size: 18px; line-height: 1.2; white-space: nowrap; }
.cart-line__price s { display: block; font-size: 13px; color: var(--muted); }
.cart-line__per { font-family: var(--font-sans); font-size: 11px; font-weight: 700; color: var(--muted); }
@media (max-width: 380px) {
  .cart-line { grid-template-columns: 56px minmax(0, 1fr); }
  .cart-line__media { width: 56px; height: 56px; }
  .cart-line__price { grid-column: 2; text-align: left; }
  .cart-line__price s { display: inline; margin-left: 6px; }
}

/* a subscription group: one monthly delivery */
.cart__groups { display: grid; gap: 12px; margin-top: 8px; }
.cart-group {
  padding: 14px 16px 12px; border-radius: var(--r);
  background: var(--moss-tint); border: 1px solid color-mix(in srgb, var(--moss) 18%, transparent);
}
[data-glow="on"] .cart-group { border-color: color-mix(in srgb, var(--glow) 22%, transparent); }
.cart-group .cart-line { border-bottom-color: color-mix(in srgb, var(--moss) 16%, transparent); }

.cart-group__title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 20px; line-height: 1.2; }
.cart-group__title .i { width: 18px; height: 18px; color: var(--moss); }
[data-glow="on"] .cart-group__title .i { color: var(--glow); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--glow) 60%, transparent)); }
.cart-group__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cart-group__sum { display: grid; gap: 4px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--moss) 30%, transparent); }
.cart-group__sum > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.cart-group__sum dt { color: var(--ink-2); }
.cart-group__sum dd { margin: 0; font-weight: 800; }
.cart-group__sum small, .cart__sum small { font-weight: 700; color: var(--muted); font-size: 11.5px; }
.cart-group__hint { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.cart-group__hint .i { width: 15px; height: 15px; flex: none; color: var(--moss); }

/* delivery */
.cart__deliver { border: 0; padding: 18px 0 0; margin: 16px 0 0; min-width: 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
/* floated: a legend then sits inside the fieldset like any heading (not on its border), as a grid item */
.cart__deliver legend { float: left; width: 100%; padding: 0; margin-bottom: 6px; }
.cart__opt { position: relative; display: block; cursor: pointer; }
.cart__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cart__opt-box {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start;
  min-height: 56px; padding: 13px 16px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--panel);
  font-size: 13px; line-height: 1.45; color: var(--muted);
  transition: border-color .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease);
}
.cart__opt-box > .i { width: 20px; height: 20px; margin-top: 1px; color: var(--moss); }
.cart__opt-box b { display: block; font-size: 15px; font-weight: 800; color: var(--ink); }
.cart__opt:hover .cart__opt-box { border-color: var(--moss); }
.cart__opt input:checked + .cart__opt-box { border-color: var(--moss); background: var(--moss-tint); box-shadow: inset 0 0 0 1px var(--moss); }
.cart__opt input:focus-visible + .cart__opt-box { outline: 2px solid var(--moss); outline-offset: 2px; }
[data-glow="on"] .cart__opt-box > .i { color: var(--glow); }
[data-glow="on"] .cart__opt input:checked + .cart__opt-box { border-color: var(--glow); box-shadow: inset 0 0 0 1px var(--glow), 0 0 26px -14px var(--glow); }
[data-glow="on"] .cart__opt input:focus-visible + .cart__opt-box { outline-color: var(--glow); }

.cart__pickup { display: grid; gap: 12px; padding: 2px 2px 4px; animation: buy-open .4s var(--ease) both; }
.cart__pickup-note { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.cart__pickup-note a { color: var(--ink); font-weight: 700; text-decoration-color: var(--accent); text-underline-offset: .2em; }
.cart__tel { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; white-space: nowrap; }
.cart__tel .i { width: 15px; height: 15px; }
.cart__name label { font-size: 13px; }
.cart__name input { background: var(--panel); }
.cart__name input[aria-invalid] { border-color: var(--amanita); }
.cart__field-err { font-size: 13px; font-weight: 700; color: var(--amanita); }

/* footer: progress, totals, checkout */
.cart__foot {
  padding: 16px var(--cart-pad, 24px) calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); background: var(--panel);
  display: grid; gap: 12px;
  transition: background-color .6s var(--ease);
}
.cart__progress { display: grid; gap: 8px; }
.cart__progress-text { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.cart__progress-text .i { width: 17px; height: 17px; flex: none; color: var(--moss); }
.cart__progress-text b { color: var(--ink); }
.cart__bar { display: block; height: 6px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.cart__bar > span { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--moss); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .7s var(--ease), background-color .3s var(--ease); }
.cart__progress.is-free .cart__bar > span { background: var(--gold); }
[data-glow="on"] .cart__progress-text .i { color: var(--glow); }
[data-glow="on"] .cart__bar > span { background: var(--glow); box-shadow: 0 0 12px var(--glow); }
.cart__sum { display: grid; gap: 4px; }
.cart__sum > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.cart__sum dd { margin: 0; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.cart__sum .cart__total { padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); align-items: baseline; }
.cart__sum .cart__total dt { font-weight: 800; color: var(--ink); }
.cart__sum .cart__total dd { font-family: var(--font-display); font-size: 24px; font-weight: 500; }
.cart__fine { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.cart__error {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 12px 14px; border-radius: var(--r-s);
  background: var(--amanita-tint); color: var(--ink);
  font-size: 13.5px; line-height: 1.5;
  animation: buy-open .35s var(--ease) both;
}
.cart__error > .i { width: 18px; height: 18px; color: var(--amanita); margin-top: 1px; }
.cart__error a { color: var(--ink); font-weight: 800; text-decoration-color: var(--amanita); text-underline-offset: .2em; }
.cart__error p + p { margin-top: 6px; }
.cart__checkout { width: 100%; }
/* phones: a tighter footer leaves more room for the lines above it */
@media (max-width: 520px), (max-height: 720px) {
  .cart__foot { gap: 8px; padding-top: 12px; }
  .cart__sum > div { font-size: 13.5px; }
  .cart__sum .cart__total { padding-top: 6px; }
  .cart__sum .cart__total dd { font-size: 21px; }
  .cart__fine { font-size: 12px; line-height: 1.4; }
  .cart__checkout { height: 52px; }
}
.cart__checkout[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.cart__checkout.is-busy { opacity: 1; cursor: progress; }

/* spinner inside a busy button (also used on /checkout/) */
.cart__spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: cart-spin .8s linear infinite; }
.is-busy > .cart__spinner, .co-card__loading > .cart__spinner { display: inline-block; }
.is-busy > .i { display: none; }
@keyframes cart-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .cart[open], .cart.is-closing, .cart[open]::backdrop { animation: none; }
  /* a spinner still has to say "busy" */
  .cart__spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}
