/* ==================================================================
   Elev8 Labs — preview layer (R23)
   Loads only with the elev8_preview cookie. Everything here is additive
   on top of elev8.css so the live site is untouched until promoted.

   Direction: the cart is a lab manifest, not a coupon pop-up. One quiet
   surface, ink type, numbers set in IBM Plex Mono (already loaded) so the
   timer and money read like an instrument. Brand tokens reused; nothing
   new except a single "verified" green.
   ================================================================== */
:root{
  --e8-ok:#0f8a5f;
  --e8-ok-soft:rgba(15,138,95,.10);
  --e8-warn:#d92d20;
  --e8-mono:'IBM Plex Mono','SFMono-Regular',Menlo,Consolas,monospace;
  --e8-ease:cubic-bezier(.2,.8,.2,1);
}

/* ------------------------------------------------------------------
   Site-wide polish (CSS only)
   ------------------------------------------------------------------ */

/* One primary action per screen. Catalogue cards drop the gradient and
   become solid ink; the gradient is reserved for hero, PDP and checkout. */
body.e8-preview .scard__cta:not(.scard__cta--notify),
body.e8-preview .pcard__cta:not(.pcard__cta--options){
  background:var(--ink)!important;
  background-image:none!important;
  color:#fff!important;
  box-shadow:none!important;
  border-radius:10px!important;
  letter-spacing:.02em;
  transition:background-color .18s var(--e8-ease),transform .18s var(--e8-ease);
}
body.e8-preview .scard__cta:not(.scard__cta--notify):hover,
body.e8-preview .pcard__cta:not(.pcard__cta--options):hover{
  background:var(--accent)!important;
}
body.e8-preview .scard__cta:not(.scard__cta--notify):active,
body.e8-preview .pcard__cta:not(.pcard__cta--options):active{transform:scale(.98)}
body.e8-preview .scard__cta img,body.e8-preview .pcard__cta img{filter:brightness(0) invert(1)}

/* Header cart: count reads as a badge, and the icon is clearly a button. */
body.e8-preview .nav__cart{position:relative;cursor:pointer}
body.e8-preview .nav__cart-count{
  position:absolute;top:-4px;right:-6px;
  min-width:18px;height:18px;padding:0 5px;border-radius:9px;
  background:var(--accent);color:#fff;
  font:700 11px/18px var(--e8-mono);text-align:center;
}
body.e8-preview .nav__cart-count:empty,
body.e8-preview .nav__cart-count[data-zero]{display:none}

html.e8cart-lock{overflow:hidden}

/* ------------------------------------------------------------------
   Drawer shell
   ------------------------------------------------------------------ */
.e8cart{position:fixed;inset:0;z-index:1000;pointer-events:none}
.e8cart__scrim{
  position:absolute;inset:0;
  background:rgba(14,0,48,.55);
  opacity:0;transition:opacity .28s var(--e8-ease);
}
.e8cart__panel{
  position:absolute;top:0;right:0;bottom:0;
  width:min(440px,100vw);
  background:#fff;color:var(--ink);
  display:flex;flex-direction:column;
  box-shadow:-24px 0 60px rgba(14,0,48,.22);
  transform:translateX(104%);
  transition:transform .32s var(--e8-ease);
  outline:none;
}
.e8cart.is-open{pointer-events:auto}
.e8cart.is-open .e8cart__scrim{opacity:1}
.e8cart.is-open .e8cart__panel{transform:none}
.e8cart.is-busy .e8cart__scroll{opacity:.55;pointer-events:none}
.e8cart__scroll{transition:opacity .15s}
@media (prefers-reduced-motion:reduce){
  .e8cart__scrim,.e8cart__panel{transition:none}
}

