/* =============================================================================
   RepBox v3 — cart.html + checkout.html + confirmation.html (page layer on base.css)
   Sections: 0 shared page head · 1 cart · 2 checkout (.co-*) · 3 confirmation (.cf-*)
   Rules: one accent, rarity colours never appear here (no rarity elements on these pages),
   hover motion only under (hover: hover), nothing at bottom:0 (the shell owns the tab bar).
   ============================================================================= */

/* ---------------------------------------------------------------------------
   0 SHARED: page head, hidden guard, small pieces
   --------------------------------------------------------------------------- */
[hidden] { display: none !important; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--border);
}
.page-head__text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.page-head__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  line-height: .9;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--text);
}
.page-head__title em { font-style: normal; color: var(--accent); text-shadow: var(--accent-text-glow); }
.page-head__meta { font-size: 13px; color: var(--muted); }
.page-head__meta b { color: var(--text-2); font-weight: 700; }
.page-head__link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.page-head__link::after { content: '\2192'; font-size: 14px; transition: transform var(--dur) var(--ease-out); }
.page-head__link:hover { text-decoration: none; }
@media (hover: hover) { .page-head__link:hover::after { transform: translateX(4px); } }
/* phones: the topbar already carries the way back (cart button / SHOP BOXES), so the head stays three lines */
@media (max-width: 767px) { .page-head__link { display: none; } }
@media (min-width: 768px) { .page-head { padding: 8px 0 16px; } }

