/* ==================================================================
   Elev8 Labs — product card system v3
   Loads with body.e8-cards. Applies to the three card surfaces:
     .scard  (shop grid + shop carousels)
     .pcard  (homepage grid, PDP "commonly researched with")
     .dafp3-item (GLP band)
   and, lightly, to the small thumbs in the cart drawer / checkout.

   The idea: the packaging is black with an amber cap (vials) or blue
   accents (liquids, powders). White cards fought that. So the product
   now stands on a dark "stage" with a tinted glow behind it — the same
   navy the hero uses — and the information sits below on white, in one
   fixed order: what it is, what's in it, what it costs, then the action.
   ================================================================== */
:root{
  --card-r:18px;
  --card-line:rgba(15,23,42,.08);
  --card-stage-a:#141D33;
  --card-stage-b:#0A0F1E;
  --glow-vial:rgba(245,165,36,.62);
  --glow-liquid:rgba(56,189,248,.55);
  --glow-powder:rgba(56,189,248,.48);
  --glow-access:rgba(0,194,184,.5);
}

/* ---------- Grids: consistent gutters ---------- */
body.e8-cards .prod-grid{gap:20px!important}
body.e8-cards .da-store .swiper-slide{height:auto}
@media (max-width:720px){ body.e8-cards .prod-grid{gap:12px!important} }

/* ---------- Card shell ---------- */
body.e8-cards .scard,
body.e8-cards .pcard{
  background:#fff!important;
  border:1px solid var(--card-line)!important;
  border-radius:var(--card-r)!important;
  overflow:hidden;
  box-shadow:0 1px 2px rgba(15,23,42,.04)!important;
  transition:transform .38s cubic-bezier(.16,1,.3,1),box-shadow .38s cubic-bezier(.16,1,.3,1),border-color .2s!important;
  transform:none!important;
}
body.e8-cards .pcard::after{display:none}
body.e8-cards .scard:hover,
body.e8-cards .pcard:hover{
  transform:translateY(-6px)!important;
  border-color:rgba(15,23,42,.14)!important;
  box-shadow:
    0 30px 50px -22px rgba(10,15,30,.35),
    0 12px 24px -12px rgba(10,15,30,.18)!important;
}
body.e8-cards .scard:focus-within,body.e8-cards .pcard:focus-within{outline:2px solid var(--accent);outline-offset:2px}

/* ---------- Media: the stage ---------- */
body.e8-cards .scard__media,
body.e8-cards .pcard__media,
body.e8-cards .dafp3-media{
  position:relative;isolation:isolate;overflow:hidden;
  aspect-ratio:1/1;height:auto!important;padding:0!important;
  background:linear-gradient(180deg,var(--card-stage-a) 0%,var(--card-stage-b) 100%)!important;
  display:flex;align-items:center;justify-content:center;
  border-radius:0!important;
}
/* layered glow: a blurred disc of the family colour, low behind the product */
body.e8-cards .scard__media::before,
body.e8-cards .pcard__media::before,
body.e8-cards .dafp3-media::before{
  content:'';position:absolute;left:50%;top:58%;width:62%;aspect-ratio:1/1;
  transform:translate(-50%,-50%);border-radius:50%;
  background:var(--glow,var(--glow-vial));
  filter:blur(34px);opacity:.55;
  transition:opacity .5s ease,transform .6s cubic-bezier(.16,1,.3,1);
  z-index:0;pointer-events:none;
}
/* ground: a soft ellipse the product sits on */
body.e8-cards .scard__media::after,
body.e8-cards .pcard__media::after,
body.e8-cards .dafp3-media::after{
  content:'';position:absolute;left:50%;bottom:9%;width:46%;height:6%;
  transform:translateX(-50%);border-radius:50%;
  background:rgba(0,0,0,.55);filter:blur(10px);opacity:.7;
  transition:transform .5s cubic-bezier(.16,1,.3,1),opacity .5s;
  z-index:1;pointer-events:none;animation:none!important;
}
body.e8-cards [data-fam="liquid"] .scard__media::before,body.e8-cards [data-fam="liquid"] .pcard__media::before,body.e8-cards [data-fam="liquid"] .dafp3-media::before{background:var(--glow-liquid)}
body.e8-cards [data-fam="powder"] .scard__media::before,body.e8-cards [data-fam="powder"] .pcard__media::before,body.e8-cards [data-fam="powder"] .dafp3-media::before{background:var(--glow-powder)}
body.e8-cards [data-fam="warm"] .scard__media::before,body.e8-cards [data-fam="warm"] .pcard__media::before,body.e8-cards [data-fam="warm"] .dafp3-media::before{background:rgba(249,115,22,.55)}
body.e8-cards [data-fam="access"] .scard__media::before,body.e8-cards [data-fam="access"] .pcard__media::before,body.e8-cards [data-fam="access"] .dafp3-media::before{background:var(--glow-access)}

