/* ============ Shop — Professional Dark Theme ============ */
:root {
  --bg: transparent;
  --bg-card: rgba(11,14,20,0.85);
  --bg-topbar: rgba(11,14,20,0.9);
  --bg-sidebar: rgba(11,14,20,0.95);
  --bg-input: rgba(26,30,40,0.8);
  --bg-hover: rgba(26,31,42,0.8);
  --active-bg: rgba(30,36,51,0.8);
  --active-border: #6366f1;
  --green: #34d399;
  --green-dim: #6ee7b7;
  --blue: #818cf8;
  --blue-dark: #6366f1;
  --purple: #818cf8;
  --purple-dim: #a5b4fc;
  --pink: #f472b6;
  --red: #f87171;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --text-mute: #64748b;
  --border: #1e293b;
  --border-soft: #172033;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 240px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: var(--font); cursor: pointer; }
input, textarea, select { font-family: var(--font); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #0f1319;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: #f1f5f9; }
.brand-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: grid; place-items: center;
  color: #fff; font-size: 16px;
  box-shadow: 0 0 20px rgba(99,102,241,0.5), 0 0 40px rgba(99,102,241,0.15);
  overflow: hidden;
}
/* The crest fills the badge instead of the old emoji glyph. */
.brand-logo > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.topbar-spacer { flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.btn-green-pill {
  background: rgba(99,102,241,0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.2);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.btn-green-pill:hover { background: rgba(99,102,241,0.2); color: #c7d2fe; text-decoration: none; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: #1e293b;
  display: grid; place-items: center;
  font-size: 13px;
  color: #94a3b8;
  border: 1px solid #334155;
  cursor: pointer;
}
.avatar img { border-radius: 8px; }

/* ---------- Layout ---------- */
.layout { display: flex; padding-top: 56px; min-height: 100vh; position: relative; }

.layout > * {
  position: relative;
  z-index: 1;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: rgba(13, 16, 23, 0.72);
  border-right: 1px solid #1e293b;
  padding: 16px 12px;
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  z-index: 10 !important;
  isolation: isolate;
  overflow-y: auto;
}
.sidebar .profile {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: #131720;
  border: 1px solid #6366f1;
  border-radius: 10px;
  margin-bottom: 14px;
  box-shadow: 0 0 25px rgba(99,102,241,0.25), 0 0 50px rgba(99,102,241,0.08);
}
.sidebar .profile .avatar { width: 40px; height: 40px; font-size: 15px; border: 1px solid #334155; }
.sidebar .profile .welcome { font-size: 11px; color: var(--text-mute); }
.sidebar .profile .name { font-weight: 600; display: flex; align-items: center; gap: 6px; font-size: 14px; color: #f1f5f9; }
.sidebar .profile .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.sidebar .plan {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 10px;
}
.nav-section {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-mute);
  font-weight: 600;
  padding: 16px 10px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  user-select: none;
  transition: all .15s ease;
  background: transparent;
  margin-bottom: 2px;
  box-shadow: 0 0 8px rgba(99,102,241,0.08);
}
.nav-item:hover { background: #1a1f2a; color: #e2e8f0; text-decoration: none; box-shadow: 0 0 12px rgba(99,102,241,0.1); }
.nav-item.active {
  background: #1e2433;
  color: #f1f5f9;
  font-weight: 600;
  border-left: 2px solid #6366f1;
  padding-left: 12px;
  box-shadow: 0 0 25px rgba(99,102,241,0.3), inset 0 0 25px rgba(99,102,241,0.08);
}
.nav-item .chev { margin-left: auto; color: var(--text-mute); font-size: 11px; }
.nav-item .ico { width: 20px; text-align: center; font-size: 14px; }

/* ---------- Main ---------- */
.main {
  flex: 1;
  padding: 28px 32px;
  max-width: 1200px;
  position: relative;
  background: var(--bg);
}


/* ---------- Card ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card h1 { font-size: 24px; font-weight: 700; }
.card .subtitle { color: var(--text-dim); font-size: 14px; margin-top: 6px; margin-bottom: 20px; }

/* ---------- Category pills ---------- */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #131720;
  border: 1px solid #1e293b;
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: all .12s ease;
}
.pill:hover { color: var(--text); border-color: #334155; }
.pill.active {
  background: #6366f1;
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(99,102,241,0.4), 0 0 40px rgba(99,102,241,0.1);
}
.pill .g { color: var(--text-mute); font-size: 11px; }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s ease;
}
.btn-blue { background: #6366f1; color: #fff; box-shadow: 0 0 15px rgba(99,102,241,0.3), inset 0 1px 0 rgba(255,255,255,0.1); }
.btn-blue:hover { background: #818cf8; box-shadow: 0 0 25px rgba(99,102,241,0.5), 0 0 50px rgba(99,102,241,0.2); }
.btn-green { background: #10b981; color: #fff; box-shadow: 0 0 15px rgba(16,185,129,0.3), inset 0 1px 0 rgba(255,255,255,0.1); }
.btn-green:hover { background: #34d399; box-shadow: 0 0 25px rgba(16,185,129,0.5), 0 0 50px rgba(16,185,129,0.2); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: #6366f1; box-shadow: 0 0 15px rgba(99,102,241,0.15); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-purple { background: #6366f1; color: #fff; box-shadow: 0 0 15px rgba(99,102,241,0.3), inset 0 1px 0 rgba(255,255,255,0.1); }
.btn-purple:hover { background: #818cf8; box-shadow: 0 0 25px rgba(99,102,241,0.5), 0 0 50px rgba(99,102,241,0.2); }

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 8px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%;
  background: #131720;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.2), 0 0 25px rgba(99,102,241,0.2); }
.textarea { resize: vertical; min-height: 100px; }

/* ---------- Storefront ---------- */
.hero {
  text-align: center;
  padding: 30px 0 36px;
  position: relative;
}
.hero h1 {
  font-size: 38px;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 8px;
}
.hero p {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 500px;
  margin: 0 auto;
}

/* Server info banner */
.server-banner {
  background: rgba(19, 23, 32, 0.6);
  border: 1px solid #1e293b;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.server-info-left { display: flex; align-items: center; gap: 16px; }
.server-info-left .icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: grid; place-items: center;
  font-size: 26px;
  box-shadow: 0 0 25px rgba(99,102,241,0.4), 0 0 50px rgba(99,102,241,0.1);
}
.server-info-left .text h3 { font-size: 17px; font-weight: 700; }
.server-info-left .text p { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.server-info-right { display: flex; align-items: center; gap: 12px; }
.discord-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s ease;
  box-shadow: 0 0 25px rgba(88,101,242,0.4), 0 0 50px rgba(88,101,242,0.15);
}
.discord-link:hover { background: #4752C4; filter: none; transform: none; text-decoration: none; box-shadow: 0 0 40px rgba(88,101,242,0.6), 0 0 80px rgba(88,101,242,0.25); }
.ip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #131720;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .15s ease;
}
.ip-btn:hover { background: #1a1f2a; color: var(--text); border-color: #334155; }
.ip-btn .ip { font-family: monospace; color: var(--blue); font-weight: 600; }

/* ---------- Product Grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.product-card {
  background: #131720;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 0 15px rgba(99,102,241,0.1);
}
.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #6366f1;
  opacity: 0;
  transition: opacity .2s ease;
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: #6366f1;
  box-shadow: 0 0 30px rgba(99,102,241,0.35), 0 0 60px rgba(99,102,241,0.1), 0 8px 32px rgba(0,0,0,0.4);
}
.product-card:hover::before { opacity: 1; }
.product-card .pimg {
  width: 100%;
  height: 130px;
  border-radius: 0;
  overflow: hidden;
  background: #0f1319;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.product-card .pimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card .pimg-icon {
  font-size: 44px;
  opacity: 0.4;
}
.product-card .ptitle {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.product-card .pdesc {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
  flex: 1;
}
.product-card .price {
  font-size: 22px;
  font-weight: 800;
  color: var(--green);
  text-shadow: 0 0 20px rgba(52,211,153,0.5), 0 0 40px rgba(52,211,153,0.15);
}
.product-card .price small { font-size: 12px; color: var(--text-mute); font-weight: 500; }
.product-card .buy {
  margin-top: 8px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: all .2s;
  box-shadow: 0 0 20px rgba(99,102,241,0.35), 0 0 40px rgba(99,102,241,0.1);
}
.product-card .buy:hover { background: #818cf8; box-shadow: 0 0 30px rgba(99,102,241,0.5), 0 0 60px rgba(99,102,241,0.2); }
.product-card .buy:disabled { background: #1e293b; color: var(--text-mute); cursor: not-allowed; box-shadow: none; }
.stock { font-size: 11px; color: var(--text-mute); }
.stock.ok { color: var(--green); }
.stock.out { color: var(--red); }

/* ---------- Rules Section ---------- */
.rules-section {
  background: #131720;
  border: 1px solid #1e293b;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 32px;
}
.rules-section h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rules-section ul { list-style: none; padding: 0; }
.rules-section li {
  position: relative;
  padding: 10px 0 10px 20px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
  border-bottom: 1px solid #1e293b;
}
.rules-section li:last-child { border-bottom: none; }
.rules-section li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #6366f1;
  font-weight: 700;
  font-size: 14px;
}
.rules-section li strong { color: var(--text); }

/* ---------- Delivery Note ---------- */
.delivery-note {
  margin-top: 24px;
  background: #131720;
  border: 1px solid #1e293b;
  border-left: 3px solid #6366f1;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  color: var(--text-mute);
  font-size: 12px;
  padding: 32px 0 48px;
  border-top: 1px solid #1e293b;
  margin-top: 32px;
}

/* ---------- Owners Section ---------- */
.owners-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(19, 23, 32, 0.6);
  border-radius: var(--radius);
  border: 1px solid #1e293b;
}
.owner-card {
  display: flex;
  align-items: center;
  gap: 12px;
}
.owner-card img {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px !important;
  max-height: 40px !important;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #334155;
  flex-shrink: 0;
}
.owner-card .name { font-size: 13px; font-weight: 600; color: #f1f5f9; }
.owner-card .role { font-size: 10px; color: var(--text-mute); }

/* ---------- Copied Toast ---------- */
.copied-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #6366f1;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 999;
  opacity: 0;
  transition: opacity .2s;
  box-shadow: 0 0 25px rgba(99,102,241,0.4), 0 0 50px rgba(99,102,241,0.1);
}
.copied-toast.show { opacity: 1; box-shadow: 0 0 30px rgba(99,102,241,0.5); }

/* ---------- Login Gate ---------- */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.gate .card { width: 420px; max-width: 92vw; text-align: center; }
.gate h1 { font-size: 22px; margin-bottom: 6px; }
.gate p { color: var(--text-mute); font-size: 14px; margin-bottom: 20px; }

/* ---------- Mobile Menu Toggle ---------- */
.menu-toggle {
  display: none;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle:hover { background: #334155; }

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}
.sidebar-overlay.show { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .menu-toggle { display: flex; }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 52px;
    height: calc(100vh - 52px);
    z-index: 95;
    transition: left 0.25s ease;
    width: 260px;
    background: #0d1017;
    border-right: 1px solid #1e293b;
    padding: 10px 8px;
  }
  .sidebar.open { left: 0; box-shadow: 4px 0 30px rgba(0,0,0,0.5); }
  .sidebar .profile { padding: 10px; gap: 10px; margin-bottom: 10px; }
  .sidebar .profile .avatar { width: 36px; height: 36px; }
  .sidebar .profile .name { font-size: 13px; }
  .sidebar .nav-item { padding: 8px 12px; font-size: 12px; margin-bottom: 2px; }
  .sidebar .nav-section { padding: 10px 8px 4px; font-size: 9px; }

  /* Topbar compact */
  .topbar { height: 52px; padding: 0 12px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand-logo { width: 28px; height: 28px; font-size: 14px; }
  .topbar-right { gap: 8px; }
  .btn-green-pill { padding: 6px 10px; font-size: 11px; }
  .avatar { width: 30px; height: 30px; font-size: 11px; border-width: 1px; }

  /* Main compact */
  .main {
    padding: 12px 10px;
    width: 100%;
  }

  /* Hero compact */
  .hero { padding: 16px 0 20px; }
  .hero h1 { font-size: 22px; line-height: 1.2; }
  .hero p { font-size: 13px; max-width: 100%; }

  /* Feature cards compact */
  .feature-cards { gap: 8px; margin-bottom: 16px; }
  .feature-card { min-width: 140px; padding: 10px; gap: 8px; }
  .feature-card .icon { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
  .feature-card .text h4 { font-size: 12px; }
  .feature-card .text p { font-size: 10px; }

  /* Server banner compact */
  .server-banner { flex-direction: column; text-align: center; padding: 14px; gap: 12px; }
  .server-info-left { flex-direction: column; gap: 8px; }
  .server-info-left .icon { width: 44px; height: 44px; font-size: 22px; }
  .server-info-left .text h3 { font-size: 15px; }
  .server-info-left .text p { font-size: 11px; }
  .server-info-right { flex-direction: column; width: 100%; gap: 8px; }
  .discord-link, .ip-btn { width: 100%; justify-content: center; padding: 10px 14px; font-size: 13px; }

  /* Owners compact */
  .owners-section { flex-direction: row; gap: 12px; padding: 10px; }
  .owner-card { gap: 8px; }
  .owner-card img { width: 32px !important; height: 32px !important; min-width: 32px !important; min-height: 32px !important; max-width: 32px !important; max-height: 32px !important; }
  .owner-card .name { font-size: 12px; }
  .owner-card .role { font-size: 10px; }

  /* Product grid - 2 columns */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .product-card { padding: 10px; gap: 6px; }
  .product-card .ptitle { font-size: 12px; gap: 6px; }
  .product-card .pdesc { font-size: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
  .product-card .price { font-size: 16px; }
  .product-card .buy { padding: 8px; font-size: 11px; }

  /* Pills compact */
  .pills { gap: 6px; margin-bottom: 12px; }
  .pill { padding: 6px 10px; font-size: 11px; border-radius: 6px; }

  /* Cards compact */
  .card { padding: 12px; }
  .card h1 { font-size: 18px; }
  .card .subtitle { font-size: 12px; margin-bottom: 12px; }

  /* Rules */
  .rules-section { padding: 14px; margin-top: 16px; }
  .rules-section h3 { font-size: 14px; }
  .rules-section li { padding: 6px 0 6px 16px; font-size: 12px; }

  /* Delivery note */
  .delivery-note { margin-top: 16px; padding: 10px 14px; font-size: 12px; }

  /* Footer */
  .footer { padding: 20px 0 32px; font-size: 11px; margin-top: 20px; }

  /* Cart compact */
  .cart-drawer { width: 100%; max-width: 100%; }
  .cart-item { padding: 10px; gap: 8px; }
  .cart-item-title { font-size: 13px; }
  .cart-item-price { font-size: 13px; }
}

/* Extra small phones */
@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .product-card { padding: 0; gap: 0; border-radius: 10px; overflow: hidden; }
  .product-card .ptitle { font-size: 13px; gap: 6px; }
  .product-card .buy { width: 100%; margin-top: 0; padding: 10px; }
  .hero h1 { font-size: 20px; }
  .hero p { font-size: 12px; }
  .topbar-right .btn-green-pill span { display: none; }
  .feature-cards { flex-direction: column; }
  .feature-card { min-width: auto; }
  .owners-section { flex-direction: column; gap: 8px; }
  .owner-card img { width: 28px !important; height: 28px !important; min-width: 28px !important; min-height: 28px !important; max-width: 28px !important; max-height: 28px !important; }
}

/* Touch-friendly targets */
@media (hover: none) and (pointer: coarse) {
  .product-card .buy { min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .pill { min-height: 36px; }
  .discord-link, .ip-btn { min-height: 44px; }
  .nav-item { min-height: 44px; }
}

/* Large desktops */
@media (min-width: 1400px) {
  .main { max-width: 1400px; }
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Cart Button ---------- */
.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background .15s;
}
.cart-btn:hover { background: #1e293b; box-shadow: 0 0 10px rgba(99,102,241,0.15); }
.cart-icon { font-size: 20px; color: #94a3b8; }
.cart-badge {
  position: absolute;
  top: 2px;
  right: 0;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  box-shadow: 0 0 12px rgba(239,68,68,0.5), 0 0 25px rgba(239,68,68,0.2);
}
.cart-badge:empty, .cart-badge[data-count="0"] { display: none; }

/* ---------- Cart Drawer ---------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 92vw;
  height: 100vh;
  background: #0f1319;
  border-left: 1px solid #1e293b;
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: right .25s ease;
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
}
.cart-drawer.open { right: 0; }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #1e293b;
}
.cart-header h3 { font-size: 15px; font-weight: 700; color: #f1f5f9; margin: 0; }
.cart-close {
  background: none;
  border: none;
  color: var(--text-mute);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .15s;
}
.cart-close:hover { background: #1e293b; color: #f1f5f9; }

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-mute);
}

.cart-items { display: flex; flex-direction: column; gap: 10px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #131720;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title { font-size: 13px; font-weight: 600; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-type { font-size: 10px; color: var(--text-mute); margin-top: 2px; }
.cart-item-price { font-size: 14px; font-weight: 700; color: var(--green); white-space: nowrap; }
.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-mute);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}
.cart-item-remove:hover { color: #ef4444; }

.cart-footer {
  border-top: 1px solid #1e293b;
  padding: 16px 20px;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}
.cart-total span:last-child { color: var(--green); font-size: 18px; }
.cart-checkout-btn {
  width: 100%;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 0 25px rgba(16,185,129,0.4), 0 0 50px rgba(16,185,129,0.1);
}
.cart-checkout-btn:hover { background: #34d399; box-shadow: 0 0 30px rgba(16,185,129,0.5), 0 0 60px rgba(16,185,129,0.2); }

/* Cart button on product cards */
.product-card .add-cart {
  width: 100%;
  background: #131720;
  color: #94a3b8;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  margin-top: 6px;
  box-shadow: 0 0 8px rgba(99,102,241,0.1);
}
.product-card .add-cart:hover { background: #1a1f2a; color: #e2e8f0; border-color: #334155; box-shadow: 0 0 10px rgba(99,102,241,0.15); }
.product-card .add-cart.added { background: #10b981; color: #fff; border-color: #10b981; box-shadow: 0 0 12px rgba(16,185,129,0.3); }

/* ---------- Mobile Bottom Nav ---------- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #0d1017;
  border-top: 1px solid #1e293b;
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  backdrop-filter: blur(20px);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mbn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-mute);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all .15s;
  min-width: 60px;
}
.mbn-item:hover { text-decoration: none; color: var(--text); }
.mbn-item.active { color: var(--blue); }
.mbn-icon { font-size: 18px; }
.mbn-label { font-size: 10px; font-weight: 500; }

@media (max-width: 860px) {
  .mobile-bottom-nav { display: flex; }
  body { padding-bottom: 66px; }
}

/* ---------- Touch Improvements ---------- */
@media (hover: none) and (pointer: coarse) {
  .product-card:hover { transform: none; }
  .product-card:hover::before { opacity: 0; }
  .nav-item:hover { background: transparent; }
  .pill:hover { border-color: #1e293b; }
  .btn:hover { filter: none; }
}

/* ---------- Table & Action Buttons ---------- */
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #1e293b; }
.table-wrap th { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.table-wrap td { color: var(--text); }
.table-wrap tr:hover td { background: rgba(99,102,241,0.04); }

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.icon-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
  box-shadow: 0 0 8px rgba(99,102,241,0.08);
}
.icon-btn:hover {
  background: #334155;
  color: #f1f5f9;
  box-shadow: 0 0 20px rgba(99,102,241,0.3);
}
.icon-btn.danger:hover {
  background: rgba(239,68,68,0.2);
  color: #f87171;
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #334155;
  border-radius: 20px;
  transition: .2s;
}
.switch .track::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.switch input:checked + .track { background: #6366f1; box-shadow: 0 0 15px rgba(99,102,241,0.5), 0 0 30px rgba(99,102,241,0.15); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* Type badges */
.type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.type-badge.lifetime { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.type-badge.monthly { background: rgba(59,130,246,0.15); color: #93c5fd; }
.type-badge.onetime { background: rgba(234,179,8,0.15); color: #fde047; }

/* Pill edit buttons */
.pill-edit {
  background: transparent;
  border: none;
  color: var(--text-mute);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all .12s;
}
.pill-edit:hover { color: var(--text); background: #1e293b; }
.pill-add {
  background: #6366f1;
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  box-shadow: 0 0 15px rgba(99,102,241,0.4);
}
.pill-add:hover { background: #818cf8; box-shadow: 0 0 20px rgba(99,102,241,0.5); }

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #131720;
  border: 1px solid #6366f1;
  border-radius: var(--radius);
  padding: 28px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 50px rgba(99,102,241,0.3), 0 0 100px rgba(99,102,241,0.1), 0 20px 60px rgba(0,0,0,0.5);
}
.modal h2 { font-size: 18px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.checkline { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

/* Editor */
.editor-head { margin-top: 24px; margin-bottom: 8px; }
.editor-head h3 { font-size: 14px; font-weight: 600; }
.editor-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: #131720;
  border: 1px solid #1e293b;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  flex-wrap: wrap;
}
.editor-toolbar button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.editor-toolbar button:hover { background: #1e293b; color: var(--text); }
.editor-toolbar .sep { width: 1px; background: #1e293b; margin: 4px 6px; }
.editor-area {
  width: 100%;
  min-height: 100px;
  background: #131720;
  border: 1px solid #1e293b;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--text);
  padding: 12px;
  font-size: 14px;
  resize: vertical;
}
.editor-area:focus { border-color: #6366f1; outline: none; }

/* Toast */
toast, #toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #6366f1;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#toast.show { opacity: 1; box-shadow: 0 0 20px rgba(99,102,241,0.4); }
#toast.error { background: #ef4444; box-shadow: 0 0 20px rgba(239,68,68,0.4); }

/* ---------- Print Styles ---------- */
@media print {
  .sidebar, .topbar, .menu-toggle { display: none !important; }
  .main { padding: 0; max-width: 100%; }
  body { background: #fff; color: #000; }
}

/* ---------- Login Modal Mobile ---------- */
@media (max-width: 480px) {
  .login-modal .card {
    padding: 24px 20px;
    width: 95%;
    border-radius: 12px;
  }
  .login-modal .logo { font-size: 48px; margin-bottom: 12px; }
  .login-modal h1 { font-size: 22px; margin-bottom: 6px; }
  .login-modal p { font-size: 13px; margin-bottom: 20px; }
  .login-modal .discord-btn { padding: 14px 24px; font-size: 15px; border-radius: 10px; }
  .login-modal .subtext { font-size: 11px; margin-top: 12px; }
}

/* ---------- Admin Mobile ---------- */
@media (max-width: 860px) {
  .admin-layout { flex-direction: column; }
  .admin-layout .sidebar { position: static; width: 100%; height: auto; }
  .table-wrap { font-size: 12px; }
  .table-wrap th, .table-wrap td { padding: 8px 6px; }
  .row-actions { gap: 4px; }
  .icon-btn { width: 28px; height: 28px; font-size: 12px; }
  .modal { padding: 20px; width: 95vw; }
  .modal h2 { font-size: 16px; }
  .row2, .row3 { grid-template-columns: 1fr; }
}
