/* =====================================================================
   PlayX Shop — Design System v2 (premium polish pass)
   Refined from the approved mockup using researched dark-UI technique:
   · tonal elevation (layered surfaces) instead of heavy shadows  (Material 3)
   · off-white text, never pure #fff on near-black  (WCAG / halation)
   · neon as restrained accent + glow ONLY on focal elements
   · fluid type scale (clamp, ~1.25 ratio) + 8px spacing system
   · motion tokens 140/200/320ms, gentle easing, reduced-motion aware
   All tokens are CSS custom properties so the admin editor can expose a subset.
   ===================================================================== */

/* ------------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------------ */
:root {
  /* --- Dark scale: layered tonal elevation, deep charcoal (not pure black) --- */
  --bg:          #0A0A0C;   /* base canvas */
  --surface-1:   #101015;   /* sunken sections */
  --surface:     #16161C;   /* default card */
  --surface-2:   #1C1C24;   /* raised / hover */
  --surface-3:   #23232C;   /* popovers / highest */
  --border:      rgba(255,255,255,0.08);   /* hairline */
  --border-2:    rgba(255,255,255,0.14);   /* hover hairline */
  --lit-edge:    inset 0 1px 0 rgba(255,255,255,0.05);  /* top highlight on cards */

  /* --- Text: off-white primary (≈14:1 on --bg), never pure white --- */
  --text:        #ECECF2;   /* primary body */
  --text-muted:  #ABABBA;   /* secondary (≈6.4:1) */
  --text-dim:    #71717F;   /* tertiary / meta (≈3.2:1, non-essential only) */

  /* --- Neon accents (brand identity; vivid for small accents, glow for focal) --- */
  --neon-blue:    #22DBFF;
  --neon-green:   #34E27A;
  --neon-magenta: #FF3DA6;
  --neon-purple:  #A86BFF;
  --neon-yellow:  #FFD64A;

  /* --- Primary CTA gradient (magenta → purple) --- */
  --grad-primary: linear-gradient(135deg, #FF3DA6 0%, #A86BFF 100%);
  --grad-logo:    linear-gradient(90deg,#FF3DA6 0%,#FFD64A 28%,#34E27A 52%,#22DBFF 76%,#A86BFF 100%);

  /* --- Glow tokens (layered, restrained — focal elements only) --- */
  --glow-magenta: 0 0 24px -6px rgba(255,61,166,0.55);
  --glow-purple:  0 0 26px -6px rgba(168,107,255,0.45);
  --glow-blue:    0 0 22px -6px rgba(34,219,255,0.45);
  --shadow-card:  0 1px 2px rgba(0,0,0,0.4), 0 12px 28px -14px rgba(0,0,0,0.7);

  /* --- Radii (single family) --- */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* --- Spacing scale (8px base, 4px half-steps) --- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --gap: var(--sp-4);
  --pad: var(--sp-5);

  /* --- Fluid type scale (clamp, ~1.25 modular; rem-based for a11y) --- */
  --fs-100: clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);   /* meta / eyebrow */
  --fs-200: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);  /* small */
  --fs-300: 0.9375rem;                                    /* UI label */
  --fs-400: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);     /* body 16–17 */
  --fs-500: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);   /* lead */
  --fs-600: clamp(1.35rem, 1.25rem + 0.5vw, 1.6rem);      /* h3 */
  --fs-700: clamp(1.7rem, 1.5rem + 1vw, 2.15rem);         /* h2 */
  --fs-800: clamp(2.1rem, 1.7rem + 1.9vw, 3rem);          /* section title */
  --fs-900: clamp(2.6rem, 1.9rem + 3.4vw, 4.6rem);        /* hero */

  /* --- Type families & weights --- */
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-body:    "DM Sans", system-ui, -apple-system, sans-serif;

  /* --- Motion tokens (gentle, purposeful) --- */
  --t-fast: 140ms;
  --t:      200ms;
  --t-slow: 320ms;
  --ease:     cubic-bezier(.4, 0, .2, 1);     /* standard */
  --ease-out: cubic-bezier(.2, .7, .2, 1);    /* decelerate (hover lifts) */

  /* --- Layout --- */
  --maxw: 1200px;
}

/* ------------------------------------------------------------------
   2. RESET / BASE
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);   /* flat deep charcoal — depth comes from surfaces, not washes */
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-400);
  line-height: 1.62;       /* slightly looser for dark-mode comfort */
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  margin: 0;
}

