/* Cart drawer + misc preview additions (appended to styles via <link>) */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(13,15,26,.5);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
  z-index: 90;
}
.cart-overlay.on { opacity: 1; pointer-events: auto; }
/*
 * ANCHORED TO THE READING EDGE WITH A LOGICAL PROPERTY (19 Sep 2026). `inset-inline-end` is the right
 * edge in LTR and the left edge in RTL, so the anchor no longer needs a mirrored override; only the
 * transform and the shadow, which have no logical form, are restated in rtl.css.
 *
 * A CLOSED DRAWER IS GONE, NOT JUST MOVED. It used to be parked off-screen with a transform alone,
 * which leaves every link and button in it in the page's tab order: a keyboard user tabbing through
 * the header walked into an invisible cart. `visibility: hidden` takes it out of the tab order and
 * the accessibility tree. The visibility change is delayed by the slide's length on the way out, so
 * the drawer is still visible while it animates away, and applied immediately on the way in.
 */
.cart-drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: 440px; max-width: 75%;
  background: #fff; z-index: 95;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s linear .3s;
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(13,15,26,.12);
}
.cart-drawer.on {
  transform: translateX(0);
  visibility: visible;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s linear 0s;
}
@media (prefers-reduced-motion: reduce) {
  .cart-drawer, .cart-drawer.on, .cart-overlay { transition: none; }
  .cart-scroll { scroll-behavior: auto; }
}
.cart-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px; border-bottom: 1px solid var(--border);
}
.cart-head h3 { font-size: 18px; font-weight: 500; }
.cart-empty { padding: 60px 24px; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; color: var(--muted); }
.cart-items { flex: 1; overflow: auto; padding: 8px 24px; }
.cart-item {
  display: grid; grid-template-columns: 72px 1fr auto;
  gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-thumb {
  width: 72px; height: 72px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.cart-thumb .vial {
  width: 34%; height: 60%; background: rgba(255,255,255,.7);
  border: 1px solid rgba(13,15,26,.08); border-radius: 4px 4px 10px 10px;
  position: relative;
}
.cart-thumb .vial::before {
  content:""; position: absolute; top: -5px; left: 22%; right: 22%; height: 6px;
  background: rgba(13,15,26,.55); border-radius: 1px;
}
/*
 * Cart line links (DIVERGENCES.md §23). The name and the thumbnail were <div>s; turning them into
 * <a> changes their default display to inline, and an inline box drops `.cart-name`'s
 * `margin-bottom` — the type line moved up 2px on every cart row. `display: block` restores the
 * exact box the <div> had; `width: fit-content` keeps the click zone on the text instead of
 * spanning the whole column, so the empty space beside a short name is not a link.
 */
a.cart-thumb { text-decoration: none; flex-shrink: 0; }
a.cart-name { display: block; width: fit-content; color: inherit; text-decoration: none; }
a.cart-name:hover { text-decoration: underline; }
.cart-name { font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.cart-type, .cart-contents { font-size: 12px; color: var(--muted); } /* .cart-contents: a stack's contents (round 6); its own class, because .cart-type holds a translated category */
.cart-qty { font-size: 12px; color: var(--muted); margin-top: 4px; }
/* Qty stepper (−/value/+) + variant tag */
.cart-qty-row { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.cart-stepper {
  display: inline-flex; align-items: center; gap: 1px;
  border: 1px solid var(--border); border-radius: 100px;
  background: #fff; padding: 2px;
  box-shadow: 0 1px 2px rgba(13,15,26,.05);
}
.cart-step-btn {
  width: 25px; height: 25px; border-radius: 100px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); background: transparent; cursor: pointer;
  transition: background .12s ease, opacity .12s ease;
}
.cart-step-btn svg { width: 13px; height: 13px; display: block; }
.cart-step-btn:hover { background: var(--off); }
.cart-step-btn:disabled { opacity: .3; cursor: default; pointer-events: none; }
.cart-step-num { min-width: 24px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cart-variant { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.cart-price { font-weight: 500; font-size: 14px; text-align: right; }
.cart-remove { font-size: 11px; color: var(--muted); text-decoration: underline; margin-top: 6px; }
/* The home indicator on a notched phone sits over the bottom of a fixed panel; the footer's own
   padding grows by the inset so the Checkout button is never under it. */
.cart-foot { padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.cart-sub { display: flex; justify-content: space-between; font-weight: 500; font-size: 16px; }

/* ===== Compact drawer whenever it's a narrow panel (phones + tablets) =====
   The drawer is always narrow (≤440px desktop / 75% on smaller screens), so the
   breakpoint is generous (≤900px) — a 640px cap missed large phones/tablets where
   the cart still renders as a slim panel and needs the compact sizing. */
@media (max-width: 900px) {
  .cart-head { padding: 11px 15px; }
  .cart-head h3 { font-size: 15px; }

  .cart-progress { padding: 9px 15px; }
  .cart-progress-line { font-size: 11.5px; margin-bottom: 6px; gap: 8px; }
  .cart-progress-num { font-size: 11.5px; }
  .cart-progress-track, .cart-progress-fill { height: 5px; }
  .cart-progress-line--win .cart-win-check { flex-basis: 15px; width: 15px; height: 15px; }

  .cart-items { padding: 2px 15px; }
  .cart-item { grid-template-columns: 42px 1fr auto; gap: 10px; padding: 9px 0; }
  .cart-thumb { width: 42px; height: 42px; border-radius: 7px; }
  .cart-name { font-size: 12px; margin-bottom: 1px; }
  .cart-type, .cart-contents { font-size: 10.5px; }
  .cart-qty { font-size: 10.5px; margin-top: 1px; }
  .cart-qty-row { gap: 7px; margin-top: 5px; }
  .cart-step-btn { width: 22px; height: 22px; }
  .cart-step-btn svg { width: 12px; height: 12px; }
  .cart-step-num { min-width: 20px; font-size: 12px; }
  .cart-variant { font-size: 10px; }
  .cart-price { font-size: 12px; }
  .cart-remove { font-size: 10px; margin-top: 3px; }

  .cart-upsell { padding: 9px 15px; }
  .cart-upsell-head { font-size: 9.5px; margin-bottom: 6px; }
  .cart-upsell-list { gap: 5px; }
  .cart-upsell-item { grid-template-columns: 30px 1fr 24px; gap: 8px; padding: 6px 8px; }
  .cart-upsell-thumb { width: 30px; height: 30px; border-radius: 6px; }
  .cart-upsell-name { font-size: 11.5px; }
  .cart-upsell-price { font-size: 10.5px; }
  .cart-upsell-add { width: 24px; height: 24px; font-size: 14px; }

  .cart-foot { padding: 12px 15px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); gap: 6px; }
  .cart-sub { font-size: 14.5px; }
}


/* Free-shipping progress readout — the bar is meaningless without the
   numbers, so the row always carries "running subtotal / threshold". */
.cart-progress-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-progress-msg { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.cart-progress-num { flex-shrink: 0; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.cart-progress-goal { color: var(--muted); font-weight: 500; }
.cart-progress-line--win .cart-progress-num b { color: var(--green); }

/* ── Applied discount, drawer + ref-link confirmation ──────────────────────── */
/* Same green as every other saving on the site, so a discount reads the same wherever it appears. */
.cart-sub--save span:last-child { color: #16a34a; font-weight: 700; }
.cart-sub--save b { letter-spacing: .06em; text-transform: uppercase; }

/* Ref-link confirmation. Announced politely rather than as an alert: nothing has gone wrong, and
   it must not steal focus from whatever the visitor came to look at. */
.amino-coupon-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 9000; max-width: min(92vw, 420px);
  display: flex; align-items: center; gap: 9px;
  padding: 13px 18px; border-radius: 100px;
  background: var(--ink, #0d0f1a); color: #fff;
  font-size: 13.5px; font-weight: 500; line-height: 1.4;
  box-shadow: 0 6px 24px rgba(13,15,26,.22);
  animation: aminoCouponIn .32s cubic-bezier(.2,.8,.3,1) both;
}
.amino-coupon-toast b { letter-spacing: .06em; text-transform: uppercase; }
.amino-coupon-toast--out { animation: aminoCouponOut .28s ease both; }
@keyframes aminoCouponIn  { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes aminoCouponOut { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, 10px); } }
@media (prefers-reduced-motion: reduce) {
  .amino-coupon-toast, .amino-coupon-toast--out { animation: none; }
}
@media (max-width: 932px) {
  .amino-coupon-toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); font-size: 13px; }
}

/* ===== /cart PAGE layout (distinct from the drawer above) =====
 *
 * These four declarations lived in a style="" attribute on .cart-page-grid, where no media query
 * could reach them, so the page had no mobile layout at all: at 375/390/430px the fixed 360px
 * summary track took the whole row, the items track collapsed to 30px, and every .cart-item
 * computed to zero width and painted its children outside the container — thumbnails stranded in
 * the left page margin, names, steppers and prices painted underneath the summary card, and the
 * document scrolling 448px wide at every phone size. The desktop values are exactly the ones the
 * attribute carried; only the stacked branch below is new.
 *
 * The breakpoint, the static rail and the content-first order match .co-body in checkout.css —
 * the same two-column-with-a-360px-rail shape, collapsed the same way, so the two pages behave
 * alike on a phone instead of each inventing its own answer.
 */
.cart-page-grid { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: start; }
.cart-page-grid > .co-summary { position: sticky; top: 108px; }

@media (max-width: 980px) {
  /* One column: the whole item list first, the summary card under it. */
  .cart-page-grid { grid-template-columns: 1fr; gap: 24px; }
  .cart-page-grid > .cart-items { order: 0; }
  .cart-page-grid > .co-summary { position: static; top: auto; order: 1; }

  /*
   * .cart-items carries the DRAWER's side padding (24px, 15px under 900px). Inside a 440px panel
   * that is the panel's gutter; on the page the .wrap already provides one, and the second inset
   * pushed every line item out of alignment with the heading and the summary card beneath it.
   * The page column is full width here, so it needs no gutter of its own.
   */
  .cart-page-content .cart-items { padding: 0; overflow: visible; }
}