.e8cart__head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  padding:20px 22px 14px;
  border-bottom:1px solid var(--line);
}
.e8cart__title{
  margin:0;font:800 22px/1.1 var(--font-body);letter-spacing:-.01em;color:var(--ink);
  display:flex;align-items:baseline;gap:8px;
}
.e8cart__count{font:600 13px/1 var(--e8-mono);color:var(--ink-3)}
.e8cart__count::before{content:'\00b7\00a0'}
.e8cart__count::after{content:' items'}
.e8cart__sub{margin:5px 0 0;font-size:12.5px;color:var(--ink-3)}
.e8cart__close{
  flex:none;width:40px;height:40px;border-radius:50%;
  border:1px solid var(--line-2);background:#fff;color:var(--ink);
  display:inline-flex;align-items:center;justify-content:center;cursor:pointer;
  transition:background-color .15s,border-color .15s;
}
.e8cart__close:hover{background:var(--bg-gray);border-color:var(--ink-4)}
.e8cart__close:focus-visible,.e8tabs__tab:focus-visible,.e8checkout:focus-visible,
.e8qty button:focus-visible,.e8item__rm:focus-visible,.e8popi__add:focus-visible{
  outline:2px solid var(--accent);outline-offset:2px;
}

.e8cart__scroll{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:16px 22px 8px}

/* ------------------------------------------------------------------
   Offer + timer — the signature. An instrument, not a sticker.
   ------------------------------------------------------------------ */
