/* ===== Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Nunito:wght@400;500;600;700;800;900&display=swap');

/* ===== Variables ===== */
:root {
  --bg: #070712;
  --surface: #0d0d20;
  --surface-2: #121228;
  --border: #1c1c36;
  --border-bright: #2a2a48;
  --accent: #7c6af5;
  --accent-dim: rgba(124, 106, 245, 0.12);
  --accent-2: #06d6f5;
  --text: #dde0f0;
  --muted: #6878a0;
  --dim: #2a2a48;
  --price: #3dffa0;
  --price-shadow: 0 0 12px rgba(61, 255, 160, 0.5);
  --radius: 10px;
  --radius-lg: 14px;
  --foil: linear-gradient(100deg, #ffd76a 0%, #ff9de2 30%, #a78bff 55%, #06d6f5 80%, #ffd76a 100%);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 40% at 50% -8%, rgba(124, 106, 245, 0.09), transparent 65%),
    radial-gradient(rgba(124, 106, 245, 0.045) 1px, transparent 1px);
  background-size: 100% 900px, 28px 28px;
  background-repeat: no-repeat, repeat;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

#bg-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #a89fff; }
img { max-width: 100%; display: block; }

/* ===== Layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 3rem 0; }
.section--tint {
  background: linear-gradient(180deg, rgba(124, 106, 245, 0.045), rgba(124, 106, 245, 0.008) 70%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ===== Nav ===== */
nav {
  background: rgba(7, 7, 18, 0.72);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.5rem; max-width: 1200px; margin: 0 auto; gap: 1rem; }
.nav-brand { display: flex; align-items: center; gap: .55rem; transition: opacity .2s; }
.nav-brand:hover { opacity: 0.85; }
.nav-logo { height: 38px; width: auto; flex-shrink: 0; }
.nav-brand-text { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 1.5px; color: var(--text); line-height: 1; transform: translateY(2px); }
.nav-brand-badge { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(124,106,245,.25); padding: .15rem .45rem; border-radius: 4px; line-height: 1; align-self: center; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a { color: var(--muted); font-size: .9rem; font-weight: 600; transition: color .15s; letter-spacing: .02em; }
.nav-links a:hover { color: var(--text); }
.cart-btn {
  background: var(--accent) !important;
  color: #fff !important;
  padding: .4rem 1rem;
  border-radius: 6px;
  font-weight: 700 !important;
  box-shadow: 0 0 14px rgba(124, 106, 245, 0.35);
  transition: box-shadow .2s, background .2s !important;
}
.cart-btn:hover {
  background: #6858d4 !important;
  box-shadow: 0 0 24px rgba(124, 106, 245, 0.6) !important;
  color: #fff !important;
}
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border-bright);
  color: var(--muted);
  cursor: pointer;
  padding: .38rem .5rem;
  border-radius: 7px;
  line-height: 0;
  flex-shrink: 0;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
}
.nav-hamburger:hover,
.nav-hamburger[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px rgba(124,106,245,.2); }
.nav-hamburger[aria-expanded="true"] { background: var(--accent-dim); }

/* Mobile slide-down menus — user nav + admin nav */
.mobile-menu,
.admin-mobile-menu {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  z-index: 99;
  flex-direction: column;
  background: var(--surface);
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--border-bright);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(124,106,245,.07);
  overflow-y: auto;
}
.mobile-menu { top: 60px; max-height: calc(100vh - 60px); }
.admin-mobile-menu { top: 57px; max-height: calc(100vh - 57px); }
.mobile-menu--open,
.admin-mobile-menu--open { display: flex; }

.mobile-menu a,
.admin-mobile-menu a {
  padding: .85rem 1.25rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  transition: color .15s, background .15s, border-left-color .15s;
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: .02em;
}
.mobile-menu a:last-child,
.admin-mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover,
.admin-mobile-menu a:hover { color: var(--text); background: rgba(124,106,245,.07); border-left-color: var(--accent); }