body.e8-cards .scard__media img,
body.e8-cards .pcard__media img,
body.e8-cards .dafp3-media img{
  position:relative;z-index:2;
  width:auto!important;height:78%!important;max-width:80%!important;max-height:none!important;
  object-fit:contain;
  filter:drop-shadow(0 18px 18px rgba(0,0,0,.5));
  transition:transform .6s cubic-bezier(.16,1,.3,1),filter .6s;
  animation:none!important;
  transform:none!important;
}
body.e8-cards .scard:hover .scard__media img,
body.e8-cards .pcard:hover .pcard__media img,
body.e8-cards .dafp3-item:hover .dafp3-media img{
  transform:translateY(-7px) scale(1.035)!important;
  filter:drop-shadow(0 28px 26px rgba(0,0,0,.55));
}
body.e8-cards .scard:hover .scard__media::before,
body.e8-cards .pcard:hover .pcard__media::before,
body.e8-cards .dafp3-item:hover .dafp3-media::before{opacity:.9;transform:translate(-50%,-50%) scale(1.18)}
body.e8-cards .scard:hover .scard__media::after,
body.e8-cards .pcard:hover .pcard__media::after,
body.e8-cards .dafp3-item:hover .dafp3-media::after{transform:translateX(-50%) scale(.9);opacity:.5}
/* out of stock: product goes quiet */
body.e8-cards .scard--oos .scard__media img{filter:grayscale(1) opacity(.55)}
body.e8-cards .scard--oos .scard__media::before{opacity:.18}

/* badges live on the stage, glass on dark */
body.e8-cards .scard__badge,body.e8-cards .pcard__newtag,body.e8-cards .dafp3-badge{
  position:absolute;top:12px;left:12px;z-index:3;
  padding:5px 9px;border-radius:999px;
  background:rgba(255,255,255,.10)!important;border:1px solid rgba(255,255,255,.16);
  color:#fff!important;font:700 10.5px/1 var(--font-body);letter-spacing:.05em;text-transform:uppercase;
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
}
body.e8-cards .scard__save{
  position:absolute;top:12px;right:12px;z-index:3;
  padding:5px 8px;border-radius:7px;
  background:var(--warm)!important;color:var(--bg-deep)!important;
  font:800 11px/1 'IBM Plex Mono',monospace;
}
body.e8-cards .scard__soon{
  position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:3;
  padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.12);color:#fff;
  font:700 10.5px/1 var(--font-body);letter-spacing:.05em;text-transform:uppercase;
}

/* ---------- Body: one fixed hierarchy ---------- */
body.e8-cards .scard__body{
  display:flex;flex-direction:column;gap:0;
  padding:16px 16px 16px!important;background:#fff;
}
/* order: what it is -> what's in it -> what it costs -> the action */
body.e8-cards .scard__head + .scard__tag{order:1}   /* research area, as an eyebrow */
body.e8-cards .scard__head{order:2}
body.e8-cards .scard__size{order:3}
body.e8-cards .scard__price{order:4}
body.e8-cards .scard__unit{order:5}
body.e8-cards .scard__body > .scard__tag:last-of-type{order:6}    /* one-line description */
body.e8-cards .scard__cta{order:7}

