/* ===========================================================================
   The merch bag: button, drawer, lines.
   Loaded only by the merch pages, beside bag.js.
   Uses the design-system tokens, no hardcoded brand colours.
   =========================================================================== */

/* ── the button ──────────────────────────────────────────────────────── */
.bag-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; margin-left: 10px;
  font: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; border-radius: 0;
  background: transparent; color: inherit;
  border: 1px solid currentColor;
  transition: background 180ms ease, color 180ms ease, opacity 180ms ease;
}
.bag-btn:hover { background: currentColor; }
.bag-btn:hover .bag-btn__count,
.bag-btn:hover span { mix-blend-mode: difference; }
.bag-btn__count {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font-size: 11px; line-height: 1;
  border: 1px solid currentColor; opacity: 0.6;
}
.bag-btn--full .bag-btn__count { opacity: 1; }

/* No nav on the page: keep it reachable anyway. */
.bag-btn--float {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  background: var(--navy, #0A0A0A); color: var(--cream, #E2DD9F);
  border-color: var(--cream, #E2DD9F);
}

/* ── the drawer ──────────────────────────────────────────────────────── */
.bag-veil {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10,10,10,0.55);
  opacity: 0; transition: opacity 260ms ease;
}
.bag-veil.is-open { opacity: 1; }

.bag {
  position: fixed; z-index: 100;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  display: flex; flex-direction: column;
  background: var(--navy, #0A0A0A);
  color: #fff;
  border-left: 1px solid rgba(255,255,255,0.14);
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(.16,.8,.18,1);
}
.bag.is-open { transform: none; }
body.bag-open { overflow: hidden; }

.bag__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 22px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.bag__title {
  margin: 0; font-size: 13px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
}
.bag__close {
  font: inherit; font-size: 26px; line-height: 1;
  background: none; border: 0; color: inherit; cursor: pointer;
  padding: 0 4px; opacity: 0.7;
}
.bag__close:hover { opacity: 1; }

.bag__lines { flex: 1 1 auto; overflow-y: auto; padding: 8px 22px; }
.bag__empty { opacity: 0.6; font-size: 14px; padding: 22px 0; }

.bag__line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center; gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.bag__line-main { display: grid; gap: 3px; min-width: 0; }
.bag__line-name { font-size: 14px; font-weight: 600; }
.bag__line-size { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; }
.bag__line-total { font-size: 14px; font-variant-numeric: tabular-nums; }

.bag__qty { display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,0.3); }
.bag__step {
  width: 30px; height: 30px; cursor: pointer;
  font: inherit; font-size: 15px; line-height: 1;
  background: none; border: 0; color: inherit; opacity: 0.75;
}
.bag__step:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.bag__qty-n {
  min-width: 26px; text-align: center;
  font-size: 13px; font-variant-numeric: tabular-nums;
}

.bag__foot { padding: 18px 22px 24px; border-top: 1px solid rgba(255,255,255,0.14); }
.bag__row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 14px; margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.bag__row--muted { opacity: 0.7; font-size: 13px; }
.bag__note { margin: 6px 0 16px; font-size: 12px; line-height: 1.5; opacity: 0.6; }
.bag__checkout { width: 100%; justify-content: center; }
.bag__checkout[disabled] { opacity: 0.45; cursor: not-allowed; }
.bag__error {
  margin: 12px 0 0; font-size: 13px; line-height: 1.5;
  color: #ffb4a8;
}

@media (prefers-reduced-motion: reduce) {
  .bag, .bag-veil { transition: none; }
}

/* The state picker. It is a question of fact, not a price choice: see the
   note in api/merch-checkout.js for why the bag asks at all. */
.bag__state-wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.bag__state-label {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  font-weight: 700; opacity: 0.6;
}
.bag__state {
  font: inherit; font-size: 13px; padding: 9px 10px; border-radius: 0;
  background: transparent; color: inherit;
  border: 1px solid rgba(255,255,255,0.3);
}
.bag__state option { background: #0A0A0A; color: #fff; }

/* Pre-order. Sits directly above Checkout because that is the last thing
   read before paying, and a surprise on the receipt is a chargeback. */
.bag__preorder {
  margin: 0 0 14px; padding: 10px 12px;
  font-size: 12px; line-height: 1.45;
  border: 1px dashed rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.85);
}