/* Accessible focus state (visible neon ring) */
:focus-visible {
  outline: 2px solid var(--neon-blue);
  outline-offset: 2px;
  border-radius: 6px;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Utility: neon glow text — focal DISPLAY words only (never body; halation risk).
   Layered: a tight bright halo for legibility + a soft wide bloom for the neon feel. */
.glow-blue    { color: var(--neon-blue);    text-shadow: 0 0 1px rgba(34,219,255,0.6),  0 0 16px rgba(34,219,255,0.40); }
.glow-magenta { color: var(--neon-magenta); text-shadow: 0 0 1px rgba(255,61,166,0.6),  0 0 16px rgba(255,61,166,0.40); }
.glow-green   { color: var(--neon-green);   text-shadow: 0 0 1px rgba(52,226,122,0.6),  0 0 16px rgba(52,226,122,0.38); }
.glow-yellow  { color: var(--neon-yellow);  text-shadow: 0 0 1px rgba(255,214,74,0.6),  0 0 14px rgba(255,214,74,0.36); }

/* Visually-hidden (for accessible labels) */
.sr-only {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* ------------------------------------------------------------------
   3. NEON ICON HELPERS  (inline SVGs inherit currentColor + glow)
   ------------------------------------------------------------------ */
.icon { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }

/* Neon colour helpers — FLAT colour, no glow (matches the reference icons). */
.i-yellow  { color: var(--neon-yellow);  }
.i-magenta { color: var(--neon-magenta); }
.i-green   { color: var(--neon-green);   }
.i-blue    { color: var(--neon-blue);    }
.i-purple  { color: var(--neon-purple);  }

/* ==================================================================
   4. TOP NAV  (desktop) — collapses for mobile
   ================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11,11,18,0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
/* 3-column grid: logo (left) · nav (centre) · actions (right) */
.topbar__inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 18px; height: 68px;
}
.topbar__inner .logo { grid-column: 1; justify-self: start; }
.header-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 4px; }

/* Hamburger (mobile menu trigger) */
.hamburger {
  background: none; border: 0; color: var(--text);
  display: none; padding: 6px; border-radius: 8px;
}
.hamburger:hover { background: var(--surface-2); }

/* Logo wordmark: rainbow PLAYX + script Shop! */
.logo { display: inline-flex; align-items: baseline; gap: 6px; font-family: var(--font-display); }
.logo__playx {
  font-weight:700; font-size: 26px; letter-spacing: .5px;
  background: var(--grad-logo);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(166,75,255,0.35));
}
.logo__shop {
  font-weight: 700; font-style: italic; font-size: 20px; color: var(--text);
}
.logo__shop::after { content:"!"; color: var(--neon-magenta); }

/* Search pill */
.search {
  flex: 1; max-width: 520px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 10px 16px;
  transition: border-color var(--t), box-shadow var(--t);
}
.search:focus-within {
  border-color: var(--neon-magenta);
  box-shadow: 0 0 0 3px rgba(255,45,160,0.15);
}
.search input {
  flex: 1; background: none; border: 0; color: var(--text);
  font-family: inherit; font-size: 15px; outline: none;
}
.search input::placeholder { color: var(--text-dim); }
.search__btn { background:none;border:0;color:var(--neon-magenta);display:flex; }

/* mobile-only search toggle button (injected by app.js); hidden on desktop */
.search-toggle { display: none; }

/* Desktop nav links — centred in the header */
.nav-links { display: flex; gap: 22px; grid-column: 2; justify-self: center; }
.nav-links a {
  color: var(--text-muted); font-weight: 500; font-size: 15px;
  padding: 6px 2px; position: relative; transition: color var(--t);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after {
  content:""; position:absolute; left:0; right:0; bottom:-4px; height:2px;
  background: var(--grad-primary); border-radius: 2px;
}

/* Cart button + neon badge */
.iconbtn {
  position: relative; background: none; border: 0; color: var(--text);
  padding: 8px; border-radius: 10px; transition: background var(--t);
}
.iconbtn:hover { background: var(--surface-2); }
.badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--grad-primary); color: #fff;
  font-size: 11px; font-weight: 700; font-family: var(--font-display);
  border-radius: var(--r-pill);
  display: grid; place-items: center;
  box-shadow: 0 0 10px rgba(255,45,160,0.6);
}

/* ==================================================================
   5. MOBILE SLIDE-OVER MENU (reuses category list styling)
   ================================================================== */
.drawer {
  position: fixed; inset: 0; z-index: 60;
  visibility: hidden; opacity: 0; transition: opacity var(--t), visibility var(--t);
}
.drawer.open { visibility: visible; opacity: 1; }
.drawer__scrim { position:absolute; inset:0; background: rgba(0,0,0,0.6); }
.drawer__panel {
  position: absolute; inset: 0;
  background: var(--bg); padding: 18px 18px 90px;
  overflow-y: auto;
}
.drawer__head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 14px; }
.drawer__close { background:none;border:0;color:var(--text);padding:8px;border-radius:8px; }
.drawer__close:hover { background: var(--surface-2); }

/* ==================================================================
   6. HERO  (Home)
   ================================================================== */
.hero { padding: 40px 0 18px; }
.hero__grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center;
}
.hero__eyebrow {
  display:inline-flex; align-items:center; gap:8px;
  font-size: var(--fs-100); font-weight:600; letter-spacing:.14em; text-transform:uppercase;
  color: var(--neon-blue); margin-bottom: var(--sp-4);
}
.hero h1 {
  font-size: var(--fs-900); font-weight:700; letter-spacing: -0.03em; line-height: 1.04;
}
.hero h1 em { font-style: italic; }
.hero p {
  color: var(--text-muted); font-size: var(--fs-500); max-width: 44ch; margin: var(--sp-5) 0 var(--sp-6);
}
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* Hero image — fixed aspect box so each carousel slide fills the same frame.
   Images cross-fade when the slide changes (see app.js).                    */