/* a dense "what you get" strip: icon tile + two lines, 1 col at 375, 3 across from 600px */
.trust { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.trust__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  min-width: 0;
}
.trust__icon {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(var(--accent-rgb), .22);
  color: var(--accent);
}
.trust__icon svg { width: 18px; height: 18px; }
.trust__text { display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--muted); line-height: 1.35; min-width: 0; }
.trust__text b { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
@media (min-width: 600px) { .trust { grid-template-columns: repeat(3, minmax(0, 1fr)); } .trust__item { padding: 10px; gap: 9px; } }

/* summary card (cart aside + confirmation) */
.summary-card { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.summary-card__title { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; color: var(--text); }
.summary-card__actions { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 768px) { .summary-card { padding: 20px; } }

/* upsell / "start here" strips */
.upsell { display: flex; flex-direction: column; gap: 12px; }
.upsell__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; }
.upsell__title { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1; letter-spacing: .03em; text-transform: uppercase; color: var(--text); margin-top: 6px; }
.upsell__hint { font-size: 12px; font-weight: 600; color: var(--muted); }
.upsell__hint--link { display: inline-flex; align-items: center; min-height: 44px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.upsell__hint--link:hover { text-decoration: none; }
/* two cards fit a phone row (auto-fill 160px); the third joins from 768px */
@media (max-width: 767px) { .upsell__grid > :nth-child(n + 3) { display: none; } }

/* ---------------------------------------------------------------------------
   1 CART
   --------------------------------------------------------------------------- */
.cart { display: flex; flex-direction: column; gap: 16px; }
.cart__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cart__lines { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cart__aside { min-width: 0; }
.cart__empty { display: flex; flex-direction: column; gap: 24px; }
.cart__empty .empty-state { padding-block: clamp(32px, 8vw, 56px); }
.cart__empty .empty-state__title { font-size: clamp(2rem, 9vw, 3rem); }
.line-items:empty { display: none; }

/* promo: input state <-> applied state */
.promo { display: flex; flex-direction: column; gap: 8px; }
.promo__applied {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 52px;
  padding: 6px 6px 6px 14px;
  border: 1px dashed var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--accent-dim-2);
}
.promo__tag { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.promo__tag b { font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1; letter-spacing: .06em; color: var(--accent); text-shadow: 0 0 12px rgba(var(--accent-rgb), .35); }
.promo__tag span { font-size: 12px; color: var(--muted); }
.promo__remove {
  flex: 0 0 auto;
  min-height: 44px; padding: 0 12px;
  border-radius: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-2);
  transition: color var(--dur), background-color var(--dur);
}
@media (hover: hover) { .promo__remove:hover { color: var(--text); background: var(--surface-3); } }

/* phone order: lines -> summary + CHECKOUT -> trust -> upsell; desktop: the summary column
   spans every row on the right and sticks under the topbar */
@media (min-width: 900px) {
  .cart__layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas: "lines aside" "trust aside" "upsell aside";
    align-items: start;
    gap: 20px;
  }
  .cart__lines { grid-area: lines; }
  .cart__aside { grid-area: aside; position: sticky; top: calc(var(--topbar-h) + 16px); }
  .cart__layout > .trust { grid-area: trust; }
  .cart__layout > .upsell { grid-area: upsell; }
}
@media (min-width: 1100px) { .cart__layout { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (min-width: 1280px) { .cart__layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; } }

/* ---------------------------------------------------------------------------
   2 CHECKOUT (.co-*)  — .topbar--plain + .shell__body--full; form left, sticky summary right
   --------------------------------------------------------------------------- */
.co { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.co__form { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.co__aside { min-width: 0; }
.co-section { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.co-section__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.co-section__title { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; color: var(--text); padding-top: 2px; }
.co-section__aside { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.co-section__aside a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.co-brands { display: inline-flex; gap: 4px; margin-left: auto; }
.co-brands span {
  display: inline-grid; place-items: center;
  min-width: 40px; height: 22px; padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  transition: color var(--dur), border-color var(--dur), background-color var(--dur);
}
.co-brands span.is-on { color: var(--accent); border-color: var(--accent-border); background: var(--accent-dim-2); }
/* expiry + CVC share a row on every width (two short fields) */
.co-grid-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.co-prefill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.co-prefill i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* items inside the summary */
.co-items { display: flex; flex-direction: column; }
.co-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.co-item:first-child { padding-top: 0; }
.co-item__art {
  position: relative;
  width: 52px; height: 52px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
}
.co-item__art .photo { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.co-item__qty {
  position: absolute; top: -1px; right: -1px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 0 8px 0 8px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 13px; letter-spacing: .04em; line-height: 1; padding-top: 2px;
}
.co-item__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.co-item__name { font-family: var(--font-display); font-weight: 400; font-size: 18px; line-height: 1; letter-spacing: .03em; text-transform: uppercase; color: var(--text); }
.co-item__meta { font-size: 12px; color: var(--muted); }
.co-item__meta b { color: var(--text-2); font-weight: 600; }
.co-item__price { font-family: var(--font-display); font-size: 18px; letter-spacing: .02em; color: var(--text); white-space: nowrap; }
.co-item__price small { display: block; font-family: var(--font-body); font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; letter-spacing: .04em; }

.co-pay { display: flex; flex-direction: column; gap: 10px; }
.co-pay__demo { font-size: 12px; color: var(--muted-2); text-align: center; line-height: 1.45; }
.co-secure {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.co-secure span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.co-secure svg { width: 13px; height: 13px; color: var(--accent); }
.co-ship-note { font-size: 12px; color: var(--muted-2); }

@media (min-width: 600px) { .co-section { padding: 20px; } }
@media (min-width: 900px) {
  .co { grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
  .co__aside { position: sticky; top: calc(var(--topbar-h) + 16px); }
  .co__form { gap: 16px; }
}

/* ---------------------------------------------------------------------------
   3 CONFIRMATION (.cf-*)
   --------------------------------------------------------------------------- */
.cf { display: flex; flex-direction: column; gap: 16px; }
.cf-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 16px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.cf-hero::after {
  content: '';
  position: absolute; right: -60px; top: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .16), transparent 62%);
  pointer-events: none;
}
.cf-hero > * { position: relative; z-index: 1; }
.cf-hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4.5rem, 24vw, 8rem);
  line-height: .85;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--text);
}
.cf-hero__title em { font-style: normal; color: var(--accent); text-shadow: var(--accent-text-glow); }
.cf-hero__lead { font-size: 15px; color: var(--text-2); max-width: 54ch; line-height: 1.5; }
.cf-hero__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cf-id {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  padding: 4px 6px 4px 14px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--accent-dim-2);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .12), 0 0 22px rgba(var(--accent-rgb), .16);
}
.cf-id__label { font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.cf-id__value { font-family: var(--font-display); font-size: 26px; line-height: 1; letter-spacing: .06em; color: var(--accent); text-shadow: 0 0 14px rgba(var(--accent-rgb), .4); padding-top: 2px; }
.cf-id__copy {
  width: 44px; height: 44px;
  margin: -4px -2px -4px -2px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-2);
  transition: color var(--dur), background-color var(--dur);
}
.cf-id__copy svg { width: 16px; height: 16px; }
@media (hover: hover) { .cf-id__copy:hover { color: var(--accent); background: var(--accent-dim); } }
.cf-hero__meta { font-size: 13px; color: var(--muted); }
.cf-hero__meta b { color: var(--text-2); font-weight: 600; }
.cf-hero__actions { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 480px) { .cf-hero__actions { flex-direction: row; flex-wrap: wrap; } }
@media (min-width: 768px) { .cf-hero { padding: 28px 24px 24px; } }

.cf-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cf-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cf-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cf-section { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.cf-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.cf-section__title { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; color: var(--text); }
.cf-section__hint { font-size: 12px; color: var(--muted); }
.cf-section__hint b { color: var(--accent); font-weight: 700; }

/* what happens next: three numbered tiles */
.cf-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.cf-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.cf-step__num {
  grid-row: 1 / span 2;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--accent-border);
  background: var(--accent-dim-2);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 17px; line-height: 1; padding-top: 2px;
}
.cf-step__title { font-family: var(--font-display); font-weight: 400; font-size: 19px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; color: var(--text); padding-top: 2px; }
.cf-step__text { font-size: 13px; color: var(--muted); line-height: 1.45; }
.cf-step__text b { color: var(--text-2); font-weight: 600; }
@media (min-width: 600px) { .cf-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cf-step { grid-template-columns: minmax(0, 1fr); } .cf-step__num { grid-row: auto; margin-bottom: 6px; } }

/* sealed boxes: one card per line (cover photo, name, kind, the pick, price), one sealed tile per unit */
.cf-boxes { display: flex; flex-direction: column; gap: 12px; }
.cf-box { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.cf-box__head { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.cf-box__art {
  width: 64px; height: 64px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  overflow: hidden;
}
.cf-box__art .photo { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.cf-box__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-box__name { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1; letter-spacing: .03em; text-transform: uppercase; color: var(--text); }
.cf-box__meta { font-size: 12px; color: var(--muted); }
.cf-box__meta b { color: var(--text-2); font-weight: 600; }
.cf-box__price { font-family: var(--font-display); font-size: 22px; letter-spacing: .02em; color: var(--accent); white-space: nowrap; text-align: right; }
.cf-box__price small { display: block; font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
/* tiles stay small squares at every width: a single-box order must not blow its photo up to the card width */
.cf-box .mystery-tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 92px), 1fr)); gap: 8px; }
@media (max-width: 599px) {
  .cf-box { padding: 12px; }
  /* the price sits on the name row and the meta + size tags get the full width under it */
  .cf-box__head {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas: "art name price" "art meta meta" "art sizes sizes";
    align-items: start;
    gap: 4px 10px;
  }
  .cf-box__body { display: contents; }
  .cf-box__art { grid-area: art; width: 52px; height: 52px; }
  .cf-box__name { grid-area: name; font-size: 20px; padding-top: 2px; }
  .cf-box__meta { grid-area: meta; }
  .cf-box__body > .sizes { grid-area: sizes; margin-top: 2px; }
  .cf-box__price { grid-area: price; font-size: 20px; padding-top: 1px; }
  .cf-box .mystery-tiles { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
  .cf-box .mystery-tile--photo .mystery-tile__q { font-size: 34px; }
  .cf-box .mystery-tile--photo .mystery-tile__label { font-size: 9px; letter-spacing: .06em; padding: 2px 6px 1px; bottom: 5px; }
}
@media (min-width: 600px) { .cf-box__head { grid-template-columns: 72px minmax(0, 1fr) auto; } .cf-box__art { width: 72px; height: 72px; } }
/* a tile grid with a fixed max: three sealed boxes never stretch beyond ~100px each */
.cf-box .mystery-tiles { max-width: 100%; }
@media (min-width: 600px) { .cf-box .mystery-tiles { grid-template-columns: repeat(auto-fill, 96px); } }

/* order details: key/value grid */
.cf-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.cf-detail { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cf-detail--full { grid-column: 1 / -1; }
.cf-detail__key { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cf-detail__val { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; overflow-wrap: anywhere; }
.cf-detail__val small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.cf-card-brand { display: inline-flex; align-items: center; gap: 8px; }
.cf-card-brand i { display: inline-grid; place-items: center; min-width: 38px; height: 20px; padding: 0 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }

.cf-share { display: block; padding: 12px 14px; border: 1px dashed var(--accent-border); border-radius: 10px; background: var(--accent-dim-2); font-size: 13px; color: var(--text-2); }
.cf-share b { color: var(--accent); }

@media (min-width: 900px) {
  .cf-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
  .cf-section { padding: 20px; }
}
@media (min-width: 1100px) { .cf-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (min-width: 1280px) { .cf-grid { grid-template-columns: minmax(0, 1fr) 380px; } }

/* not found */
.cf-notfound { display: flex; flex-direction: column; gap: 24px; }
.cf-notfound .empty-state { padding-block: clamp(36px, 9vw, 64px); }
.cf-notfound__actions { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 360px; }
@media (min-width: 480px) { .cf-notfound__actions { flex-direction: row; max-width: none; width: auto; } }

/* ---------------------------------------------------------------------------
   reduced motion: nothing here animates on its own; base.css covers the rest
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .page-head__link::after { transition: none; }
}
