/* ===== 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;
  --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(rgba(124, 106, 245, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

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: 2.5rem 0; }

/* ===== 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: 5rem 1.5rem;
  text-align: center;
  overflow: hidden;
}
.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 h1 {
  font-family: var(--font-display);
  font-size: 5rem;
  letter-spacing: 3px;
  line-height: 1;
  margin-bottom: .8rem;
  text-transform: uppercase;
}
.hero h1 span { color: var(--accent); text-shadow: 0 0 32px rgba(124, 106, 245, 0.6); }
.hero p { color: var(--muted); font-size: 1.1rem; margin-bottom: 2rem; font-weight: 500; }

/* ===== Hero Carousel ===== */
.hero-carousel-wrap { padding-bottom: 3.5rem; min-height: 420px; }
.hero-slide {
  display: none;
  position: relative;
  width: 100%;
}
.hero-slide.active { display: block; 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%);
}

/* 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;
  cursor: pointer;
  color: var(--text);
  z-index: 10;
  transition: background .2s;
  margin-top: -1.75rem; /* half of dots area */
}
.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: var(--accent); color: #fff; box-shadow: 0 0 16px rgba(124, 106, 245, 0.3); }
.btn-primary:hover { background: #6858d4; color: #fff; box-shadow: 0 0 26px rgba(124, 106, 245, 0.55); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn-secondary:hover { background: var(--accent-dim); 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: var(--surface);
  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.22), 0 0 0 1px rgba(124, 106, 245, 0.18);
}
.card-tile-img { width: 100%; aspect-ratio: 421/614; object-fit: contain; background: var(--surface-2); }
.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 {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(124,106,245,.92);
  color: #fff;
  border: none;
  padding: .5rem;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s, transform .18s;
  backdrop-filter: blur(4px);
}
.card-tile:hover .quick-add-btn { opacity: 1; transform: translateY(0); }
.quick-add-btn.added { background: rgba(44,190,100,.92); }
.quick-add-btn.error { background: rgba(248,113,113,.92); }
.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; }
.card-tile-meta { color: var(--muted); font-size: .78rem; margin-bottom: .5rem; flex: 1; }
.card-tile-footer { display: flex; flex-direction: column; gap: .35rem; }
.card-tile-footer-row { display: flex; align-items: center; justify-content: space-between; }
.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); }

@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-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: .8rem;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to right, var(--border-bright), transparent); }

/* ===== 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); }

/* ===== 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(--dim); }
.empty-state-icon { display: flex; justify-content: center; margin-bottom: 1.5rem; opacity: 0.4; }
.empty-state-icon svg { width: 3.5rem; height: 3.5rem; }

/* ===== Footer ===== */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.75rem 1.5rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: var(--text); }
@media (max-width: 600px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: .9rem; }
  .footer-links { gap: 1rem; }
}

/* ===== 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;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, border-color .2s;
}
.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; }