body.e8-cards .scard__head + .scard__tag{
  font:700 10.5px/1.2 'IBM Plex Mono',monospace!important;letter-spacing:.08em;text-transform:uppercase;
  color:var(--ink-4)!important;margin:0 0 8px!important;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.e8-cards .scard__head{align-items:flex-start;gap:8px;margin:0 0 6px}
body.e8-cards .scard__name{
  font:700 17px/1.2 var(--font-display)!important;letter-spacing:-.015em;color:var(--ink)!important;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
body.e8-cards .scard__coa{margin-top:2px}
body.e8-cards .scard__size{margin:0 0 12px;font-size:11px;color:var(--ink-3)}
body.e8-cards .scard__price{
  display:flex!important;align-items:baseline;gap:8px;flex-wrap:wrap;
  font:600 18px/1.1 'IBM Plex Mono',monospace!important;color:var(--ink)!important;
}
body.e8-cards .scard__price .e8price__was{font-size:12px;opacity:.42;font-weight:500}
body.e8-cards .scard__price .e8price__now{font-size:18px}
body.e8-cards .scard__unit{margin:4px 0 0;font:500 11.5px/1.2 'IBM Plex Mono',monospace;color:var(--ink-3)}
body.e8-cards .scard__body > .scard__tag:last-of-type{
  margin:10px 0 0;font-size:12.5px;line-height:1.45;color:var(--ink-3);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
body.e8-cards .scard__cta{
  margin-top:14px!important;
  min-height:44px;border-radius:11px!important;
  background:var(--ink)!important;color:#fff!important;
  font:700 13px/1 var(--font-body)!important;letter-spacing:.01em;text-transform:none!important;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  transition:background-color .2s,transform .18s!important;
}
body.e8-cards .scard__cta:hover{background:var(--accent)!important;color:var(--bg-deep)!important}
body.e8-cards .scard__cta:active{transform:scale(.985)}
body.e8-cards .scard__cta img{width:15px;height:15px;filter:brightness(0) invert(1)}
body.e8-cards .scard__cta:hover img{filter:none}

/* ---------- .pcard (home + PDP related): same stage, tighter body ---------- */
body.e8-cards .pcard__body{padding:14px 16px 16px!important;gap:4px}
body.e8-cards .pcard__cat{font:700 10.5px/1.2 'IBM Plex Mono',monospace!important;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-4)!important}
body.e8-cards .pcard__name{font:700 16.5px/1.2 var(--font-display)!important;letter-spacing:-.015em;color:var(--ink)!important}
body.e8-cards .pcard__hf:last-child{margin-top:10px;align-items:center;gap:10px}
body.e8-cards .pcard__price{font:600 17px/1.1 'IBM Plex Mono',monospace!important;color:var(--ink)!important;display:inline-flex;align-items:baseline;gap:7px}
body.e8-cards .pcard__price .e8price__was{font-size:12px;opacity:.42}
body.e8-cards .pcard__cta{
  min-height:40px;padding:0 14px;border-radius:10px!important;
  background:var(--ink)!important;color:#fff!important;font:700 12.5px/1 var(--font-body)!important;
}
body.e8-cards .pcard__cta:hover{background:var(--accent)!important;color:var(--bg-deep)!important}

/* ---------- GLP band items ---------- */
body.e8-cards .dafp3-item{border-radius:var(--card-r);overflow:hidden;border:1px solid var(--card-line);background:#fff}
body.e8-cards .dafp3-media{aspect-ratio:4/3}
body.e8-cards .dafp3-media img{height:82%!important}
body.e8-cards .dafp3-badge{width:auto!important;right:auto!important;display:inline-flex}
body.e8-cards .dafp3-name{font:800 22px/1.15 var(--font-display)!important;letter-spacing:-.02em!important;text-transform:none!important;color:var(--ink)!important}
body.e8-cards .dafp3-sub{font:500 11.5px/1.3 'IBM Plex Mono',monospace!important;letter-spacing:.06em;color:var(--ink-3)!important}

/* ---------- Small thumbs: drawer + checkout share the stage ---------- */
body.e8-cards .e8item__media,body.e8-cards .e8popi__media,body.e8-cards .e8co-item__img{
  background:linear-gradient(180deg,var(--card-stage-a),var(--card-stage-b))!important;border-color:transparent!important;
}
body.e8-cards .e8item__media img,body.e8-cards .e8popi__media img{width:82%;height:82%;filter:drop-shadow(0 6px 6px rgba(0,0,0,.5))}
body.e8-cards .e8co-item__img{padding:5px;object-fit:contain}

/* ---------- Phones ---------- */
@media (max-width:720px){
  body.e8-cards .scard__media,body.e8-cards .pcard__media{aspect-ratio:4/5}
  body.e8-cards .scard__media img,body.e8-cards .pcard__media img{height:74%!important}
  body.e8-cards .scard__body{padding:12px 12px 12px!important}
  body.e8-cards .scard__name{font-size:15px!important;overflow-wrap:anywhere}
  /* narrow columns: the COA chip drops under the name instead of squeezing it */
  body.e8-cards .scard__head{flex-wrap:wrap;gap:6px 8px}
  body.e8-cards .scard__head .scard__name{flex:1 1 100%}
  body.e8-cards .scard__price .e8price__now{font-size:16px}
  body.e8-cards .scard__body > .scard__tag:last-of-type{display:none}   /* price + action stay above the fold */
  body.e8-cards .scard__cta{min-height:42px;font-size:12.5px!important}
  body.e8-cards .scard__badge,body.e8-cards .pcard__newtag{top:10px;left:10px;font-size:10px;padding:4px 7px}
  body.e8-cards .scard__save{top:10px;right:10px}
  body.e8-cards .pcard__body{padding:12px!important}
  body.e8-cards .pcard__name{font-size:15px!important}
}
@media (hover:none){
  body.e8-cards .scard:hover,body.e8-cards .pcard:hover{transform:none!important;box-shadow:0 1px 2px rgba(15,23,42,.04)!important}
}
@media (prefers-reduced-motion:reduce){
  body.e8-cards .scard,body.e8-cards .pcard,body.e8-cards .scard__media img,body.e8-cards .pcard__media img,body.e8-cards .dafp3-media img,
  body.e8-cards .scard__media::before,body.e8-cards .pcard__media::before,body.e8-cards .dafp3-media::before{transition:none!important}
  body.e8-cards .scard:hover .scard__media img,body.e8-cards .pcard:hover .pcard__media img{transform:none!important}
}