.admin-mobile-menu .admin-mobile-section {
  padding: .5rem 1.25rem .3rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.admin-mobile-menu a.active { background: var(--accent); color: #fff; border-left-color: var(--accent); box-shadow: inset 0 0 20px rgba(124,106,245,.2); }

.nav-search { flex: 1; max-width: 360px; }
.nav-search form { display: flex; }
.nav-search input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .45rem .9rem;
  border-radius: 8px 0 0 8px;
  font-size: .88rem;
  outline: none;
  font-family: var(--font-body);
  transition: border-color .2s;
}
.nav-search input:focus { border-color: var(--accent); }
.nav-search button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: .45rem .9rem;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background .2s;
}
.nav-search button:hover { background: #6858d4; }

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 5.5rem 1.5rem 5rem;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 50%, rgba(124, 106, 245, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 15% 85%, rgba(6, 214, 245, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 85% 15%, rgba(124, 106, 245, 0.1) 0%, transparent 60%);
  z-index: 0;
  animation: hero-pulse 6s ease-in-out infinite;
}
@keyframes hero-pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}
.hero .container { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 1.1rem;
}
.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  width: 6px; height: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transform: rotate(45deg);
  border-radius: 1px;
  opacity: .8;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.5vw, 5.2rem);
  letter-spacing: 3px;
  line-height: 1;
  margin-bottom: .9rem;
  text-transform: uppercase;
}
.hero h1 span {
  background: var(--foil);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil-shimmer 7s ease-in-out infinite;
  filter: drop-shadow(0 0 22px rgba(124, 106, 245, 0.45));
}
.hero p {
  color: var(--muted);
  font-size: 1.12rem;
  margin: 0 auto 2.1rem;
  font-weight: 500;
  max-width: 34rem;
  line-height: 1.6;
}
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* Fanned card backs flanking the hero (slide 0 signature) */
.hero-fan {
  position: absolute;
  top: 50%;
  width: 240px;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
}
.hero-fan img {
  position: absolute;
  width: 118px;
  border-radius: 7px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .55), 0 0 0 1px rgba(124, 106, 245, .18);
}
.hero-fan--left { left: max(-30px, calc(50% - 640px)); transform: translateY(-58%) rotate(-4deg); }
.hero-fan--right { right: max(-30px, calc(50% - 640px)); transform: translateY(-58%) rotate(4deg); }
.hero-fan--left img:nth-child(1) { transform: rotate(-16deg) translate(0, 14px); }
.hero-fan--left img:nth-child(2) { transform: rotate(-4deg) translate(58px, 0); }
.hero-fan--left img:nth-child(3) { transform: rotate(9deg) translate(116px, 12px); }
.hero-fan--right img:nth-child(1) { transform: rotate(-9deg) translate(0, 12px); }
.hero-fan--right img:nth-child(2) { transform: rotate(4deg) translate(58px, 0); }
.hero-fan--right img:nth-child(3) { transform: rotate(16deg) translate(116px, 14px); }
@media (max-width: 1100px) { .hero-fan { display: none; } }

/* ===== Trust strip ===== */
.trust-strip {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 13, 32, .55), rgba(13, 13, 32, 0));
}
.trust-strip-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.trust-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.trust-item svg { flex-shrink: 0; color: var(--accent); }
.trust-item strong { color: var(--text); font-weight: 700; }
@media (max-width: 900px) {
  .trust-strip-inner { grid-template-columns: repeat(2, 1fr); padding: .9rem 1rem; gap: .7rem; }
  .trust-item { justify-content: flex-start; font-size: .8rem; }
}

/* ===== Hero Carousel ===== */
.hero-carousel-wrap { padding-bottom: 3.5rem; min-height: 420px; }
.hero-slide {
  display: none;
  position: relative;
  width: 100%;
  /* Every slide reserves the same box so the hero doesn't resize as the
     carousel cycles — content is centred within it rather than setting it. */
  min-height: var(--hero-slide-height, 340px);
}
.hero-slide.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: hero-fade-in .5s ease;
}
@keyframes hero-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .35;
}
.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(7,7,18,.2) 0%, rgba(7,7,18,.6) 100%);
}

/* Admin-authored slide: a bare canvas the custom CSS styles from scratch. */
.hero-custom {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100%;
}

/* Slow bloom behind a preset slide's headline. */
.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(760px, 92vw);
  height: 320px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 55% at 50% 50%, rgba(124, 106, 245, .22), transparent 70%),
    radial-gradient(ellipse 34% 40% at 50% 45%, rgba(6, 214, 245, .10), transparent 72%);
  animation: hero-breathe 9s ease-in-out infinite;
}
@keyframes hero-breathe {
  0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.06); }
}

/* Fact pills under the hero CTAs. */
.hero-pills {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 2.2rem 0 0;
  padding: 0;
}
.hero-pills li {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .42rem .95rem;
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  background: rgba(13, 13, 32, .6);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.hero-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .hero-pills { gap: .45rem; }
  .hero-pills li { font-size: .72rem; padding: .36rem .75rem; }
}