.hero__art {
  position: relative; border-radius: var(--r-lg);
  border: 1px solid var(--border); overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, #16101f, #0b0b12);
}
.hero__art img {
  position:absolute; inset:0; width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: opacity 320ms ease;
}
.hero__art.is-fading img { opacity: 0; }
/* subtle neon vignette over the photo so it ties into the dark theme */
.hero__art::after {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(120% 90% at 80% 10%, transparent 55%, rgba(11,11,18,0.55) 100%),
    linear-gradient(180deg, transparent 60%, rgba(11,11,18,0.45) 100%);
}

/* Buttons -------------------------------------------------------- */
.btn {
  display:inline-flex; align-items:center; gap:10px;
  font-family: var(--font-display); font-weight:600; font-size: var(--fs-300);
  padding: 14px 26px; border-radius: var(--r-pill); border:1px solid transparent;
  transition: transform var(--t) var(--ease-out), box-shadow var(--t), filter var(--t);
  will-change: transform;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--grad-primary); color:#fff; border:0;
  box-shadow: var(--glow-magenta);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px -4px rgba(255,61,166,0.65); filter: saturate(1.08); }
.btn--ghost {
  background: rgba(255,255,255,0.02); color: var(--text);
  border:1px solid var(--border-2); backdrop-filter: blur(4px);
}
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--neon-blue); box-shadow: var(--glow-blue); }

/* Carousel dots */
.dots { display:flex; gap:9px; margin-top: 26px; }
.dots button {
  width:9px; height:9px; border-radius:50%; border:0; padding:0;
  background: var(--surface-2); transition: all var(--t);
}
.dots button[aria-selected="true"] {
  width: 28px; border-radius: 6px; background: var(--grad-primary);
  box-shadow: 0 0 12px -2px rgba(255,61,166,0.6);
}

/* ==================================================================
   7. SECTION HEADER (title + "View all")
   ================================================================== */
.section { padding: var(--sp-7) 0; }
.section__head { display:flex; align-items:baseline; justify-content:space-between; margin-bottom: var(--sp-5); }
.section__head h2 { font-size: var(--fs-800); letter-spacing: -0.02em; }
.viewall { color: var(--neon-blue); font-weight:600; font-size:14px; transition: text-shadow var(--t); }
.viewall:hover { text-shadow: 0 0 12px rgba(31,224,255,0.6); }

/* ==================================================================
   8. CATEGORY TILE GRID  (Home — "Shop by Category")
   ================================================================== */
.cat-grid {
  display:grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap);
}
.cat-tile {
  position: relative;
  background: var(--surface); border:1px solid var(--border);
  border-radius: var(--r-lg); padding: 26px 16px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:14px; text-align:center;
  box-shadow: var(--lit-edge);   /* subtle top highlight = premium raised feel */
  transition: transform var(--t) var(--ease-out), border-color var(--t), box-shadow var(--t), background var(--t);
}
.cat-tile:hover {
  transform: translateY(-4px); background: var(--surface-2);
  border-color: var(--border-2);
  box-shadow: var(--lit-edge), var(--shadow-card);
}
/* the icon picks up a soft colour-matched glow only on hover (focal interaction) */
.cat-tile:hover .icon { filter: drop-shadow(0 0 9px currentColor); }
/* big, flat, centered category icons (like the reference) */
.cat-tile .icon { width: 44px; height: 44px; transition: filter var(--t), transform var(--t) var(--ease-out); }
.cat-tile:hover .icon { transform: translateY(-1px); }
.cat-tile > span:not(.link-flag) {
  font-family: var(--font-display); font-weight:600; font-size: var(--fs-300);
  line-height:1.25; min-height: 2.5em;            /* reserve 2 lines so tiles align */
  display:flex; align-items:center; justify-content:center;
}
/* link-tile flag (categories that navigate out instead of listing products) */
.cat-tile .link-flag {
  font-family: var(--font-body); font-weight:600; font-size:10px; letter-spacing:.5px;
  text-transform:uppercase; color: var(--neon-blue);
  border:1px solid rgba(31,224,255,0.4); border-radius: var(--r-pill);
  padding: 2px 8px; margin-top:-2px;
}

/* ==================================================================
   9. CATEGORIES LIST  (Categories page + mobile drawer)
   ================================================================== */
.page-title { font-size: var(--fs-800); letter-spacing: -0.02em; margin: var(--sp-6) 0 var(--sp-5); }

