:root {
  --bg: #0d1117;
  --bg2: #131a24;
  --card: #171e2a;
  --card-hover: #1e2839;
  --border: #26303f;
  --accent: #66c0f4;
  --accent2: #3b82f6;
  --green: #5cb85c;
  --text: #d7dde8;
  --text-dim: #8b96a8;
  --price: #f0b429;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,17,23,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; gap: 32px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent2), #1d4ed8);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: #fff;
}
.logo-text { font-weight: 800; font-size: 18px; color: #fff; letter-spacing: 1px; }
.logo-text em { font-style: normal; color: var(--accent); margin-left: 6px; font-size: 13px; }

.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav-link {
  color: var(--text-dim); text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; white-space: nowrap; transition: .15s;
}
.nav-link:hover { color: var(--text); background: var(--card); }
.nav-link.active { color: var(--accent); background: rgba(102,192,244,.1); }

.header-right { display: flex; align-items: center; gap: 12px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; color: var(--text-dim);
}
.search-box input {
  background: none; border: none; outline: none; color: var(--text);
  font-family: inherit; font-size: 13px; width: 180px;
}
.cart-btn {
  position: relative; background: var(--card); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 9px 12px; cursor: pointer;
  display: flex; align-items: center; transition: .15s;
}
.cart-btn:hover { border-color: var(--accent); color: var(--accent); }
#cartCount {
  position: absolute; top: -6px; right: -6px;
  background: var(--accent2); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(ellipse at 50% -20%, rgba(59,130,246,.25), transparent 60%),
    linear-gradient(180deg, #10151f, var(--bg));
  border-bottom: 1px solid var(--border);
  padding: 64px 24px 56px; text-align: center;
}
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 20px;
  background: rgba(102,192,244,.12); color: var(--accent);
  font-size: 12px; font-weight: 700; letter-spacing: 2px; margin-bottom: 20px;
}
.hero h1 { font-size: 42px; font-weight: 800; color: #fff; margin-bottom: 14px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-dim); font-size: 15px; line-height: 1.6; }

/* ---------- Grid ---------- */
.container { max-width: 1400px; margin: 0 auto; padding: 40px 24px 60px; flex: 1; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s;
  display: flex; flex-direction: column;
}
.card:hover {
  transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.card-img { position: relative; aspect-ratio: 4/3; background: var(--bg2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-tag {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--accent);
}
.card-tag.hot { color: #ff6b6b; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-name { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.35; min-height: 38px; }
.card-cat { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-price { font-size: 16px; font-weight: 800; color: var(--price); }
.btn-buy {
  background: linear-gradient(135deg, var(--accent2), #2563eb);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn-buy:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-buy:active { transform: translateY(0); }
.btn-buy-lg { width: 100%; padding: 13px; font-size: 14px; }
.empty { text-align: center; color: var(--text-dim); padding: 80px 0; font-size: 16px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  max-width: 720px; width: 100%; max-height: 90vh; overflow: auto;
  display: grid; grid-template-columns: 1fr 1fr; position: relative;
  animation: pop .2s ease;
}
.modal-sm { grid-template-columns: 1fr; max-width: 440px; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: rgba(0,0,0,.5); color: #fff; font-size: 15px; cursor: pointer;
}
.modal-close:hover { background: rgba(255,60,60,.6); }
.modal-img { background: var(--bg2); }
.modal-img img { width: 100%; height: 100%; object-fit: cover; min-height: 280px; }
.modal-body { padding: 32px 28px; display: flex; flex-direction: column; gap: 14px; }
.modal-cat { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }
.modal-body h2 { font-size: 24px; font-weight: 800; color: #fff; line-height: 1.3; }
.modal-desc { color: var(--text-dim); font-size: 13px; line-height: 1.6; flex: 1; }
.modal-price { font-size: 28px; font-weight: 800; color: var(--price); }
.modal-note { font-size: 11px; color: var(--text-dim); text-align: center; }
.order-items { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.order-item { display: flex; justify-content: space-between; font-size: 13px; color: var(--text); }
.btn-discord {
  display: block; text-align: center; background: #5865f2; color: #fff;
  text-decoration: none; border-radius: 10px; padding: 13px; font-weight: 700; font-size: 14px;
}
.btn-discord:hover { filter: brightness(1.1); }

/* ---------- Drawer ---------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.5);
}
.drawer {
  position: fixed; top: 0; right: -420px; bottom: 0; z-index: 160;
  width: 400px; max-width: 92vw; background: var(--card);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: right .25s ease;
}
.drawer.open { right: 0; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { color: #fff; font-size: 18px; }
.drawer-items { flex: 1; overflow-y: auto; padding: 14px 22px; display: flex; flex-direction: column; gap: 10px; }
.cart-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border-radius: 10px; padding: 10px 12px;
}
.cart-row img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.cart-row .info { flex: 1; min-width: 0; }
.cart-row .name { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-row .price { font-size: 12px; color: var(--price); font-weight: 700; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); cursor: pointer; font-size: 13px;
}
.qty span { font-size: 13px; font-weight: 600; min-width: 20px; text-align: center; }
.cart-remove { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; padding: 4px; }
.cart-remove:hover { color: #ff6b6b; }
.drawer-empty { color: var(--text-dim); text-align: center; padding: 60px 0; font-size: 14px; }
.drawer-foot { padding: 20px 22px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.drawer-total { display: flex; justify-content: space-between; align-items: center; font-size: 15px; color: var(--text-dim); }
.drawer-total strong { font-size: 22px; color: var(--price); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 24px; text-align: center; color: var(--text-dim); font-size: 12px; }
.footer-sep { margin: 0 10px; opacity: .4; }

@media (max-width: 760px) {
  .modal { grid-template-columns: 1fr; }
  .modal-img { max-height: 240px; }
  .modal-img img { min-height: 0; height: 240px; }
  .hero h1 { font-size: 28px; }
  .nav { display: none; }
}

.field { width:100%; background:var(--bg); border:1px solid var(--border); border-radius:8px; color:var(--text); padding:11px 14px; font-size:14px; font-family:inherit; outline:none; margin-bottom:12px; }
.field:focus { border-color:var(--accent); }
.field.err { border-color:#e5534b; }