/* ===== Themed checkbox ===== */
.nb-check {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin: 0;
  border: 1px solid var(--border-bright);
  border-radius: 5px;
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.nb-check:hover { border-color: var(--accent); }
.nb-check:checked {
  background: linear-gradient(160deg, #8d7cff 0%, #6f5ce0 100%);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(124, 106, 245, .45);
}
.nb-check:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}
.nb-check:disabled { opacity: .4; cursor: not-allowed; }
.nb-check--danger:checked {
  background: linear-gradient(160deg, #e5484d 0%, #c13438 100%);
  border-color: #e5484d;
  box-shadow: 0 0 10px rgba(229, 72, 77, .4);
}

/* Full-art fronts carry more detail than a cardback, so soften them slightly. */
.hero-slide .hero-fan img[src*="card-image"],
.hero-slide .hero-fan img[src*="/uploads/"] {
  box-shadow: 0 16px 40px rgba(0, 0, 0, .62), 0 0 0 1px rgba(124, 106, 245, .22);
}

/* Hero nav arrows */
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  z-index: 10;
  transition: background .2s;
  margin-top: -1.75rem; /* half of dots area */
}
.hero-nav svg { display: block; }
.hero-nav:hover { background: rgba(124,106,245,.3); border-color: var(--accent); }
.hero-prev { left: 1rem; }
.hero-next { right: 1rem; }

/* Hero dots */
.hero-dots {
  position: absolute;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .5rem;
  z-index: 10;
}
.hero-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background .2s, transform .2s;
}
.hero-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* Hero card strip (latest set / card filter slides) */
.hero-set-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}
.hero-card-strip {
  display: flex;
  justify-content: center;
  gap: .5rem;
  flex-wrap: nowrap;
  margin: 1.2rem 0;
  overflow: hidden;
}
.hero-card-chip {
  flex-shrink: 0;
  width: 70px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  transition: transform .2s;
}
.hero-card-chip:hover { transform: translateY(-4px) scale(1.05); }
.hero-card-chip img {
  width: 100%;
  display: block;
}