.cat-list { display:flex; flex-direction:column; gap:12px; max-width: 760px; margin: 0 auto; }
.cat-row {
  display:flex; align-items:center; gap:16px;
  background: var(--surface); border:1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 18px;
  box-shadow: var(--lit-edge);
  transition: transform var(--t) var(--ease-out), border-color var(--t), background var(--t), box-shadow var(--t);
}
.cat-row:hover {
  transform: translateX(3px);
  background: var(--surface-2); border-color: var(--border-2);
  box-shadow: var(--lit-edge), var(--shadow-card);
}
/* icon sits in a rounded chip → more premium, more structured */
.cat-row .icon {
  width: 48px; height: 48px; padding: 11px; border-radius: var(--r-md);
  background: rgba(255,255,255,0.035); border: 1px solid var(--border);
  transition: border-color var(--t), box-shadow var(--t);
}
.cat-row:hover .icon { border-color: currentColor; box-shadow: 0 0 14px -2px currentColor; }
.cat-row__label { font-family: var(--font-display); font-weight:600; font-size: var(--fs-500); flex:1; color: var(--text); }
.cat-row__chev { color: var(--text-dim); transition: transform var(--t) var(--ease-out), color var(--t); }
.cat-row:hover .cat-row__chev { color: var(--text-muted); transform: translateX(3px); }
.cat-row .link-flag { /* external/internal nav badge */
  font-size:10px; font-weight:600; letter-spacing:.5px; text-transform:uppercase;
  color: var(--neon-blue); border:1px solid rgba(31,224,255,0.4);
  border-radius: var(--r-pill); padding: 2px 8px;
}
.cat-list__divider { height:1px; background: var(--border); margin: 10px 0; }
.cat-list__subhead { color: var(--text-dim); font-size:13px; font-weight:600; letter-spacing:.6px; text-transform:uppercase; margin: 4px 4px 2px; }

/* ==================================================================
   10. CATEGORY DETAIL  (banner + sub-pills + product cards)
   ================================================================== */
.detail-back {
  display:inline-flex; align-items:center; gap:8px; color: var(--text-muted);
  font-weight:600; font-size:14px; margin: 22px 0 16px; transition: color var(--t);
}
.detail-back:hover { color: var(--text); }

/* Banner — SVG illustration */
.banner {
  position:relative; border-radius: var(--r-lg); overflow:hidden;
  aspect-ratio: 16/6; min-height: 200px; border:1px solid var(--border);
}
.banner img { width:100%; height:100%; object-fit: cover; display:block; }

.detail-head { margin: 22px 0 6px; }
.detail-head h1 { font-size: clamp(28px,4vw,44px); }
.detail-head p { color: var(--text-muted); font-size:17px; margin-top:8px; max-width: 560px; }

/* Sub-category pills row */
.pills { display:flex; gap:14px; flex-wrap:wrap; margin: 24px 0 8px; }
.pill {
  display:flex; flex-direction:column; align-items:center; gap:8px;
  min-width: 84px; padding: 14px 10px;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--r-md);
  font-family: var(--font-display); font-weight:600; font-size:12px; text-align:center;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.pill:hover { transform: translateY(-2px); border-color: var(--neon-magenta); box-shadow:0 0 16px rgba(255,45,160,0.25); }
.pill .icon { width: 30px; height: 30px; color: var(--neon-magenta); }

/* ==================================================================
   11. PRODUCT CARDS
   ================================================================== */