.e8offer{
  background:var(--bg-deep);color:#fff;
  border-radius:14px;padding:14px 16px 12px;
  position:relative;overflow:hidden;
}
.e8offer::after{ /* hairline of accent along the base, like a gauge */
  content:'';position:absolute;left:16px;right:16px;bottom:0;height:2px;
  background:linear-gradient(90deg,var(--accent),#00f0e0);opacity:.9;
}
.e8offer__row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.e8offer__label{display:flex;align-items:baseline;gap:10px;min-width:0}
.e8offer__pct{font:800 18px/1 var(--font-body);letter-spacing:-.01em}
.e8offer__code{font:500 12px/1 var(--e8-mono);color:rgba(255,255,255,.62);white-space:nowrap}
.e8offer__code b{color:#fff;font-weight:600}
.e8offer__state{
  flex:none;font:600 11px/1 var(--e8-mono);letter-spacing:.04em;text-transform:uppercase;
  padding:6px 9px;border-radius:6px;
  background:rgba(255,255,255,.10);color:rgba(255,255,255,.75);
}
.e8offer.is-applied .e8offer__state{background:var(--e8-ok);color:#fff}
.e8offer.is-applied .e8offer__state::before{content:'\2713\00a0'}

.e8timer{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin-top:12px;padding-top:12px;border-top:1px solid rgba(255,255,255,.10);
}
.e8timer__lead{font-size:12.5px;color:rgba(255,255,255,.70)}
.e8timer__clock{display:inline-flex;align-items:flex-start;gap:6px}
.e8timer__seg{display:inline-flex;flex-direction:column;align-items:center;gap:3px}
.e8timer__seg b{
  font:600 22px/1 var(--e8-mono);font-variant-numeric:tabular-nums;
  min-width:2ch;text-align:center;
  background:rgba(255,255,255,.08);border-radius:6px;padding:6px 6px;
}
.e8timer__seg i{font:500 9px/1 var(--e8-mono);letter-spacing:.08em;text-transform:uppercase;color:rgba(255,255,255,.5);font-style:normal}
.e8timer__sep{font:600 22px/1 var(--e8-mono);padding-top:6px;color:rgba(255,255,255,.45)}
.e8timer.is-low .e8timer__seg b{background:rgba(217,45,32,.22)}

/* ------------------------------------------------------------------
   Free-shipping ladder
   ------------------------------------------------------------------ */
.e8ship{margin:14px 0 6px}
.e8ship__text{font-size:13px;color:var(--ink-2)}
.e8ship__text b{color:var(--ink);font-weight:700}
.e8ship__bar{height:4px;border-radius:2px;background:var(--bg-gray-2);margin-top:8px;overflow:hidden}
.e8ship__bar i{display:block;height:100%;width:0;background:var(--accent);border-radius:2px;transition:width .5s var(--e8-ease)}
.e8ship.is-done .e8ship__bar i{background:var(--e8-ok)}
.e8ship.is-done .e8ship__text b{color:var(--e8-ok)}

/* ------------------------------------------------------------------
   Tabs
   ------------------------------------------------------------------ */
.e8tabs{display:flex;gap:2px;margin:14px -2px 4px;border-bottom:1px solid var(--line)}
.e8tabs__tab{
  appearance:none;background:none;border:0;cursor:pointer;
  padding:10px 12px 12px;margin-bottom:-1px;
  font:600 13.5px/1 var(--font-body);color:var(--ink-3);
  border-bottom:2px solid transparent;
  transition:color .15s,border-color .15s;
}
.e8tabs__tab:hover{color:var(--ink)}
.e8tabs__tab.is-active{color:var(--ink);border-bottom-color:var(--ink)}
.e8pane{display:none}
.e8pane.is-active{display:block}

/* ------------------------------------------------------------------
   Line items
   ------------------------------------------------------------------ */
.e8items{list-style:none;margin:0;padding:0}
.e8item{
  display:grid;grid-template-columns:64px 1fr;gap:14px;
  padding:14px 0;border-bottom:1px solid var(--line);
}
.e8item:last-child{border-bottom:0}
.e8item__media{
  width:64px;height:64px;border-radius:10px;background:var(--bg-soft);
  border:1px solid var(--line);display:flex;align-items:center;justify-content:center;overflow:hidden;
}
.e8item__media img{width:100%;height:100%;object-fit:contain;display:block}
.e8item__body{min-width:0}
.e8item__top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.e8item__name{font:600 14.5px/1.3 var(--font-body);color:var(--ink);text-decoration:none}
.e8item__name:hover{color:var(--accent)}
.e8item__rm{
  flex:none;width:32px;height:32px;margin:-6px -6px 0 0;border:0;background:none;
  color:var(--ink-4);border-radius:8px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  transition:color .15s,background-color .15s;
}
.e8item__rm:hover{color:var(--e8-warn);background:rgba(217,45,32,.08)}
.e8item__size{margin-top:2px;font:600 11px/1 var(--e8-mono);letter-spacing:.06em;color:var(--ink-3)}
.e8item__row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px}
.e8item__price{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.e8item__price s{display:block;font:400 12px/1.2 var(--e8-mono);color:var(--ink-4);text-decoration-thickness:1px}
.e8item__price b{font:600 15px/1.2 var(--e8-mono);color:var(--ink)}
.e8item__save{margin-top:6px;font-size:12px;color:var(--e8-ok);font-weight:600}

.e8qty{
  display:inline-flex;align-items:stretch;border:1px solid var(--line-2);border-radius:9px;overflow:hidden;
}
.e8qty button{
  width:36px;height:36px;border:0;background:#fff;color:var(--ink);font-size:16px;cursor:pointer;
  transition:background-color .12s;
}
.e8qty button:hover{background:var(--bg-gray)}
.e8qty input{
  width:38px;border:0;border-left:1px solid var(--line);border-right:1px solid var(--line);
  text-align:center;font:600 14px/36px var(--e8-mono);color:var(--ink);background:#fff;
}

.e8empty{padding:28px 0 20px;text-align:center}
.e8empty p{margin:0 0 12px;font-size:14.5px;color:var(--ink-2)}
.e8empty__btn{
  appearance:none;border:1px solid var(--line-2);background:#fff;color:var(--ink);
  padding:11px 16px;border-radius:10px;font:600 13.5px/1 var(--font-body);cursor:pointer;
}
.e8empty__btn:hover{border-color:var(--ink);background:var(--bg-soft)}

/* ------------------------------------------------------------------
   Popular tab
   ------------------------------------------------------------------ */
.e8pop{list-style:none;margin:0;padding:0}
.e8popi{
  display:grid;grid-template-columns:56px 1fr auto;align-items:center;gap:12px;
  padding:12px 0;border-bottom:1px solid var(--line);
}
.e8popi:last-child{border-bottom:0}
.e8popi__media{
  width:56px;height:56px;border-radius:10px;background:var(--bg-soft);border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;overflow:hidden;
}
.e8popi__media img{width:100%;height:100%;object-fit:contain;display:block}
.e8popi__body{min-width:0}
.e8popi__name{
  display:flex;align-items:center;gap:6px;flex-wrap:wrap;
  font:600 14px/1.25 var(--font-body);color:var(--ink);text-decoration:none;
}
.e8popi__name:hover{color:var(--accent)}
.e8popi__coa{
  font:700 9.5px/1 var(--e8-mono);letter-spacing:.06em;padding:3px 5px;border-radius:4px;
  color:var(--e8-ok);background:var(--e8-ok-soft);border:1px solid rgba(15,138,95,.22);
}
.e8popi__meta{margin-top:3px;font:500 11.5px/1.2 var(--e8-mono);color:var(--ink-3)}
.e8popi__price{margin-top:5px;font-variant-numeric:tabular-nums}
.e8popi__price s{font:400 12px var(--e8-mono);color:var(--ink-4);margin-right:6px}
.e8popi__price b{font:600 14px var(--e8-mono);color:var(--ink)}
.e8popi__add{
  appearance:none;min-width:64px;height:40px;padding:0 14px;border-radius:9px;
  border:1px solid var(--ink);background:#fff;color:var(--ink);
  font:700 13px/1 var(--font-body);cursor:pointer;
  transition:background-color .15s,color .15s;
}
.e8popi__add:hover{background:var(--ink);color:#fff}
.e8popi__oos{font:600 11px/1 var(--e8-mono);color:var(--ink-4);text-transform:uppercase;letter-spacing:.06em}
.e8pop__all{
  display:block;margin:14px 0 6px;font:600 13.5px/1 var(--font-body);color:var(--accent);text-decoration:none;
}
.e8pop__all:hover{text-decoration:underline;text-underline-offset:3px}

/* ------------------------------------------------------------------
   Footer: totals + checkout
   ------------------------------------------------------------------ */
.e8cart__foot{
  flex:none;padding:14px 22px calc(16px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line);background:#fff;
  box-shadow:0 -12px 30px rgba(24,0,76,.06);
}
.e8totals{margin:0 0 12px;display:grid;gap:6px}
.e8totals>div{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.e8totals dt{margin:0;font-size:13px;color:var(--ink-3)}
.e8totals dd{margin:0;font:500 13.5px/1 var(--e8-mono);color:var(--ink);font-variant-numeric:tabular-nums}
.e8totals__disc dt{color:var(--e8-ok);font-weight:600}
.e8totals__disc dd{color:var(--e8-ok)}
.e8totals__grand{padding-top:8px;margin-top:2px;border-top:1px dashed var(--line-2)}
.e8totals__grand dt{color:var(--ink);font-weight:700;font-size:14px}
.e8totals__grand dd{font-size:18px;font-weight:600}

.e8checkout{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  min-height:54px;padding:0 20px;border-radius:12px;
  background:linear-gradient(90deg,#00e0d8,var(--accent));color:var(--bg-deep);
  font:800 15px/1 var(--font-body);letter-spacing:.01em;text-decoration:none;
  box-shadow:0 10px 26px rgba(0,150,214,.28);
  transition:transform .18s var(--e8-ease),box-shadow .18s var(--e8-ease),filter .18s;
}
.e8checkout b{font:600 15px/1 var(--e8-mono);font-variant-numeric:tabular-nums}
.e8checkout:hover{transform:translateY(-1px);box-shadow:0 14px 32px rgba(0,150,214,.34)}
.e8checkout:active{transform:none}
.e8checkout.is-disabled{filter:grayscale(1);opacity:.45;box-shadow:none;cursor:not-allowed}
.e8cart__fine{margin:10px 0 0;text-align:center;font-size:11.5px;color:var(--ink-4)}

/* ------------------------------------------------------------------
   Mobile
   ------------------------------------------------------------------ */
@media (max-width:520px){
  .e8cart__panel{width:100vw}
  .e8cart__head{padding:16px 18px 12px}
  .e8cart__scroll{padding:14px 18px 8px}
  .e8cart__foot{padding-left:18px;padding-right:18px}
  .e8timer__seg b{font-size:20px}
  .e8qty button{width:40px;height:40px}
  .e8qty input{line-height:40px}
  .e8popi__add{height:44px}
}