/* ===== Buttons ===== */
.btn { display: inline-block; padding: .65rem 1.6rem; border-radius: 8px; font-weight: 700; font-size: .95rem; cursor: pointer; border: none; transition: all .2s; font-family: var(--font-body); letter-spacing: .02em; }
.btn-primary {
  background: linear-gradient(160deg, #8d7cff 0%, #6f5ce0 100%);
  color: #fff;
  box-shadow: 0 0 16px rgba(124, 106, 245, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover {
  background: linear-gradient(160deg, #9788ff 0%, #7a68ea 100%);
  color: #fff;
  box-shadow: 0 4px 26px rgba(124, 106, 245, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.btn-secondary { background: rgba(124, 106, 245, 0.06); color: #a89fff; border: 1px solid rgba(124, 106, 245, .45); }
.btn-secondary:hover { background: var(--accent-dim); color: #c0b8ff; border-color: var(--accent); transform: translateY(-1px); }
.btn-sm { padding: .3rem .75rem; font-size: .82rem; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; color: #fff; }
.btn-success { background: #1a9e50; color: #fff; }
.btn-success:hover { background: #168040; color: #fff; }

/* ===== Game tabs ===== */
.game-tabs { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.game-tab {
  padding: .4rem 1.1rem;
  border-radius: 20px;
  border: 1px solid var(--border-bright);
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  transition: all .2s;
  letter-spacing: .02em;
}
.game-tab:hover, .game-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 14px rgba(124, 106, 245, 0.4);
}

/* ===== Cards grid ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.2rem; }
.cards-grid--one-row { grid-template-rows: auto; grid-auto-rows: 0; row-gap: 0; overflow: hidden; padding: 30px 10px 0; margin: -30px -10px 0; }

.card-tile {
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 42%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.22,.68,0,1.2), border-color .2s, box-shadow .25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card-tile:hover {
  transform: translateY(-7px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 14px 40px rgba(124, 106, 245, 0.28), 0 0 0 1px rgba(124, 106, 245, 0.18);
}
.card-tile-img {
  width: 100%;
  aspect-ratio: 421/614;
  object-fit: contain;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(124, 106, 245, .07), transparent 70%),
    var(--surface-2);
  transition: filter .25s;
}
.card-tile:hover .card-tile-img { filter: saturate(1.1) brightness(1.06); }
.card-tile--unavailable { opacity: .7; }
.card-tile--unavailable:hover { transform: none; border-color: var(--border); box-shadow: none; cursor: default; }
.unavailable-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(10,15,30,.65);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.unavailable-overlay span {
  background: rgba(248,113,113,.15);
  border: 1px solid rgba(248,113,113,.5);
  color: #f87171;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .35rem .8rem;
  border-radius: 4px;
}
.quick-add-btn {
  /* Sits below the card image in the info area (not overlaying artwork). */
  width: 100%;
  margin-top: .65rem;
  background: rgba(124,106,245,.12);
  color: var(--accent);
  border: 1px solid rgba(124,106,245,.32);
  border-radius: 6px;
  padding: .48rem;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  transition: background .15s, color .15s, border-color .15s;
}
.quick-add-btn:hover { background: rgba(124,106,245,.92); color: #fff; border-color: transparent; }
.quick-add-btn--inline {
  /* Compact variant that sits inline with the price in the tile footer. */
  width: auto;
  margin-top: 0;
  padding: .34rem .65rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.quick-add-btn.added { background: rgba(44,190,100,.92); color: #fff; border-color: transparent; }
.quick-add-btn.error { background: rgba(248,113,113,.92); color: #fff; border-color: transparent; }
.card-tile-img-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 2.5rem;
}
.card-tile-body { padding: .85rem; flex: 1; display: flex; flex-direction: column; }
.card-tile-name { font-weight: 800; font-size: .92rem; margin-bottom: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.card-tile-meta { color: var(--muted); font-size: .78rem; margin-bottom: .5rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tile-code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .72rem; color: #9fb0d8; letter-spacing: .01em; }
.card-tile-footer { display: flex; flex-direction: column; gap: .35rem; }
.card-tile-footer-row { display: flex; align-items: center; justify-content: center; gap: .6rem; }
.card-tile-footer-badges { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .3rem; }
.card-tile-footer-rarity { display: flex; justify-content: center; }

/* ===== Rarity Bubbles ===== */
.rarity-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .25rem;
}
.rarity-bubble {
  display: inline-block;
  padding: .16rem .48rem;
  border-radius: 20px;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(124,106,245,.28);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.rarity-bubble:hover {
  background: rgba(124,106,245,.22);
  border-color: var(--accent);
  color: #c0b8ff;
}
.rarity-bubble--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: default;
}
.detail-rarity-selector {
  margin-bottom: 1.1rem;
}
.detail-rarity-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .45rem;
}

/* ===== Price ===== */
.price {
  color: var(--price);
  font-weight: 800;
  font-size: 1rem;
  text-shadow: var(--price-shadow);
}

/* ===== Badges ===== */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 4px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.badge-condition { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-bright); }
.badge-rarity { background: rgba(124, 106, 245, .12); color: #a49bf7; border: 1px solid rgba(124, 106, 245, .3); }
.badge-language { background: #2a2a4a; color: #9090b0; }
.badge-edition { background: rgba(6, 214, 245, .08); color: #70b0e0; border: 1px solid rgba(6, 214, 245, .2); }
.badge-stock-low { background: rgba(245, 164, 66, .1); color: #f5a442; border: 1px solid rgba(245, 164, 66, .25); }
.badge-stock-high { background: rgba(61, 255, 160, .08); color: #8af08a; border: 1px solid rgba(61, 255, 160, .2); }
.badge-oos { background: rgba(245, 66, 66, .1); color: #f58a8a; border: 1px solid rgba(245, 66, 66, .25); font-size: 1rem; padding: .5rem 1rem; }
.badge-mystery { background: rgba(6, 214, 245, .15); color: #06d6f5; border: 1px solid rgba(6, 214, 245, .3); font-size: .7rem; }
.badge-bundle { background: rgba(124, 106, 245, .15); color: var(--accent); border: 1px solid rgba(124, 106, 245, .3); }

@keyframes foil-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.badge-foil {
  background: linear-gradient(90deg, #ffd700, #ff9de2, #b388ff, #06d6f5, #ffd700);
  background-size: 300% 300%;
  animation: foil-shimmer 2.5s ease infinite;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.badge-nm { background: rgba(61, 255, 160, 0.1); color: #3dffa0; border: 1px solid rgba(61, 255, 160, 0.22); }
.badge-lp { background: rgba(245, 200, 66, 0.1); color: #f5c842; border: 1px solid rgba(245, 200, 66, 0.22); }
.badge-mp { background: rgba(245, 138, 66, 0.1); color: #f58a42; border: 1px solid rgba(245, 138, 66, 0.22); }
.badge-hp { background: rgba(245, 66, 66, 0.1); color: #f54242; border: 1px solid rgba(245, 66, 66, 0.22); }

/* ===== Section titles ===== */
.section-eyebrow {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: .8rem;
}
.section-title::before {
  content: '';
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(124, 106, 245, .5);
}
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to right, var(--border-bright), transparent); }
.section-eyebrow + .section-title { margin-top: 0; }

/* ===== Browse layout ===== */
.browse-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; }
@media (max-width: 768px) { .browse-layout { grid-template-columns: 1fr; } }
.filters-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  position: sticky;
  top: 72px;
}
.filters-toggle {
  display: none;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  padding: 0 0 .75rem;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: .75rem;
}
@media (max-width: 768px) {
  .filters-toggle { display: flex; }
}
.filter-group { margin-bottom: 1.2rem; }
.filter-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: .5rem;
}
.filter-select, .filter-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .4rem .75rem;
  border-radius: 6px;
  font-size: .88rem;
  outline: none;
  font-family: var(--font-body);
  transition: border-color .2s;
}
.filter-select:focus, .filter-input:focus { border-color: var(--accent); }
.filter-row { display: flex; gap: .5rem; }
.filter-row .filter-input { flex: 1; }
.filter-prefix-wrap { position: relative; flex: 1; }
.filter-prefix { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .88rem; pointer-events: none; }
.filter-prefix-wrap .filter-input { padding-left: 1.6rem; width: 100%; }
.apply-btn { width: 100%; margin-top: .5rem; }

/* ===== Card Detail ===== */
.detail-layout { display: grid; grid-template-columns: 300px 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 768px) { .detail-layout { grid-template-columns: 1fr; } .detail-img { max-width: 250px; margin: 0 auto; display: block; } }
.detail-img { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: 0 8px 40px rgba(0,0,0,0.45); }
.detail-img-placeholder {
  width: 300px;
  aspect-ratio: 3/4;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 4rem;
}
.detail-title { font-family: var(--font-display); font-size: 2.6rem; letter-spacing: 1px; font-weight: 400; margin-bottom: .4rem; text-transform: uppercase; line-height: 1.1; }
.detail-meta { color: var(--muted); font-size: .88rem; margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.detail-price { font-size: 2.2rem; font-weight: 900; color: var(--price); text-shadow: var(--price-shadow); margin-bottom: 1rem; }
.detail-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.detail-stats { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 1.2rem; }
.stat-row { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--muted); }
.qty-input {
  width: 75px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .4rem .6rem;
  border-radius: 6px;
  font-size: 1rem;
  text-align: center;
  font-family: var(--font-body);
}
.add-cart-form { display: flex; gap: .8rem; align-items: center; }

/* ===== Cart ===== */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; padding: .7rem .8rem; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
.cart-table td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-img { width: 50px; height: 70px; object-fit: cover; border-radius: 4px; }
.cart-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.cart-total { font-size: 1.5rem; font-weight: 900; color: var(--price); text-shadow: var(--price-shadow); margin-bottom: 1rem; }
.qty-form { display: flex; align-items: center; gap: .4rem; }

/* ===== Checkout ===== */
.checkout-form { max-width: 560px; }
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: .4rem; letter-spacing: .06em; text-transform: uppercase; }
.form-input, .form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .65rem 1rem;
  border-radius: 8px;
  font-size: .95rem;
  outline: none;
  font-family: var(--font-body);
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 106, 245, 0.12);
}
.form-textarea { resize: vertical; min-height: 100px; }
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }
@media (max-width: 800px) { .checkout-layout { grid-template-columns: 1fr; } }

/* ===== Admin ===== */
.admin-layout { display: grid; grid-template-columns: 200px 1fr; min-height: calc(100vh - 60px); }
.admin-sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 1.5rem 1rem; }
.admin-sidebar a { display: block; padding: .55rem .85rem; border-radius: 6px; color: var(--muted); font-size: .88rem; font-weight: 600; margin-bottom: .2rem; transition: all .15s; }
.admin-sidebar a:hover { background: var(--surface-2); color: var(--text); }
.admin-sidebar a.active { background: var(--accent); color: #fff; box-shadow: 0 0 14px rgba(124, 106, 245, 0.35); }
.admin-content { padding: 2rem; }
.admin-menu-toggle { display: none; background: none; border: 1px solid var(--border-bright); color: var(--muted); cursor: pointer; padding: .38rem .5rem; border-radius: 7px; line-height: 0; transition: border-color .15s, color .15s, background .15s, box-shadow .15s; }
.admin-menu-toggle:hover,
.admin-menu-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px rgba(124,106,245,.2); }
.admin-menu-toggle[aria-expanded="true"] { background: var(--accent-dim); }
@media (max-width: 768px) {
  .admin-menu-toggle { display: flex; align-items: center; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-content { padding: 1.25rem 1rem; }
}
.admin-title { font-family: var(--font-display); font-size: 2rem; letter-spacing: 1px; font-weight: 400; text-transform: uppercase; margin-bottom: 1.5rem; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: .65rem .8rem; background: var(--surface); color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.data-table td { padding: .65rem .8rem; border-bottom: 1px solid var(--border); font-size: .88rem; vertical-align: middle; }
.data-table tr:hover td { background: rgba(124, 106, 245, 0.04); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: border-color .2s; }
.stat-card:hover { border-color: var(--border-bright); }
.stat-card-value { font-family: var(--font-display); font-size: 3rem; font-weight: 400; color: var(--accent); letter-spacing: 1px; text-shadow: 0 0 22px rgba(124, 106, 245, 0.4); }
.stat-card-label { color: var(--muted); font-size: .85rem; margin-top: .2rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stats-row { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.admin-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.admin-actions .btn { min-width: 70px; text-align: center; }

/* ===== Pagination ===== */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.page-btn { padding: .4rem .85rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .88rem; cursor: pointer; transition: all .15s; font-family: var(--font-body); font-weight: 600; }
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 12px rgba(124, 106, 245, 0.4); }

/* Buy-in kiosk pager */
.buyin-pagination { display: flex; justify-content: center; align-items: center; gap: .3rem; margin-top: 1rem; flex-wrap: wrap; }
.buyin-page-btn { min-width: 2rem; padding: .3rem .55rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-family: var(--font-body); font-size: .8rem; line-height: 1.25; text-align: center; cursor: pointer; transition: border-color .15s, background .15s, color .15s, opacity .15s; }
.buyin-page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.buyin-page-btn.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.buyin-page-btn.nav { min-width: auto; padding-inline: .6rem; color: var(--muted); }
.buyin-page-btn.ellipsis { background: transparent; border-color: transparent; color: var(--muted); cursor: default; }
.buyin-page-btn:disabled:not(.ellipsis) { opacity: .4; cursor: not-allowed; }

/* ===== Alerts ===== */
.alert { padding: .85rem 1.2rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; font-weight: 600; }
.alert-error { background: rgba(245, 66, 66, 0.08); border: 1px solid rgba(245, 66, 66, 0.28); color: #f58a8a; }
.alert-success { background: rgba(61, 255, 160, 0.08); border: 1px solid rgba(61, 255, 160, 0.28); color: #3dffa0; }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty-state p { font-size: .95rem; font-weight: 600; }
.empty-state-icon { display: flex; justify-content: center; margin-bottom: 1.5rem; opacity: 0.5; color: var(--accent); }
.empty-state-icon svg { width: 3.5rem; height: 3.5rem; }

/* ===== Footer ===== */
footer {
  background: linear-gradient(180deg, var(--surface), #0a0a1a);
  border-top: 1px solid var(--border);
  padding: 0 1.5rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  position: relative;
}
footer::before {
  content: '';
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(124, 106, 245, .45), transparent);
}
.footer-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.4rem 0 1.8rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
.footer-brand-row { display: flex; align-items: center; gap: .55rem; }
.footer-brand-row img { height: 30px; width: auto; }
.footer-brand-name { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 1.5px; color: var(--text); transform: translateY(2px); }
.footer-tagline { font-size: .84rem; line-height: 1.6; max-width: 26rem; }
.footer-col-title {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: .8rem;
}
.footer-col { display: flex; flex-direction: column; gap: .45rem; }
.footer-col a { color: var(--muted); transition: color .15s; font-size: .86rem; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding: 1rem 0 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem;
  font-size: .78rem;
}
@media (max-width: 700px) {
  /* Mobile: brand centered full-width on top; Shop/Help stay side by side
     below, each column centered. */
  .footer-main {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand brand"
      "shop  help";
    gap: 1.5rem 1.25rem;
    padding: 1.7rem 0 1.3rem;
    text-align: center;
  }
  .footer-brand { grid-area: brand; align-items: center; text-align: center; }
  .footer-col-shop { grid-area: shop; }
  .footer-col-help { grid-area: help; }
  .footer-tagline { font-size: .8rem; max-width: none; }
  .footer-col-title { font-size: .68rem; margin-bottom: .6rem; }
  .footer-col { align-items: center; gap: .5rem; }
  .footer-col a { font-size: .82rem; }
  .footer-bottom {
    justify-content: center;
    text-align: center;
    gap: .3rem .8rem;
    font-size: .74rem;
    padding: .9rem 0 1.2rem;
  }
}

/* ===== Bundle Cards ===== */
.bundle-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2.2rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color .2s, box-shadow .25s, transform .2s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.bundle-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,106,245,.06) 0%, transparent 60%);
  pointer-events: none;
}
.bundle-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(124,106,245,0.22);
  transform: translateY(-4px);
  color: inherit;
}
.bundle-card-name { font-family: var(--font-display); font-size: 2rem; letter-spacing: 1px; color: var(--text); line-height: 1.2; }
.bundle-card-desc { font-size: .92rem; color: var(--muted); flex: 1; line-height: 1.6; }
.bundle-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: .8rem; padding-top: .9rem; border-top: 1px solid var(--border); flex-wrap: wrap; gap: .5rem; }
.bundle-card-count { font-size: .82rem; color: var(--muted); font-weight: 600; }
.bundle-card-price { font-size: 1.3rem; font-weight: 800; color: var(--price); letter-spacing: .01em; }
.bundle-card-cta { font-size: .88rem; color: var(--accent); font-weight: 700; letter-spacing: .02em; }
.bundle-card-img { width: 100%; border-radius: 8px; object-fit: cover; max-height: 320px; background: var(--bg); }
.bundle-card-details { margin-top: .1rem; }
.bundle-card-details summary { font-size: .82rem; color: var(--accent); font-weight: 700; cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .3rem; }
.bundle-card-details summary::-webkit-details-marker { display: none; }
.bundle-card-details summary::after { content: '▸'; font-size: .7rem; transition: transform .2s; }
.bundle-card-details[open] summary::after { transform: rotate(90deg); }
.bundle-card-details-list { list-style: none; padding: .55rem 0 0; margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.bundle-card-details-list li { font-size: .8rem; color: var(--muted); display: flex; gap: .4rem; align-items: baseline; }
.bundle-card-details-list li .qty { color: var(--accent); font-weight: 700; min-width: 1.6rem; }
.bundle-read-more-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  padding: .4rem 0 0;
  text-align: left;
  display: block;
  letter-spacing: .02em;
}
.bundle-read-more-btn:hover { text-decoration: underline; }

/* ===== Admin bundle listing rows ===== */
.bl-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .45rem .6rem;
  border-radius: 6px;
  transition: background .15s;
}
.bl-row:hover { background: rgba(255,255,255,.04); }
.bl-row--on { background: rgba(124,106,245,.08); }
.bl-info { flex: 1; font-size: .88rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qty-mini {
  width: 52px;
  padding: .2rem .3rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: .85rem;
  text-align: center;
}

/* ===== Save toast ===== */
.save-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: .55rem;
  background: #0d1f14;
  border: 1px solid #2a7a46;
  color: #4ade80;
  font-size: .88rem;
  font-weight: 600;
  padding: .65rem 1.1rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  animation: toastIn .25s ease;
  transition: opacity .4s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Carousel ===== */
.carousel-wrap {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.carousel-viewport {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  padding: 30px 10px;
  margin: -30px -10px;
}
.carousel-track {
  display: flex;
  align-items: stretch;
  gap: 1.2rem;
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 calc(20% - 0.96rem);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.carousel-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, border-color .2s;
}
.carousel-btn svg { display: block; }
.carousel-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(124, 106, 245, 0.5);
}
.carousel-btn[style*="visibility: hidden"] { pointer-events: none; }
.carousel-slide--bundle { flex: 0 0 calc(50% - 0.6rem); }
.carousel-slide--bundle .bundle-card { height: 100%; }
.carousel-wrap--bundles { align-items: center; }

/* ===== File input ===== */
input[type="file"].form-input {
  padding: .4rem .65rem;
  cursor: pointer;
  color: var(--muted);
}
input[type="file"].form-input::file-selector-button,
input[type="file"].form-input::-webkit-file-upload-button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .35rem .9rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  margin-right: .75rem;
  transition: background .2s, box-shadow .2s;
  box-shadow: 0 0 10px rgba(124, 106, 245, 0.25);
}
input[type="file"].form-input::file-selector-button:hover,
input[type="file"].form-input::-webkit-file-upload-button:hover {
  background: #6858d4;
  box-shadow: 0 0 18px rgba(124, 106, 245, 0.5);
}

/* ===== Number input spinners ===== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
input[type="number"] { -moz-appearance: textfield; }

/* Custom stepper wrapper for qty inputs */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.qty-stepper input[type="number"] {
  width: 52px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0;
  padding: .4rem .3rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  outline: none;
}
.qty-stepper button {
  width: 32px;
  height: 34px;
  background: var(--surface-2);
  border: none;
  color: var(--accent);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  font-family: var(--font-body);
  flex-shrink: 0;
}
.qty-stepper button:hover { background: var(--accent); color: #fff; }

/* ===== Utility ===== */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ===== Mobile ===== */
@media (max-width: 768px) {
  /* Container */
  .container { padding: 0 1rem; }
  .section { padding: 1.8rem 0; }

  /* Nav — hide search bar, tighten spacing */
  .nav-inner { padding: .7rem 1rem; gap: .6rem; }
  .nav-search { display: none; }
  .nav-brand-text { font-size: 1.15rem; }
  .nav-links { gap: .85rem; }
  .nav-links a { font-size: .85rem; }

  /* Hero */
  .hero { padding: 3rem 1rem; }
  .hero h1 { font-size: 3rem; letter-spacing: 2px; }
  .hero p { font-size: .95rem; margin-bottom: 1.5rem; }

  /* Section title */
  .section-title { font-size: 1.6rem; letter-spacing: 1.5px; }

  /* Carousel — 2 cards on tablet; bundles drop to 1 */
  .carousel-slide { flex: 0 0 calc(50% - 0.6rem); }
  .carousel-slide--bundle { flex: 0 0 100%; }
  .carousel-wrap--bundles { align-items: center; }
  .carousel-wrap--bundles .carousel-btn { display: none; }
  /* Enough right padding to not clip card border-radius, but less than the
     0.75rem inter-card gap so the 3rd card never peeks through */
  .carousel-viewport { padding-right: 4px; margin-right: -4px; }
  /* No translate/scale on touch — avoids right/top clip inside overflow:hidden */
  .card-tile:hover { transform: none; }

  /* Cards grid — 2 columns */
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: .85rem; }
  .cards-grid--one-row { row-gap: 0; }

  /* Browse filters — un-sticky on mobile */
  .filters-sidebar { position: static; top: auto; }

  /* Cart table — horizontal scroll */
  .cart-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Detail page */
  .detail-title { font-size: 2rem; }
  .detail-price { font-size: 1.8rem; }
  .detail-img-placeholder { width: 100%; }
  .add-cart-form { flex-wrap: wrap; }
}

/* ===== Hamburger breakpoint ===== */
@media (max-width: 640px) {
  .nav-links a:not(.cart-btn) { display: none; }
  .nav-hamburger { display: flex; align-items: center; }
}

@media (max-width: 480px) {
  /* Hero */
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: .88rem; }

  /* Carousel — 2 cards on small mobile, matching browse grid */
  .carousel-slide { flex: 0 0 calc(50% - 0.45rem); }
  .carousel-slide--bundle { flex: 0 0 100%; }
  .carousel-track { gap: .75rem; }

  /* Cards grid — still 2 columns but tighter */
  .cards-grid { gap: .6rem; }
  .card-tile-name { font-size: .85rem; }
  .card-tile-meta { font-size: .72rem; }

  /* Pagination */
  .page-btn { padding: .35rem .65rem; font-size: .82rem; }
}

/* ===== Toggle Switch ===== */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  user-select: none;
}
.toggle-wrap input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 23px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-bright);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.toggle-wrap input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(124,106,245,.4);
}
.toggle-wrap input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 17px;
  height: 17px;
  background: #fff;
  border-radius: 50%;
  top: 1px;
  left: 2px;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.toggle-wrap input[type="checkbox"]:checked::before {
  transform: translateX(19px);
}
.toggle-wrap span { font-size: .9rem; font-weight: 600; }

/* ===== Custom Checkbox ===== */
.check-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  user-select: none;
}
.check-wrap input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-bright);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.check-wrap input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check-wrap input[type="checkbox"]::after {
  content: '';
  position: absolute;
  display: none;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.check-wrap input[type="checkbox"]:checked::after { display: block; }
.check-wrap span { font-size: .85rem; }

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
  font-weight: 600;
}
.breadcrumb a { color: var(--muted); transition: color .15s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .crumb-sep { color: var(--dim); }
.breadcrumb .crumb-current { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22rem; }

/* ===== Detail page polish ===== */
.detail-img {
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 40px rgba(124, 106, 245, 0.12);
  transition: transform .3s ease, box-shadow .3s ease;
}
.detail-img:hover {
  transform: scale(1.015);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6), 0 0 60px rgba(124, 106, 245, 0.22);
}
.detail-thumb { transition: border-color .15s, transform .15s; }
.detail-thumb:hover { transform: translateY(-2px); }
.detail-desc { font-size: .9rem; line-height: 1.65; color: #b9bdd6; }

/* ===== Browse toolbar ===== */
.browse-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.results-count { color: var(--muted); font-size: .88rem; font-weight: 600; }
.results-count strong { color: var(--text); font-weight: 800; }

/* ===== Tools page ===== */
.page-header { text-align: center; margin-bottom: 2.6rem; }
.page-header .section-eyebrow { color: var(--accent-2); }
.page-header-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 400;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  line-height: 1.05;
  margin-bottom: .6rem;
}
.page-header p { color: var(--muted); max-width: 32rem; margin: 0 auto; font-size: .95rem; line-height: 1.65; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 780px;
  margin: 0 auto;
}
.tool-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  height: 100%;
}
.tool-card--disabled { opacity: .5; }
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(124, 106, 245, .18), rgba(6, 214, 245, .08));
  border: 1px solid rgba(124, 106, 245, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tool-title {
  font-size: 1.15rem;
  font-family: var(--font-display);
  letter-spacing: 1px;
  margin-bottom: .4rem;
}
.tool-desc { font-size: .875rem; color: var(--muted); line-height: 1.55; margin: 0; }
.tool-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.tool-open { font-size: .82rem; color: var(--accent); font-weight: 700; }
.badge-available { background: rgba(99, 102, 241, .18); color: #a5b4fc; }
.badge-disabled { background: rgba(144, 144, 176, .12); color: var(--muted); }

/* ===== Cart polish ===== */
.cart-section-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .8rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.cart-section-heading::before {
  content: '';
  width: 8px; height: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transform: rotate(45deg);
  border-radius: 1px;
  flex-shrink: 0;
}
.cart-summary { position: sticky; top: 80px; }
.cart-summary h2 { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 1.5px; font-weight: 400; text-transform: uppercase; }
.cart-img { box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }
@media (max-width: 800px) { .cart-summary { position: static; top: auto; } }

/* ===== Bundle tile helpers ===== */
.bundle-tile-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.bundle-tile-list li { font-size: .8rem; display: flex; gap: .4rem; align-items: flex-start; }
.bundle-tile-list .qty { color: var(--accent); font-weight: 700; min-width: 1.4rem; flex-shrink: 0; }
.bundle-tile-includes {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .35rem;
}

/* Reset global <nav> chrome on non-navbar nav elements */
nav.footer-col,
nav.breadcrumb {
  position: static;
  background: none;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: auto;
}
