/* ==============================================
   Power Roleplay Store — Theme matching powerroleplay.net
   ============================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:           #050505;
  --bg-soft:      #0c0c0c;
  --bg-card:      #111111;
  --bg-elevated:  #161616;
  --bg-input:     #0e0e0e;

  --accent:       #4ade80;
  --accent-dim:   #22c55e;
  --accent-glow:  rgba(74,222,128,.18);
  --accent-dark:  #166534;

  --sale:         #ef4444;
  --sale-bg:      rgba(239,68,68,.12);

  --white:        #ffffff;
  --text:         #e4e4e7;
  --text-sec:     #a1a1aa;
  --text-muted:   #52525b;

  --border:       rgba(255,255,255,.07);
  --border-h:     rgba(255,255,255,.14);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-h: 64px;
  --r: 12px;
  --r-sm: 8px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input { font-family: inherit; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ── Loader ── */
.page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .4s, visibility .4s;
}
.page-loader.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-content { text-align: center; }
.loader-spinner {
  width: 40px; height: 40px; margin: 0 auto 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-logo { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 12px; }
.loader-text { font-size: .75rem; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; }

/* ── Navbar ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); z-index: 1000;
  background: rgba(5,5,5,.6);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  transition: background .3s;
}
.navbar.scrolled { background: rgba(5,5,5,.92); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.brand-logo { width: 32px; height: 32px; border-radius: 8px; }
.brand-label {
  font-size: .95rem; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase;
}
.brand-accent { color: var(--accent); }

.nav-center {
  display: flex; align-items: center; gap: 6px;
}
.nav-link {
  padding: 6px 14px; border-radius: 6px;
  font-size: .82rem; font-weight: 500;
  color: var(--text-sec);
  transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,.05); }
.nav-link-active {
  color: var(--accent) !important;
  background: rgba(74,222,128,.08) !important;
}

.nav-right { display: flex; align-items: center; gap: 12px; }

.cart-btn {
  position: relative;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  transition: all .2s;
}
.cart-btn:hover { border-color: var(--accent); background: rgba(74,222,128,.06); }
.cart-btn svg { color: var(--text-sec); transition: color .2s; }
.cart-btn:hover svg { color: var(--accent); }
.cart-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--accent); color: #000;
  font-size: .6rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  transition: transform .25s;
}
.cart-badge.bump { animation: bump .35s ease; }
@keyframes bump { 0%,100%{ transform: scale(1) } 50%{ transform: scale(1.35) } }

.mobile-toggle { display: none; flex-direction: column; gap: 5px; padding: 6px; }
.mobile-toggle span {
  width: 20px; height: 2px; background: var(--text);
  border-radius: 1px; transition: all .3s;
}

/* ── Hero ── */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 80px) 0 70px;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(74,222,128,.08) 0%, transparent 60%),
    var(--bg);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }

.hero-tag {
  display: inline-block;
  padding: 4px 16px; border-radius: 4px;
  font-size: .65rem; font-weight: 700; letter-spacing: 3px;
  color: var(--accent);
  background: rgba(74,222,128,.08);
  border: 1px solid rgba(74,222,128,.15);
  margin-bottom: 28px;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900; line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 20px;
}
.hero-highlight {
  background: linear-gradient(135deg, var(--accent), #34d399);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  max-width: 560px; margin: 0 auto 36px;
  font-size: .95rem; color: var(--text-sec); line-height: 1.7;
}

.hero-stats {
  display: flex; justify-content: center; gap: 48px;
  margin-bottom: 36px;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  display: block;
  font-size: 2rem; font-weight: 800;
  color: var(--accent);
}
.hero-stat-lbl {
  font-size: .7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px;
}

.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 32px; border-radius: 8px;
  font-size: .85rem; font-weight: 600;
  color: #000; background: var(--accent);
  transition: all .25s;
}
.hero-cta:hover { background: var(--accent-dim); transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }
.hero-cta svg { animation: bob 1.4s ease infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(3px) } }

/* ── Store Layout ── */
.store { position: relative; z-index: 1; padding-bottom: 60px; }