.products {
  display:grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: var(--gap);
}
.card {
  background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg);
  overflow:hidden; box-shadow: var(--lit-edge);
  transition: transform var(--t) var(--ease-out), border-color var(--t), box-shadow var(--t);
  display:flex; flex-direction:column;
}
.card:hover {
  transform: translateY(-6px); border-color: var(--border-2);
  box-shadow: var(--lit-edge), var(--shadow-card), var(--glow-purple);
}
.card__media {
  aspect-ratio: 1/1;
  background: linear-gradient(160deg,#1b1b22,#0f0f14);
  display:grid; place-items:center; position:relative; overflow:hidden;
  border-bottom:1px solid var(--border);
}
/* GPU-friendly image zoom on hover (transform/opacity only → 60fps, no reflow) */
.card__media img { width:100%; height:100%; object-fit: cover; display:block;
  transition: transform var(--t-slow) var(--ease-out); will-change: transform; }
.card:hover .card__media img { transform: scale(1.06); }
/* wishlist heart, top-right of the media */
.card__wish {
  position:absolute; top:10px; right:10px; z-index:2;
  width:34px; height:34px; border-radius:50%; border:1px solid var(--border-2);
  background: rgba(11,11,18,0.6); backdrop-filter: blur(4px);
  color: var(--text-muted); display:grid; place-items:center;
  transition: color var(--t), border-color var(--t), transform var(--t);
}
.card__wish:hover { transform: scale(1.1); border-color: var(--neon-magenta); }
.card__wish[aria-pressed="true"] {
  color: var(--neon-magenta); border-color: var(--neon-magenta);
  filter: drop-shadow(0 0 8px rgba(255,45,160,0.7));
}
.card__wish[aria-pressed="true"] svg { fill: currentColor; }
.card__tag {
  position:absolute; top:10px; left:10px; font-size:11px; font-weight:700;
  font-family: var(--font-display); padding:3px 9px; border-radius: var(--r-pill);
  background: rgba(11,11,18,0.7); color: var(--neon-yellow); border:1px solid rgba(255,210,63,0.4);
}
.card__body { padding: 16px; display:flex; flex-direction:column; gap:8px; flex:1; }
/* clamp names to 2 lines so ratings + prices line up across the row */
.card__name { font-family: var(--font-display); font-weight:600; font-size: var(--fs-300);
  line-height:1.35; min-height: 2.7em; color: var(--text);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card__rating { display:flex; align-items:center; gap:6px; font-size: var(--fs-200); color: var(--text-muted); }
.stars { color: var(--neon-yellow); letter-spacing:1px; font-size: var(--fs-200); }
.card__foot { margin-top:auto; display:flex; align-items:center; justify-content:space-between; padding-top: 4px; }
.card__price { font-family: var(--font-display); font-weight:700; font-size: var(--fs-500); }
.card__add {
  width:40px; height:40px; border-radius:50%; border:0;
  background: var(--grad-primary); color:#fff;
  display:grid; place-items:center;
  box-shadow: var(--glow-magenta);
  transition: transform var(--t) var(--ease-out), box-shadow var(--t);
}
.card__add:hover { transform: scale(1.1); box-shadow: 0 0 22px -2px rgba(255,61,166,0.75); }

/* Clickable card (stretched-link pattern): the TITLE is the link, its ::after
   stretches over the whole card. Wishlist + add buttons stay above (z-index 2).
   Focus shows on the whole card via :focus-within. (Accessible, no nested links.) */
.card.is-linked { position: relative; }
.card__title-link { color: inherit; text-decoration: none; }
.card__title-link::after { content:""; position:absolute; inset:0; z-index:1; border-radius: inherit; }
.card.is-linked .card__wish, .card.is-linked .card__add { position: relative; z-index: 2; }
.card.is-linked:focus-within {
  border-color: var(--border-2);
  box-shadow: var(--lit-edge), var(--shadow-card), var(--glow-purple);
  outline: 2px solid var(--neon-blue); outline-offset: 2px;
}
.card__title-link:focus { outline: none; }   /* ring is shown on the card instead */
.card.is-linked:hover .card__name { color: #fff; }

/* Empty state (Gifts — coming soon) */
.empty {
  text-align:center; padding: 60px 20px; border:1px dashed var(--border-2);
  border-radius: var(--r-lg); background: var(--surface);
}
.empty .icon { width:48px; height:48px; margin:0 auto 14px; color: var(--neon-purple);
  filter: drop-shadow(0 0 10px rgba(166,75,255,0.5)); }
.empty h3 { font-size:22px; margin-bottom:8px; }
.empty p { color: var(--text-muted); max-width:420px; margin: 0 auto; }

/* Account / sign-in card */
.auth-card {
  max-width: 440px; margin: 0 auto; background: var(--surface);
  border:1px solid var(--border); border-radius: var(--r-lg); padding: 28px;
}
.auth-card h2 { font-size: 24px; }
.auth-sub { color: var(--text-muted); margin: 8px 0 22px; }
.auth-form { display:flex; flex-direction:column; gap:16px; }
.auth-form label { display:flex; flex-direction:column; gap:7px; font-size:14px; font-weight:600; color: var(--text-muted); }
.auth-form input {
  background: var(--bg); border:1px solid var(--border-2); border-radius: var(--r-sm);
  padding: 12px 14px; color: var(--text); font-family: inherit; font-size:15px;
  transition: border-color var(--t), box-shadow var(--t);
}
.auth-form input:focus { outline:none; border-color: var(--neon-magenta); box-shadow: 0 0 0 3px rgba(255,45,160,0.15); }
.auth-msg { color: var(--neon-green); font-size:14px; font-weight:600; }
.auth-alt { text-align:center; color: var(--text-muted); margin-top:18px; font-size:14px; }
.auth-alt a { color: var(--neon-blue); font-weight:600; }

/* ==================================================================
   12. FOOTER (desktop)
   ================================================================== */
.footer {
  border-top:1px solid var(--border); margin-top: 50px; padding: 40px 0 30px;
  color: var(--text-muted); font-size:14px;
}
.footer__grid { display:grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.footer h4 { font-size:14px; color: var(--text); margin-bottom:12px; letter-spacing:.4px; }
.footer a { color: var(--text-muted); transition: color var(--t); }
.footer a:hover { color: var(--neon-blue); }
.footer__brand p { max-width: 280px; margin-top:10px; }
.footer__bottom { margin-top: 30px; padding-top: 18px; border-top:1px solid var(--border);
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; font-size:13px; color: var(--text-dim); }

/* ==================================================================
   13. MOBILE BOTTOM TAB BAR  (shown on phones only)
   ================================================================== */
.tabbar { display:none; }
@media (max-width: 760px) {
  .tabbar {
    position: fixed; left:0; right:0; bottom:0; z-index: 50;
    display:flex; justify-content:space-around;
    background: rgba(11,11,18,0.94); backdrop-filter: blur(12px);
    border-top:1px solid var(--border); padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    position:relative; display:flex; flex-direction:column; align-items:center; gap:3px;
    font-size:11px; color: var(--text-dim); padding: 4px 8px; transition: color var(--t);
  }
  .tabbar a .icon { width:24px; height:24px; }
  .tabbar a[aria-current="page"] { color: var(--neon-magenta); }
  .tabbar a[aria-current="page"] .icon { filter: drop-shadow(0 0 8px rgba(255,61,166,0.7)); }
  /* small corner badge sitting on the cart icon's top-right (not covering it) */
  .tabbar .badge {
    top: 0; left: 50%; right: auto; transform: translateX(5px);
    min-width: 16px; height: 16px; padding: 0 4px;
    font-size: 10px; line-height: 16px; border: 1.5px solid var(--bg);
  }
  body { padding-bottom: 76px; } /* clear the fixed bar */

  /* phone header shows ONLY the search icon — cart lives in the bottom tab bar */
  .header-actions .iconbtn[aria-label^="Cart"] { display: none; }
}

/* ==================================================================
   14. RESPONSIVE BREAKPOINTS
   ================================================================== */

/* Tablet */
@media (max-width: 980px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .hero__grid { grid-template-columns: 1fr; gap: 28px; }
  .hero__art { max-width: 460px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

/* Mobile — match the phone reference */
@media (max-width: 760px) {
  /* phone header = logo + search icon + cart (nav lives in the bottom tab bar) */
  .nav-links { display: none; }
  .topbar__inner { height: 60px; }

  .hero { padding: 24px 0 6px; }
  .hero h1 { font-size: clamp(36px,9vw,52px); }
  .hero__cta .btn { flex:1; justify-content:center; }

  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .cat-tile { padding: 16px 8px; }

  /* product cards scroll horizontally like the reference's Best Sellers row */
  .products--scroll {
    display:flex; overflow-x:auto; gap:14px; padding-bottom:6px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  }
  .products--scroll .card { flex: 0 0 64%; scroll-snap-align: start; }

  .pills { gap:10px; overflow-x:auto; flex-wrap:nowrap; padding-bottom:4px; }

  .footer { display:none; } /* mobile uses the tab bar instead */
}

@media (max-width: 380px) {
  .cat-grid { gap: 10px; }
  .cat-tile span { font-size: 12.5px; }
}

/* ==================================================================
   15. CART DRAWER (slide-in from right) — fully working
   ================================================================== */
.cart {
  position: fixed; inset: 0; z-index: 70;
  visibility: hidden; opacity: 0; transition: opacity var(--t), visibility var(--t);
}
.cart.open { visibility: visible; opacity: 1; }
.cart__scrim { position:absolute; inset:0; background: rgba(0,0,0,0.6); }
.cart__panel {
  position:absolute; top:0; right:0; bottom:0; width: min(420px, 92vw);
  background: var(--bg); border-left:1px solid var(--border-2);
  display:flex; flex-direction:column;
  transform: translateX(100%); transition: transform var(--t);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}
.cart.open .cart__panel { transform: translateX(0); }
.cart__head { display:flex; align-items:center; justify-content:space-between;
  padding: 18px 20px; border-bottom:1px solid var(--border); }
.cart__head h2 { font-size: 20px; }
.cart__close { background:none;border:0;color:var(--text);padding:8px;border-radius:8px; }
.cart__close:hover { background: var(--surface-2); }
.cart__items { flex:1; overflow-y:auto; padding: 12px 16px; display:flex; flex-direction:column; gap:12px; }
.cart__empty { text-align:center; color: var(--text-muted); padding: 50px 20px; }
.cart-item { display:flex; gap:12px; align-items:center;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--r-md); padding:10px; }
.cart-item__img { width:56px; height:56px; border-radius:10px; overflow:hidden; flex:none; background:#101019; }
.cart-item__img img { width:100%; height:100%; object-fit:cover; }
.cart-item__info { flex:1; min-width:0; }
.cart-item__name { font-family: var(--font-display); font-weight:600; font-size:14px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cart-item__price { color: var(--neon-blue); font-weight:600; font-size:13px; }
.qty { display:flex; align-items:center; gap:10px; margin-top:6px; }
.qty button { width:24px; height:24px; border-radius:7px; border:1px solid var(--border-2);
  background: var(--surface-2); color: var(--text); display:grid; place-items:center; font-size:15px; line-height:1; }
.qty button:hover { border-color: var(--neon-magenta); }
.qty span { font-weight:600; min-width:18px; text-align:center; }
.cart-item__remove { background:none;border:0;color:var(--text-dim);padding:6px;border-radius:7px; }
.cart-item__remove:hover { color: var(--neon-magenta); background: var(--surface-2); }
.cart__foot { border-top:1px solid var(--border); padding: 16px 20px; }
.cart__total { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:14px; }
.cart__total span:first-child { color: var(--text-muted); }
.cart__total strong { font-family: var(--font-display); font-size:24px; }
.cart__foot .btn { width:100%; justify-content:center; }

/* ==================================================================
   15b. SEARCH POPUP (opened by the header search icon)
   ================================================================== */
.search-modal { position: fixed; inset: 0; z-index: 80; visibility: hidden; opacity: 0;
  transition: opacity var(--t), visibility var(--t); }
.search-modal.open { visibility: visible; opacity: 1; }
.search-modal__scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.62); backdrop-filter: blur(2px); }
.search-modal__panel {
  position: relative; max-width: 620px; margin: 11vh auto 0; padding: 14px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  transform: translateY(-12px); transition: transform var(--t);
}
.search-modal.open .search-modal__panel { transform: none; }
.search-modal__bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 12px 16px;
  transition: border-color var(--t), box-shadow var(--t);
}
.search-modal__bar:focus-within { border-color: var(--neon-magenta); box-shadow: 0 0 0 3px rgba(255,45,160,0.15); }
.search-modal__bar > .icon { color: var(--neon-magenta); }
.search-modal__bar input { flex: 1; background: none; border: 0; color: var(--text); font-family: inherit; font-size: 16px; outline: none; }
.search-modal__bar input::placeholder { color: var(--text-dim); }
.search-modal__close { background: none; border: 0; color: var(--text-dim); padding: 4px; border-radius: 8px; }
.search-modal__close:hover { color: var(--text); background: var(--surface-2); }
.search-modal__results { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.search-modal__hint { color: var(--text-dim); font-size: 13px; padding: 6px 4px 2px; }
.s-result {
  display: flex; align-items: center; gap: 12px; padding: 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--t);
}
.s-result:hover { border-color: var(--border-2); }
.s-result img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex: none; background:#101019; }
.s-result__info { flex: 1; min-width: 0; }
.s-result__name { font-family: var(--font-display); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-result__price { color: var(--neon-blue); font-weight: 600; font-size: 13px; }
.s-result .card__add { width: 34px; height: 34px; }
.s-empty { color: var(--text-muted); text-align: center; padding: 26px 10px; }
@media (max-width: 600px){ .search-modal__panel { margin: 6vh 12px 0; } }

/* ==================================================================
   16. TOAST (add-to-cart confirmation)
   ================================================================== */
.toast-wrap { position: fixed; left:50%; bottom: 26px; transform: translateX(-50%);
  z-index: 90; display:flex; flex-direction:column; gap:10px; align-items:center; pointer-events:none; }
.toast {
  background: var(--surface-2); border:1px solid var(--neon-magenta);
  color: var(--text); padding: 12px 18px; border-radius: var(--r-pill);
  font-weight:600; font-size:14px; display:flex; align-items:center; gap:10px;
  box-shadow: 0 0 22px rgba(255,45,160,0.35);
  animation: toastIn .25s ease, toastOut .3s ease 2.2s forwards;
}
.toast .icon { color: var(--neon-green); width:18px; height:18px; }
@keyframes toastIn  { from { opacity:0; transform: translateY(14px);} to { opacity:1; transform:none;} }
@keyframes toastOut { to { opacity:0; transform: translateY(14px);} }
@media (max-width:760px){ .toast-wrap{ bottom: 88px; } }

/* ==================================================================
   17. SINGLE PRODUCT (new polished screen — gallery + sticky buy box)
   ================================================================== */
.product { padding: var(--sp-6) 0 var(--sp-8); }
.product__grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--sp-8); align-items: start;
}

/* gallery */
.gallery { display: grid; grid-template-columns: 72px 1fr; gap: var(--sp-4); }
.gallery__thumbs { display: flex; flex-direction: column; gap: var(--sp-3); }
.gallery__thumb {
  width: 72px; height: 72px; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface); padding: 0; cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t);
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb[aria-current="true"] { border-color: var(--neon-magenta); box-shadow: var(--glow-magenta); }
.gallery__main {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--border); background: linear-gradient(160deg,#1b1b22,#0f0f14);
  aspect-ratio: 1/1; box-shadow: var(--lit-edge);
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* buy box */
.buybox { position: sticky; top: 92px; display: flex; flex-direction: column; gap: var(--sp-4); }
.buybox__cat { font-size: var(--fs-100); letter-spacing: .14em; text-transform: uppercase; color: var(--neon-blue); font-weight: 600; }
.buybox h1 { font-size: var(--fs-800); letter-spacing: -0.02em; line-height: 1.08; }
.buybox__rating { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: var(--fs-200); }
.buybox__price { display: flex; align-items: baseline; gap: 12px; }
.buybox__price .now { font-family: var(--font-display); font-weight:700; font-size: var(--fs-800);
  background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.buybox__price .was { color: var(--text-dim); text-decoration: line-through; font-size: var(--fs-500); }
.buybox__desc { color: var(--text-muted); max-width: 52ch; }

/* variation selectors (e.g. table sizes) */
.variations { display: flex; flex-direction: column; gap: var(--sp-3); }
.variations__label { font-size: var(--fs-200); color: var(--text-muted); font-weight: 600; }
.swatches { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.swatch {
  padding: 10px 16px; border-radius: var(--r-pill); border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-200); cursor: pointer; transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.swatch:hover { border-color: var(--neon-blue); }
.swatch[aria-pressed="true"] { border-color: var(--neon-magenta); background: var(--surface-2); box-shadow: var(--glow-magenta); }

/* quantity + add row */
.buy-row { display: flex; gap: var(--sp-3); align-items: stretch; margin-top: var(--sp-2); }
.qtybox { display: flex; align-items: center; border: 1px solid var(--border-2); border-radius: var(--r-pill); overflow: hidden; }
.qtybox button { width: 44px; background: var(--surface); border: 0; color: var(--text); font-size: 18px; cursor: pointer; transition: background var(--t); }
.qtybox button:hover { background: var(--surface-2); color: var(--neon-magenta); }
.qtybox span { min-width: 40px; text-align: center; font-weight: 700; font-family: var(--font-display); }
.buy-row .btn--primary { flex: 1; justify-content: center; }

/* trust strip */
.trust { display: flex; gap: var(--sp-5); flex-wrap: wrap; padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.trust div { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: var(--fs-200); }
.trust .icon { width: 20px; height: 20px; color: var(--neon-green); }

@media (max-width: 900px) {
  .product__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .buybox { position: static; }
  .gallery { grid-template-columns: 60px 1fr; }
}
@media (max-width: 600px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery__thumbs { flex-direction: row; order: 2; }
  .gallery__thumb { width: 60px; height: 60px; }
}

/* ==================================================================
   18. ACCOUNT DASHBOARD (logged-in My Account view)
   ================================================================== */
.account { display: grid; grid-template-columns: 260px 1fr; gap: var(--sp-6); padding: var(--sp-6) 0 var(--sp-8); align-items: start; }

/* sidebar */
.acct-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: var(--sp-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--lit-edge); }
.acct-user { display: flex; align-items: center; gap: 12px; padding: var(--sp-2) var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border); }
.acct-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad-primary); color: #fff; font-family: var(--font-display); font-weight:700; font-size: 18px; box-shadow: var(--glow-magenta); }
.acct-user b { font-family: var(--font-display); font-size: var(--fs-300); display: block; }
.acct-user span { color: var(--text-dim); font-size: var(--fs-200); }
.acct-nav { display: flex; flex-direction: column; gap: 4px; }
.acct-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-md);
  color: var(--text-muted); font-weight: 600; font-size: var(--fs-300); transition: background var(--t), color var(--t); }
.acct-nav a .icon { width: 20px; height: 20px; }
.acct-nav a:hover { background: var(--surface-2); color: var(--text); }
.acct-nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--neon-magenta); }
.acct-nav a[aria-current="page"] .icon { color: var(--neon-magenta); }
.acct-nav .logout { color: var(--text-dim); margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0 0 var(--r-md) var(--r-md); padding-top: 14px; }

