/* Rex Championship Belts — Side Cart drawer (2026-07-22 redesign)
   2026-07-22 space pass: chrome trimmed ~100px so three item cards fit
   without scrolling at 800px. Only duplicated information was removed —
   see the item card and footer sections for the specifics. */
.rex-drawer{
  --navy:#233A77; --navy-deep:#16233F; --gold:#FCCA06; --gold-deep:#E3B200; --gold-soft:#FFF6D6;
  --ink:#14181F; --muted:#566072; --faint:#8A93A3; --line:#E6E9EF; --line-2:#EEF1F6;
  --surface:#fff; --tint:#F6F8FC; --stage-1:#fff; --stage-2:#F5F7FB; --success:#1E9E5A; --danger:#C0392B;
}
.rex-scrim{position:fixed;inset:0;background:rgba(16,22,38,.5);opacity:0;visibility:hidden;transition:opacity .28s;z-index:99998}
.rex-scrim.open{opacity:1;visibility:visible}
.rex-drawer{position:fixed;top:0;right:0;height:100%;width:min(420px,94vw);background:#F6F8FC;z-index:99999;
  transform:translateX(102%);transition:transform .34s cubic-bezier(.4,0,.1,1);display:flex;flex-direction:column;
  box-shadow:-16px 0 50px rgba(22,35,63,.24);font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:#14181F;line-height:1.5}
.rex-drawer.open{transform:none}
.rex-drawer *,.rex-drawer *::before,.rex-drawer *::after{box-sizing:border-box}
.rex-drawer img{max-width:100%;display:block}

/* header */
.rex-drawer-head{flex:none;display:flex;align-items:center;justify-content:space-between;padding:12px 18px 10px;background:var(--surface);border-bottom:1px solid var(--line-2)}
.rex-drawer-head h3{margin:0;font-size:16px;font-weight:800;color:var(--ink);display:flex;align-items:center;gap:8px}
.rex-cart-count{background:var(--navy);color:#fff;font-size:11px;font-weight:800;min-width:20px;height:20px;padding:0 6px;border-radius:100px;display:inline-flex;align-items:center;justify-content:center}
.rex-drawer-x{width:30px;height:30px;border:0;border-radius:8px;background:var(--tint);color:var(--muted);font-size:18px;line-height:1;cursor:pointer;flex:none}
.rex-drawer-x:hover{background:var(--line);color:var(--ink)}

.rex-drawer-body{flex:1;display:flex;flex-direction:column;min-height:0}
.rex-cart-content{flex:1;display:flex;flex-direction:column;min-height:0}

/* ---------- reward milestone bar ---------- */
.rex-reward{flex:none;background:var(--surface);padding:8px 18px 10px;border-bottom:1px solid var(--line-2)}
.rex-miles{position:relative;height:19px}
/* line-height:0 kills the ~5px of phantom leading an inline-block chip inherits */
.rex-mile{position:absolute;top:0;white-space:nowrap;line-height:0;transition:.3s}
/* renamed from .rex-tag: that class collides with a product-image "Save $X"
   badge in rex-product-page.css (position:absolute;top:16px), which dropped the
   milestone pill 16px onto the track whenever the drawer was viewed on a product
   page. Unique name = no collision. */
.rex-mstag{display:inline-block;font-size:9px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;
  padding:2px 7px;line-height:13px;border-radius:100px;background:#fff;border:1px solid var(--line);color:var(--muted);transition:.3s}
.rex-mile.hit .rex-mstag{background:var(--gold-soft);border-color:#F2DE95;color:var(--navy)}
/* navy fill measures 9.55:1 against the track; gold was 1.36:1 and vanished */
.rex-track{position:relative;height:7px;border-radius:100px;background:var(--line-2);margin-top:7px}
.rex-fill{position:absolute;top:0;left:0;bottom:0;border-radius:100px;background:linear-gradient(90deg,#31509E,var(--navy));transition:width .55s cubic-bezier(.4,0,.15,1)}
.rex-dot{position:absolute;top:50%;width:11px;height:11px;border-radius:50%;background:#fff;border:2px solid #CBD2DE;transition:.3s;z-index:2}
.rex-dot.hit{background:var(--gold);border-color:var(--gold-deep);box-shadow:0 0 0 3px rgba(252,202,6,.28)}
.rex-msg{font-size:12px;font-weight:700;color:var(--muted);margin-top:8px;display:flex;align-items:center;justify-content:center;gap:6px;text-align:center}
.rex-msg b{color:var(--navy);font-weight:800}
.rex-tick{color:var(--navy);flex:none}
.rex-won{background:var(--gold-soft);border:1px solid #F2DE95;color:var(--navy);font-weight:800;padding:2px 8px;border-radius:100px;white-space:nowrap;margin-right:6px}

/* ---------- items ---------- */
.rex-cart-items{flex:1;overflow-y:auto;padding:9px 11px;display:flex;flex-direction:column;gap:8px}
/* thumb spans both rows, else it forces row 1 tall and leaves dead space.
   Card height is driven by the text column, not the thumb — which is why the
   thumb could drop 66->56 for free while removing the category eyebrow
   (browsing metadata, redundant once the item is already in the cart)
   is what actually took the card from ~113px to ~93px. */
.rex-mini-item{position:relative;display:grid;grid-template-columns:56px 1fr;gap:3px 11px;background:var(--surface);
  border:1px solid var(--line-2);border-radius:12px;padding:10px;box-shadow:0 1px 2px rgba(20,24,31,.04),0 2px 8px rgba(23,33,64,.05)}
.rex-mini-thumb{grid-row:1/3;align-self:start;width:56px;height:56px;border-radius:10px;
  background:linear-gradient(180deg,var(--stage-1),var(--stage-2));border:1px solid var(--line-2);display:grid;place-items:center;overflow:hidden}
.rex-mini-thumb img{width:100%;height:100%;object-fit:contain;padding:4px}
.rex-mini-meta{min-width:0;padding-right:22px}
.rex-drawer .rex-mini-name{display:block;font-size:13px;font-weight:700;line-height:1.3;margin:0 0 2px;color:var(--ink) !important;text-decoration:none}
.rex-drawer .rex-mini-name:hover{color:var(--navy) !important}
/* now carries the chosen variation (e.g. "4mm · Red"); hidden when there is none */
.rex-mini-sub{font-size:11px;color:var(--faint)}
.rex-mini-rm{position:absolute;top:8px;right:8px;width:22px;height:22px;border:0;border-radius:6px;background:transparent;color:var(--faint);display:grid;place-items:center;cursor:pointer;padding:0}
.rex-mini-rm:hover{background:#FDECEA;color:var(--danger)}
.rex-mini-foot{grid-column:2;display:flex;align-items:center;justify-content:space-between;margin-top:5px}
.rex-mini-stepper{display:inline-flex;align-items:stretch;height:30px;border:1.5px solid var(--line);border-radius:8px;overflow:hidden;background:var(--surface)}
.rex-mini-stepper .rex-cqbtn{width:28px;border:0;background:transparent;color:var(--navy);font-size:14px;font-weight:700;line-height:1;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center}
.rex-mini-stepper .rex-cqbtn:hover{background:var(--navy);color:#fff}
.rex-mini-stepper .rex-cq-val{width:30px;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;border-left:1.5px solid var(--line);border-right:1.5px solid var(--line)}
.rex-mini-price{font-size:14px;font-weight:800;letter-spacing:-.01em;white-space:nowrap;color:var(--ink)}

/* ---------- footer ---------- */
.rex-cart-foot{flex:none;background:var(--surface);border-top:1px solid var(--line-2);padding:3px 18px 14px}
.rex-trow{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:var(--muted);margin-bottom:5px}
.rex-trow .rex-v{font-weight:700;color:var(--ink)}
.rex-trow .rex-disc{color:var(--success)}
.rex-trow .rex-muted{color:var(--faint);font-weight:600}
.rex-trow-total{font-size:15px;font-weight:800;color:var(--ink);border-top:1px solid var(--line-2);margin-top:4px;padding-top:9px}
.rex-trow-total span:last-child{font-size:20px;font-weight:800;letter-spacing:-.02em}
/* replaces a full Shipping row — same promise, one line instead of two columns */
.rex-ship-note{font-size:10.5px;color:var(--faint);text-align:right;margin-top:1px}
.rex-save-note{font-size:11.5px;font-weight:700;color:var(--success);text-align:right;margin-top:3px}

.rex-mini-btn{width:100%;height:48px;border:0;border-radius:11px;font-family:inherit;font-size:14px;font-weight:800;
  display:flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;text-decoration:none;transition:.15s}
.rex-mini-btn svg{flex:none}
.rex-drawer .rex-mini-checkout{background:var(--gold) !important;color:var(--navy-deep) !important;margin-top:10px;letter-spacing:.02em}
.rex-drawer .rex-mini-checkout:hover{background:var(--gold-deep) !important;box-shadow:0 8px 20px rgba(252,202,6,.4)}
/* secondary: navy outline — a white button on a white footer reads as a box */
.rex-drawer .rex-mini-viewcart{background:var(--surface) !important;color:var(--navy) !important;border:2px solid var(--navy);height:40px;margin-top:7px;font-size:13px}
.rex-drawer .rex-mini-viewcart:hover{background:var(--navy) !important;color:#fff !important}

/* ---------- empty ---------- */
.rex-cart-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:40px 24px;color:var(--muted)}
.rex-cart-empty svg{color:var(--line);margin-bottom:14px}
.rex-cart-empty h4{margin:0 0 5px;font-size:16px;font-weight:800;color:var(--ink)}
.rex-cart-empty p{margin:0 0 16px;font-size:13px}
.rex-drawer .rex-mini-shop{background:var(--navy) !important;color:#fff !important;width:auto;padding:0 26px;height:46px}
.rex-drawer .rex-mini-shop:hover{background:var(--navy-deep) !important}

/* Buy Now button on the product page (unchanged behaviour) */
.rex-buy-now{background:#FCCA06 !important;color:#16233F !important;border:0 !important;font-weight:800 !important}
.rex-buy-now:hover{background:#E3B200 !important;color:#16233F !important}
.single_add_to_cart_button.loading{opacity:.7;pointer-events:none}

/* while the server catches up, dim only the totals — the qty already moved */
.rex-cart-foot.rex-syncing .rex-totals{opacity:.45;transition:opacity .15s}
.rex-mini-item{transition:opacity .2s,transform .2s}

/* Inset by ~half a label so every milestone label can be centred on its dot,
   including the one at 100%, without spilling out of the drawer. */
.rex-drawer .rex-bar{position:relative;padding:0 30px}

/* ---------- side-cart upsells (2026-07-22) ---------- */
.rex-ups{flex:none;background:var(--surface);border-top:1px solid var(--line-2);padding:8px 11px 2px}
.rex-ups-head{display:flex;align-items:center;justify-content:space-between;padding:0 3px 7px}
.rex-ups-head h3{margin:0;font-size:12px;font-weight:800;color:var(--ink)}
.rex-ups-nav{display:flex;gap:5px}
.rex-ups-nav button{width:24px;height:24px;border-radius:6px;border:1px solid var(--line);background:#fff;color:var(--muted);display:grid;place-items:center;cursor:pointer;font-size:14px;line-height:1;padding:0}
.rex-ups-nav button:hover:not(:disabled){border-color:var(--navy);color:var(--navy)}
.rex-ups-nav button:disabled{opacity:.32;cursor:default}
.rex-ups-view{overflow:hidden}
.rex-ups-rail{display:flex;transition:transform .35s cubic-bezier(.4,0,.15,1)}
.rex-ups-card{flex:0 0 100%;display:grid;grid-template-columns:60px 1fr auto;gap:10px;align-items:center;padding:2px}
.rex-ups-thumb{width:60px;height:60px;border-radius:9px;background:linear-gradient(180deg,var(--stage-1),var(--stage-2));border:1px solid var(--line-2);display:grid;place-items:center;overflow:hidden}
.rex-ups-thumb img{width:100%;height:100%;object-fit:contain;padding:4px}
.rex-ups-meta{min-width:0}
.rex-ups-name{font-size:12px;font-weight:700;line-height:1.25;color:var(--ink);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}
.rex-ups-price{font-size:12px;font-weight:800;margin-top:1px;color:var(--ink)}
.rex-ups-price .from{font-weight:600;color:var(--faint);font-size:10.5px}
.rex-ups-price .was{color:var(--faint);text-decoration:line-through;font-weight:600;margin-left:5px;font-size:11px}
.rex-ups-unlock{display:inline-block;margin-top:3px;font-size:9px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;background:var(--gold-soft);border:1px solid #F2DE95;color:var(--navy);padding:1px 6px;border-radius:100px}
.rex-ups-add{height:32px;padding:0 14px;border:0;border-radius:8px;background:var(--navy);color:#fff;font-family:inherit;font-size:12px;font-weight:800;cursor:pointer;white-space:nowrap}
.rex-ups-add:hover{background:var(--navy-deep)}

/* ---------- variation picker sheet ---------- */
/* Body-level overlay (moved out of the drawer by JS so it isn't trapped by the
   drawer's transform). Re-declare tokens since they were inherited from .rex-drawer. */
.rex-pick{position:fixed;inset:0;background:rgba(16,22,38,.45);display:none;align-items:flex-end;justify-content:center;z-index:100000;
  --navy:#233A77;--navy-deep:#16233F;--gold:#FCCA06;--gold-deep:#E3B200;--gold-soft:#FFF6D6;--ink:#14181F;--muted:#566072;--faint:#8A93A3;--line:#E6E9EF;--line-2:#EEF1F6;--surface:#fff;--tint:#F6F8FC;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;line-height:1.5;color:#14181F}
.rex-pick.open{display:flex}
.rex-pick-sheet{width:100%;max-width:480px;background:#fff;border-radius:16px 16px 0 0;padding:16px 18px 18px;transform:translateY(100%);transition:transform .3s cubic-bezier(.4,0,.1,1);max-height:88%;overflow-y:auto;position:relative}
.rex-pick.open .rex-pick-sheet{transform:none}
/* Desktop: centre the picker as a modal dialog (mobile keeps the bottom-sheet). */
@media (min-width:768px){
  .rex-pick{align-items:center}
  .rex-pick-sheet{border-radius:16px;transform:translateY(26px)}
  .rex-pick.open .rex-pick-sheet{transform:none}
}
.rex-pick-sheet h4{margin:0 0 2px;font-size:14px;font-weight:800;color:var(--ink);padding-right:34px}
.rex-psub{font-size:11.5px;color:var(--navy);font-weight:700;margin-bottom:13px}
.rex-plabel{font-size:9.5px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--faint);margin-bottom:6px}
.rex-pills{display:flex;gap:6px;margin-bottom:13px}
.rex-pill{flex:1;padding:8px 6px;border:1.5px solid var(--line);border-radius:9px;background:#fff;font-size:12px;font-weight:700;color:var(--ink);cursor:pointer;font-family:inherit;text-align:center}
.rex-pill.on{border-color:var(--navy);background:var(--navy);color:#fff}
.rex-pill small{display:block;font-size:9.5px;font-weight:600;opacity:.7;margin-top:1px}
.rex-sw{display:grid;grid-template-columns:repeat(5,46px);justify-content:start;gap:10px;margin-bottom:14px}
.rex-swatch{height:46px;border-radius:8px;border:2px solid #D5DAE3;cursor:pointer;padding:0;position:relative}
.rex-swatch:hover{border-color:#A9B2C2}
.rex-swatch.on{border-color:var(--navy);box-shadow:0 0 0 3px rgba(35,58,119,.18)}
.rex-swatch.on::after{content:"";position:absolute;inset:0;border-radius:4px;border:2px solid rgba(255,255,255,.9)}
.rex-swatch.on[data-light="1"]::after{border-color:var(--navy);opacity:.5}
.rex-pick-foot{display:flex;align-items:center;gap:11px;border-top:1px solid var(--line-2);padding-top:12px}
.rex-pick-price{font-size:18px;font-weight:800;color:var(--ink)}
.rex-pick-add{flex:1;height:44px;border:0;border-radius:10px;background:var(--gold);color:var(--navy-deep);font-family:inherit;font-size:13.5px;font-weight:800;cursor:pointer}
.rex-pick-add:hover{background:var(--gold-deep)}
.rex-pick-add:disabled{opacity:.6;cursor:default}

/* Clip the reward-pill row so the end pill wrapper (left:100%) cannot spill
   past the drawer edge and create a stray horizontal scrollbar (2026-07-25). */
.rex-drawer .rex-miles{overflow:hidden}

/* ---- Upsell picker fixes (2026-07-26) ---- */
/* Close button had NO css -> rendered as a bordered button in flow above the
   title. Pin it to the title row, top-right, borderless. */
.rex-pick-x{position:absolute;top:13px;right:13px;width:30px;height:30px;border:0;background:transparent;color:#8A93A6;font-size:23px;line-height:1;cursor:pointer;padding:0;border-radius:8px;display:flex;align-items:center;justify-content:center}
.rex-pick-x:hover{background:#F1F3F7;color:#1A2233}
/* Plate-size pills blanked to white on hover (global button:hover reset dropped
   the bg/text). Restore a readable hover for both states. */
.rex-pill:hover{border-color:var(--navy);background:#fff;color:var(--ink)}
.rex-pill.on,.rex-pill.on:hover,.rex-pill.on:focus{border-color:var(--navy);background:var(--navy);color:#fff}
/* Picker swatches: attributes.css forces .rex-swatch{background:white!important};
   repaint from the inline --rexsw var with higher specificity so colours show. */
#rexPickColor .rex-swatch{background:var(--rexsw) !important}
/* Footer compare-at price + clearer border on light (white/yellow) swatches */
.rex-pick-was{text-decoration:line-through;color:#9AA3B2;font-weight:600;font-size:14px;margin-right:6px}
#rexPickColor .rex-swatch[data-light="1"]{border-color:#B4BCCB}
/* Picker swatches now match the product page: 46px rounded squares. Texture
   tiles show the leather image; selected = white-gap + solid navy ring. */
#rexPickColor .rex-swatch{width:46px;height:46px;border-radius:11px;border-width:1px}
#rexPickColor .rex-swatch-img{padding:0;background:#fff !important}
#rexPickColor .rex-swatch-img img{width:100%;height:100%;object-fit:cover;border-radius:10px;display:block}
#rexPickColor .rex-swatch.on{border-color:var(--navy);box-shadow:0 0 0 2px #fff,0 0 0 4px var(--navy)}
#rexPickColor .rex-swatch.on::after{display:none}

/* Respect the OS 'reduce motion' setting — disable cart animations (scoped to the cart + drawer, not the whole site). */
@media (prefers-reduced-motion: reduce){
  #rex-cart-root, #rex-cart-root *, #rexDrawer, #rexDrawer *, #rexScrim{ transition-duration:.01ms !important; animation-duration:.01ms !important; scroll-behavior:auto !important; }
}

/* ---- overlay hardening + touch targets (2026-08-14) ----
   The scrim is full-viewport at z-index 99998. It is only non-blocking today
   because visibility:hidden makes it non-hit-testable; pointer-events makes
   that explicit so a future CSS change cannot turn it into a tap blocker. */
.rex-scrim { pointer-events: none; }
.rex-scrim.open { pointer-events: auto; }

/* Enlarge touch targets on touch devices WITHOUT changing the visual size,
   by projecting an invisible hit area around each control. */
@media (pointer: coarse) {
  .rex-drawer-x { position: relative; }
  .rex-drawer-x::after { content: ""; position: absolute; inset: -7px; }      /* 30 -> 44 */

  .rex-mini-stepper .rex-cqbtn { position: relative; }
  .rex-mini-stepper .rex-cqbtn::after { content: ""; position: absolute; inset: -8px -6px; }  /* 28 -> 44 */

  .rex-ups-prev, .rex-ups-next { position: relative; }
  .rex-ups-prev::after, .rex-ups-next::after { content: ""; position: absolute; inset: -10px; } /* 24 -> 44 */
}