.store-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* ── Sidebar ── */
.store-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  z-index: 100;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.sidebar-toggle svg:first-child { color: var(--accent); flex-shrink: 0; }
.sidebar-chevron {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform .3s;
}

.sidebar-body {
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}
.store-sidebar.open .sidebar-body {
  max-height: 2000px;
}
.store-sidebar.open .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-search {
  position: relative;
  padding: 12px 14px 8px;
}
.sidebar-search svg {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.sidebar-search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: .8rem;
  outline: none;
  transition: border-color .2s;
}
.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-search input:focus { border-color: var(--accent); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 6px 8px 12px;
  gap: 2px;
  max-height: calc(100vh - var(--nav-h) - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-sec);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  transition: all .2s;
}
.sidebar-cat:hover {
  color: var(--white);
  background: rgba(255,255,255,.04);
  border-color: var(--border);
}
.sidebar-cat.active {
  color: var(--white);
  background: rgba(74,222,128,.08);
  border-color: rgba(74,222,128,.2);
}
.sidebar-cat.active .sidebar-cat-icon { color: var(--accent); }
.sidebar-cat.active .sidebar-cat-count {
  background: var(--accent);
  color: #000;
}

.sidebar-cat-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color .2s;
}
.sidebar-cat-icon svg { width: 16px; height: 16px; }

.sidebar-cat-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-cat-count {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .65rem;
  font-weight: 700;
  background: rgba(255,255,255,.06);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all .2s;
}

/* Subcategory items in sidebar */
.sidebar-sub-group {
  display: flex;
  flex-direction: column;
  padding-left: 16px;
  gap: 1px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.sidebar-cat.active + .sidebar-sub-group,
.sidebar-cat.has-active-sub + .sidebar-sub-group {
  max-height: 600px;
}

.sidebar-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px 7px 22px;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  text-align: left;
  transition: all .2s;
  position: relative;
}
.sidebar-sub::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background .2s;
}
.sidebar-sub:hover {
  color: var(--text);
  background: rgba(255,255,255,.03);
}
.sidebar-sub.active {
  color: var(--accent);
  background: rgba(74,222,128,.06);
}
.sidebar-sub.active::before {
  background: var(--accent);
}

.sidebar-sub-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-sub-count {
  font-size: .6rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Content area ── */
.store-content {
  flex: 1;
  min-width: 0;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.content-header-info {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.content-header-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .5px;
}
.content-header-count {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

/* Category / Subcategory headers */
.cat-header {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 14px;
  padding: 28px 0 6px;
}
.cat-header h2 {
  font-size: .85rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  white-space: nowrap;
}
.cat-header .line { flex: 1; height: 1px; background: var(--border); }
.cat-header .cnt {
  font-size: .68rem; color: var(--text-muted);
  padding: 3px 10px; border-radius: 20px;
  background: rgba(255,255,255,.04);
  white-space: nowrap;
}

.sub-header {
  grid-column: 1 / -1;
  padding: 14px 0 2px;
}
.sub-header h3 {
  font-size: .78rem; font-weight: 600;
  color: var(--accent); letter-spacing: 1px;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.sub-header h3::before {
  content: '';
  width: 3px; height: 14px; border-radius: 2px;
  background: var(--accent);
}

/* Category description */
.cat-desc {
  grid-column: 1 / -1;
  padding: 0 0 6px;
}
.cat-desc p {
  font-size: .82rem;
  color: var(--text-sec);
  line-height: 1.6;
}

/* Subscription tier grid */
.sub-grid {
  grid-column: 1 / -1;
}
.sub-grid-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

/* ── Subscription Tier Card ── */
.sub-card {
  border-radius: var(--r);
  background: var(--bg-card);
  border: 2px solid var(--tier-color, var(--border));
  overflow: hidden;
  cursor: pointer;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  display: flex;
  flex-direction: column;
}
.sub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--tier-glow, rgba(0,0,0,.3)),
              0 0 20px var(--tier-glow, transparent);
}

.sub-card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-soft);
}
.sub-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s;
}
.sub-card:hover .sub-card-img img { transform: scale(1.05); }

.sub-card-badge {
  position: absolute;
  top: 10px; right: 10px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #000;
  text-transform: uppercase;
}