/* main panel */
.acct-main { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
.acct-welcome h1 { font-size: var(--fs-700); letter-spacing: -0.02em; }
.acct-welcome p { color: var(--text-muted); margin-top: 4px; }

/* stat bento */
.acct-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: var(--lit-edge); }
.stat .icon { width: 26px; height: 26px; margin-bottom: 10px; }
.stat b { font-family: var(--font-display); font-size: var(--fs-700); display: block; line-height: 1; }
.stat span { color: var(--text-muted); font-size: var(--fs-200); }

/* orders table */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--lit-edge); overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.panel__head h2 { font-size: var(--fs-600); }
.orders { width: 100%; border-collapse: collapse; }
.orders th, .orders td { text-align: left; padding: 14px var(--sp-5); font-size: var(--fs-200); }
.orders thead th { color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: var(--fs-100); }
.orders tbody tr { border-top: 1px solid var(--border); transition: background var(--t); }
.orders tbody tr:hover { background: var(--surface-2); }
.orders td b { font-family: var(--font-display); }
.orders .order-act { color: var(--neon-blue); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-100); font-weight: 700; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--done { color: var(--neon-green); background: rgba(52,226,122,0.12); }
.status--ship { color: var(--neon-blue); background: rgba(34,219,255,0.12); }
.status--proc { color: var(--neon-yellow); background: rgba(255,214,74,0.12); }

/* address cards */
.addr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); padding: var(--sp-5); }
.addr { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); background: var(--surface-1); }
.addr h3 { font-size: var(--fs-300); margin-bottom: 6px; }
.addr p { color: var(--text-muted); font-size: var(--fs-200); line-height: 1.7; }
.addr a { color: var(--neon-blue); font-size: var(--fs-200); font-weight: 600; display: inline-block; margin-top: 10px; }

@media (max-width: 880px) {
  .account { grid-template-columns: 1fr; }
  .acct-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .acct-user { width: 100%; border-bottom: 1px solid var(--border); }
  .acct-nav { flex-direction: row; flex-wrap: wrap; }
  .acct-nav .logout { border-top: 0; padding-top: 11px; }
  .acct-stats { grid-template-columns: 1fr; }
  .addr-grid { grid-template-columns: 1fr; }
  .orders th:nth-child(2), .orders td:nth-child(2) { display: none; } /* hide date on mobile */
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