.sub-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.sub-card-name {
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .3px;
}
.sub-card-prices {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.sub-card-was {
  font-size: .78rem;
  color: var(--text-muted);
  text-decoration: line-through;
}
.sub-card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
}
.sub-card-period {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sub-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  color: #000;
  text-align: center;
  text-decoration: none;
  transition: filter .2s, transform .15s;
  margin-top: auto;
}
.sub-card-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
.sub-card-btn svg { flex-shrink: 0; }

/* Tier accents */
.sub-card--silver  { --tier-color: #9ca3af; --tier-glow: rgba(156,163,175,.15); }
.sub-card--gold    { --tier-color: #f59e0b; --tier-glow: rgba(245,158,11,.15); }
.sub-card--platinum { --tier-color: #94a3b8; --tier-glow: rgba(148,163,184,.18); }
.sub-card--diamond { --tier-color: #38bdf8; --tier-glow: rgba(56,189,248,.15); }
.sub-card--amethyst { --tier-color: #a78bfa; --tier-glow: rgba(167,139,250,.15); }

/* ── Tier Comparison Table ── */
.tier-table-wrap {
  grid-column: 1 / -1;
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.tier-table-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.tier-table-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.tier-table-scroll::-webkit-scrollbar { height: 5px; }
.tier-table-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.tier-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-size: .8rem;
}
.tier-table thead tr {
  background: var(--bg-elevated);
  border-bottom: 2px solid var(--border);
}
.tier-table th {
  padding: 14px 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: .68rem;
  white-space: nowrap;
}
.tt-feature-col {
  text-align: left;
  color: var(--text-muted);
  width: 180px;
  min-width: 140px;
}
.tt-tier-col {
  text-align: center;
  color: var(--tc, var(--text));
}

.tier-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.tier-table tbody tr:hover {
  background: rgba(255,255,255,.02);
}
.tier-table tbody tr:last-child { border-bottom: none; }

.tt-feature {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-sec);
  white-space: nowrap;
}
.tt-feature--price {
  color: var(--text);
  font-weight: 700;
}
.tt-cell {
  padding: 12px 16px;
  text-align: center;
  vertical-align: middle;
}
.tt-cell svg { display: inline-block; vertical-align: middle; }

.tt-val {
  font-weight: 700;
  color: var(--white);
  font-size: .78rem;
}
.tt-dash {
  color: var(--text-muted);
  font-size: .9rem;
}

.tt-price-row {
  background: rgba(255,255,255,.02);
}
.tt-price-cell {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}
.tt-was {
  font-size: .7rem;
  color: var(--text-muted);
  text-decoration: line-through;
}
.tt-price {
  font-size: 1rem;
  font-weight: 800;
}
.tt-per {
  font-size: .68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tt-btn-row td { padding: 14px 16px; }
.tt-sub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 700;
  color: #000;
  text-decoration: none;
  transition: filter .2s, transform .15s;
  white-space: nowrap;
}
.tt-sub-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .tt-feature-col { width: 120px; min-width: 100px; }
  .tier-table th, .tt-feature, .tt-cell { padding: 10px 10px; }
}

/* ── Card ── 
.card {
  border-radius: var(--r);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .3s, border-color .3s, box-shadow .3s;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(74,222,128,.25);
  box-shadow: 0 12px 36px rgba(0,0,0,.5);
}

.card-img {
  position: relative;
  width: 100%; aspect-ratio: 16/10;
  overflow: hidden; background: var(--bg-soft);
}
.card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s;
}
.card:hover .card-img img { transform: scale(1.05); }

.card-sale-tag {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 8px; border-radius: 4px;
  font-size: .6rem; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase;
  background: var(--sale); color: #fff;
}
.card-pct-tag {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 7px; border-radius: 4px;
  font-size: .6rem; font-weight: 700;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  color: var(--sale);
}
.card-cat-tag {
  position: absolute; bottom: 8px; left: 10px;
  padding: 2px 7px; border-radius: 3px;
  font-size: .55rem; font-weight: 600; letter-spacing: .5px;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  color: var(--accent); text-transform: uppercase;
}

.card-body { padding: 14px 16px 16px; }
.card-title {
  font-size: .88rem; font-weight: 600; line-height: 1.3;
  margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.card-bottom {
  display: flex; align-items: center; justify-content: space-between;
}
.card-prices { display: flex; align-items: baseline; gap: 6px; }
.card-price { font-size: 1rem; font-weight: 700; color: var(--accent); }
.card-was { font-size: .75rem; color: var(--text-muted); text-decoration: line-through; }

.card-add {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #000;
  transition: all .2s;
}
.card-add:hover { background: var(--accent-dim); transform: scale(1.08); }
.card-add svg { width: 16px; height: 16px; pointer-events: none; }

/* ── Empty ── */
.empty { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty svg { margin: 0 auto 14px; }
.empty h3 { font-size: 1.1rem; color: var(--text-sec); margin-bottom: 6px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  transition: all .25s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  position: relative;
  width: 100%; max-width: 500px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transform: scale(.96) translateY(8px);
  transition: transform .25s;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); color: var(--text-sec);
  transition: background .2s;
}
.modal-close:hover { background: rgba(255,255,255,.1); }

.modal-img-wrap {
  position: relative;
  width: 100%; aspect-ratio: 16/9;
  overflow: hidden; background: var(--bg-soft);
}
.modal-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.modal-sale-badge {
  position: absolute; top: 14px; left: 14px;
  padding: 5px 12px; border-radius: 5px;
  font-size: .65rem; font-weight: 700; letter-spacing: 1px;
  background: var(--sale); color: #fff;
}

.modal-content { padding: 22px 24px 28px; }
.modal-cat {
  display: block;
  font-size: .65rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--accent); margin-bottom: 6px;
}
.modal-name {
  font-size: 1.25rem; font-weight: 700;
  margin-bottom: 14px;
}
.modal-price-row {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 14px;
}
.modal-price {
  font-size: 1.5rem; font-weight: 800;
  color: var(--accent);
}
.modal-was {
  font-size: .9rem; color: var(--text-muted);
  text-decoration: line-through;
}
.modal-pct {
  padding: 2px 7px; border-radius: 4px;
  font-size: .68rem; font-weight: 700;
  background: var(--sale-bg); color: var(--sale);
}
.modal-desc {
  font-size: .82rem; color: var(--text-sec);
  line-height: 1.7; margin-bottom: 20px;
}

.modal-qty {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.qty-btn {
  width: 40px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 600;
  color: var(--text-sec);
  background: rgba(255,255,255,.03);
  transition: background .15s, color .15s;
}
.qty-btn:hover { background: rgba(255,255,255,.08); color: var(--white); }
.qty-val {
  width: 44px; text-align: center;
  font-size: .9rem; font-weight: 700;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  line-height: 38px;
}

.modal-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px;
  border-radius: 10px;
  font-size: .88rem; font-weight: 700;
  color: #000; background: var(--accent);
  transition: all .2s;
}
.modal-add-btn:hover { background: var(--accent-dim); transform: translateY(-1px); }

/* CFX Auth */
.cfx-login-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; border-radius: 8px;
  background: #F40552; color: #fff;
  font-size: .82rem; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: background .2s, transform .15s;
}
.cfx-login-btn:hover { background: #d0044a; transform: translateY(-1px); }
.cfx-login-btn .cfx-icon { flex-shrink: 0; }

.cfx-user {
  display: flex; align-items: center; gap: 8px;
}
.cfx-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border);
}
.cfx-name {
  color: var(--text); font-size: .82rem; font-weight: 600;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cfx-logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(255,255,255,.06); color: var(--text-muted);
  transition: background .2s, color .2s;
}
.cfx-logout-btn:hover { background: rgba(244,5,82,.15); color: #F40552; }

/* Discord ID */
.discord-id-wrap {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 8px;
  background: rgba(88,101,242,.12);
  border: 1px solid rgba(88,101,242,.25);
}
.discord-icon { color: #5865f2; flex-shrink: 0; }
.discord-id-text {
  color: var(--text); font-size: .78rem; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.discord-edit-btn {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 5px;
  background: rgba(255,255,255,.06); color: var(--text-muted);
  transition: background .2s, color .2s; cursor: pointer;
}
.discord-edit-btn:hover { background: rgba(88,101,242,.2); color: #5865f2; }

@media (max-width: 768px) {
  .cfx-login-btn { padding: 6px 12px; font-size: .78rem; }
  .cfx-name { max-width: 80px; }
  .discord-id-wrap { padding: 5px 10px; gap: 6px; }
  .discord-id-text { max-width: 100px; font-size: .72rem; }
}
.modal-add-btn svg { pointer-events: none; }

/* ── Cart Sidebar ── */
.cart-overlay {
  position: fixed; inset: 0; z-index: 2500;
  background: rgba(0,0,0,.5);
  opacity: 0; visibility: hidden;
  transition: all .25s;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 400px; max-width: 90vw; z-index: 2600;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
}
.cart-sidebar.open { transform: translateX(0); }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-header h2 { font-size: 1rem; font-weight: 700; }
.cart-close-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sec); transition: background .2s;
}
.cart-close-btn:hover { background: rgba(255,255,255,.06); }

.cart-body {
  flex: 1; overflow-y: auto; padding: 16px 22px;
}
.cart-items { display: flex; flex-direction: column; gap: 12px; }

/* Cart item */
.cart-item {
  display: flex; gap: 12px;
  padding: 12px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
}
.cart-item-img {
  width: 64px; height: 64px; border-radius: 6px;
  overflow: hidden; flex-shrink: 0;
  background: var(--bg-soft);
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: .8rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.cart-item-price { font-size: .78rem; color: var(--accent); font-weight: 700; }
.cart-item-controls {
  display: flex; align-items: center; gap: 0; margin-top: 6px;
  border: 1px solid var(--border); border-radius: 5px; overflow: hidden;
  width: fit-content;
}
.ci-btn {
  width: 28px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 600; color: var(--text-sec);
  background: rgba(255,255,255,.03);
  transition: background .15s;
}
.ci-btn:hover { background: rgba(255,255,255,.08); color: var(--white); }
.ci-qty {
  width: 30px; text-align: center; font-size: .75rem; font-weight: 700;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  line-height: 26px;
}
.cart-item-remove {
  align-self: flex-start;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text-muted); flex-shrink: 0;
  transition: background .15s, color .15s;
}
.cart-item-remove:hover { background: rgba(239,68,68,.12); color: var(--sale); }
.cart-item-remove svg { width: 14px; height: 14px; pointer-events: none; }

.cart-empty-msg {
  text-align: center; padding: 40px 0;
  color: var(--text-muted);
}
.cart-empty-msg svg { margin: 0 auto 10px; }
.cart-empty-msg p { font-size: .85rem; }

.cart-footer {
  padding: 18px 22px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  font-size: .9rem; font-weight: 600;
}
.cart-total-val { font-size: 1.15rem; font-weight: 800; color: var(--accent); }

.cart-clear {
  display: block; width: 100%;
  padding: 10px; border-radius: 8px;
  font-size: .8rem; font-weight: 600;
  text-align: center;
  color: var(--text-sec);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  transition: all .2s;
}
.cart-clear:hover { background: rgba(255,255,255,.07); color: var(--white); }

/* Cart email input */
.cart-email-wrap {
  margin-bottom: 12px;
}
.cart-email-label {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 600; color: var(--text-sec);
  margin-bottom: 6px;
}
.cart-email-label svg { color: var(--accent); flex-shrink: 0; }
.cart-email-hint { font-weight: 400; color: var(--text-muted); font-size: .68rem; }
.cart-email-input {
  width: 100%; padding: 10px 12px;
  border-radius: 8px;
  font-size: .82rem; font-family: inherit;
  color: var(--text); background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.cart-email-input::placeholder { color: var(--text-muted); }
.cart-email-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,252,.15);
}
.cart-email-input.invalid {
  border-color: var(--sale);
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}

.cart-checkout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px;
  border-radius: 10px;
  font-size: .88rem; font-weight: 700;
  color: #000; background: var(--accent);
  transition: all .2s;
  margin-bottom: 10px;
}
.cart-checkout:hover { background: var(--accent-dim); }
.cart-checkout:disabled { opacity: .6; cursor: not-allowed; }
.cart-checkout:disabled:hover { background: var(--accent); }
.cart-checkout .spin { animation: spin .7s linear infinite; }

.cart-note {
  font-size: .7rem; color: var(--text-muted); text-align: center;
}

/* ── Toast ── */
.toast-wrap {
  position: fixed; bottom: 24px; right: 24px; z-index: 9000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .82rem; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .3s ease;
}
.toast.out { animation: toastOut .3s ease forwards; }
.toast-icon { color: var(--accent); flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(30px); } }

/* ── Footer ── */
.footer {
  position: relative; z-index: 1;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 56px 0 0;
}
.ft-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.ft-brand { display: flex; flex-direction: column; gap: 10px; }
.ft-logo { width: 40px; height: 40px; border-radius: 10px; }
.ft-name { font-size: .9rem; font-weight: 800; letter-spacing: 1.5px; }
.ft-desc { font-size: .82rem; color: var(--text-sec); line-height: 1.7; max-width: 300px; }

.ft-col { display: flex; flex-direction: column; gap: 8px; }
.ft-col h4 {
  font-size: .68rem; font-weight: 700; letter-spacing: 2px;
  color: var(--text-muted); margin-bottom: 4px;
}
.ft-col a { font-size: .82rem; color: var(--text-sec); transition: color .2s; }
.ft-col a:hover { color: var(--accent); }

.ft-bottom {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
  padding: 18px 0;
}
.ft-bottom p { font-size: .72rem; color: var(--text-muted); }
.ft-socials { display: flex; gap: 12px; }
.ft-socials a {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04);
  color: var(--text-muted);
  transition: all .2s;
}
.ft-socials a:hover { background: rgba(74,222,128,.1); color: var(--accent); }

/* ── Checkout Error Banner ── */
.checkout-error-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  transform: translateY(-100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.checkout-error-banner.show { transform: translateY(0); }
.ceb-inner {
  display: flex; align-items: center; gap: 14px;
  max-width: 720px; margin: 16px auto;
  padding: 16px 20px;
  background: #1a1015; border: 1px solid #ef4444;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(239,68,68,.2);
}
.ceb-icon { flex-shrink: 0; color: #ef4444; }
.ceb-text { flex: 1; min-width: 0; }
.ceb-text strong { display: block; color: #ef4444; font-size: .95rem; margin-bottom: 2px; }
.ceb-text p { color: var(--text-sec); font-size: .82rem; margin: 0; line-height: 1.4; }
.ceb-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ceb-retry {
  padding: 8px 18px; border-radius: 8px;
  background: #ef4444; color: #fff;
  font-size: .82rem; font-weight: 700;
  transition: background .2s, transform .15s;
}
.ceb-retry:hover { background: #dc2626; transform: translateY(-1px); }
.ceb-dismiss {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  color: var(--text-muted); background: transparent;
  transition: background .2s, color .2s;
}
.ceb-dismiss:hover { background: rgba(255,255,255,.06); color: var(--text); }

/* ── Back to top ── */
.btt {
  position: fixed; bottom: 24px; left: 24px; z-index: 999;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sec);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all .25s;
}
.btt.show { opacity: 1; visibility: visible; transform: translateY(0); }
.btt:hover { border-color: var(--accent); color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .nav-center { display: none; }
  .mobile-toggle { display: flex; }
  .nav-center.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: rgba(5,5,5,.96); backdrop-filter: blur(20px);
    padding: 14px 24px; gap: 4px;
    border-bottom: 1px solid var(--border);
  }
  .ft-top { grid-template-columns: 1fr 1fr; }

  /* Sidebar becomes collapsible */
  .store-layout {
    flex-direction: column;
  }
  .store-sidebar {
    position: relative;
    top: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .hero { padding: calc(var(--nav-h) + 48px) 0 48px; }
  .hero-stats { gap: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
  .sub-grid-tiers { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .ft-top { grid-template-columns: 1fr; gap: 28px; }
  .ft-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .modal { max-width: 100%; }
}
