:root {
  --bg: #0a0a0f;
  --bg-soft: #111017;
  --card: #17121f;
  --card-2: #1e1828;
  --accent: #ff60ea;
  --accent-2: #b23bff;
  --text: #f4f2f7;
  --text-muted: #9d98a8;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { text-decoration: none; color: inherit; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.page { padding: 32px 20px 64px; }

/* Header */
.site-header {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text);
}

.logo span { color: var(--accent); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.main-nav a:hover { color: var(--text); }
.main-nav a.active { color: var(--text); position: relative; }
.main-nav a.active::after {
  content: '';
  position: absolute;
  right: 0; left: 0;
  bottom: -22px;
  height: 2px;
  background: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 18px;
}

.badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: var(--accent);
  color: #17001a;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Hero */
.hero {
  padding: 72px 20px 48px;
  text-align: center;
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(255, 96, 234, 0.14), transparent 70%),
    var(--bg);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 96, 234, 0.35);
  background: rgba(255, 96, 234, 0.08);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 24px;
}

.hero-badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  font-size: 44px;
  line-height: 1.3;
  margin: 0 0 6px;
  font-weight: 900;
}

.hero h1 .hero-brand {
  display: block;
  font-size: 52px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: 6px;
}

.hero p.hero-sub {
  max-width: 640px;
  margin: 20px auto 32px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.btn-outline {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 14px 26px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #17001a;
  border-radius: 999px;
  padding: 14px 26px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.hero-stats span { display: inline-flex; align-items: center; gap: 6px; }

/* Section */
.section-title {
  font-size: 26px;
  font-weight: 900;
  margin: 0 0 6px;
  text-align: center;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

.section-wrap { padding: 56px 20px; }
.section-wrap.alt { background: var(--bg-soft); }

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 20px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.search-box::placeholder { color: var(--text-muted); }

.count-pill { color: var(--text-muted); font-size: 13px; }

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, border-color .15s ease;
}

.product-card:hover { transform: translateY(-4px); border-color: rgba(255,96,234,0.4); }

.product-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--card-2), var(--accent-2));
  overflow: hidden;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.thumb-placeholder span {
  font-size: 42px;
  font-weight: 900;
  color: rgba(23,0,26,0.85);
}

.thumb-placeholder.large span { font-size: 72px; }

.product-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-title h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.4;
}

.price {
  margin: 0;
  color: var(--accent);
  font-weight: 800;
  font-size: 15px;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.icon-square-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
}

.icon-square-btn.cart-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #17001a;
}

.btn-add, .btn-buy-now, .btn-checkout, .btn-logout, .btn-small, .btn-discord {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  display: inline-block;
}

.btn-add {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-add:hover { border-color: var(--accent); }

.btn-buy-now {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #17001a;
}

.btn-checkout {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #17001a;
  width: 100%;
  padding: 14px;
  font-size: 16px;
}

.btn-checkout.small { width: auto; padding: 10px 20px; font-size: 14px; }

.btn-discord {
  background: #5865F2;
  color: #fff;
  padding: 14px 28px;
  font-size: 16px;
  margin-top: 20px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state a { color: var(--accent); font-weight: 700; }

/* Product detail */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 40px;
}

.product-detail-image {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  border: 1px solid var(--border);
}

.product-detail-image img { width: 100%; height: 100%; object-fit: cover; }

.fast-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,96,234,0.1);
  border: 1px solid rgba(255,96,234,0.3);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}

.product-detail-info h1 { margin: 0 0 8px; font-size: 28px; }

.badge-category {
  display: inline-block;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.price-large { font-size: 30px; font-weight: 900; color: var(--accent); margin: 10px 0; }

.description { color: var(--text-muted); line-height: 1.9; margin-bottom: 24px; }

.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.detail-actions .btn-add, .detail-actions .btn-buy-now { flex: 1; min-width: 160px; }

.feature-list {
  list-style: none;
  margin: 0;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.feature-list li .f-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(255,96,234,0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

/* Cart */
.cart-items { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
}

.cart-item img, .cart-item .thumb-placeholder {
  width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
}

.cart-item .thumb-placeholder span { font-size: 22px; }

.cart-item-info { flex: 1; }
.cart-item-info .name { font-weight: 700; margin: 0 0 4px; }
.cart-item-info .unit-price { color: var(--text-muted); font-size: 13px; margin: 0; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-2);
  border-radius: 999px;
  padding: 4px 8px;
}

.qty-control button {
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
}

.remove-btn {
  border: none;
  background: transparent;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.cart-summary, .checkout-summary {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  margin-bottom: 16px;
}

/* Checkout */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}

.checkout-form, .login-box, .product-form {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkout-form label, .login-box label, .product-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
}

input, textarea {
  font-family: inherit;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  font-size: 14px;
  width: 100%;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input:focus, textarea:focus { outline: 2px solid var(--accent); }

.checkout-summary-item { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--border); }

/* Order success */
.success-box {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 24px;
  border: 1px solid var(--border);
}

.success-icon { font-size: 48px; margin-bottom: 12px; }
.success-box .note { color: var(--text-muted); font-size: 13px; margin-top: 16px; }

/* Admin */
.admin-login { display: flex; justify-content: center; align-items: center; min-height: 70vh; }
.login-box { width: 100%; max-width: 380px; }
.login-box h1 { font-size: 18px; text-align: center; margin-bottom: 8px; }
.brand-accent { color: var(--accent); }
.back-link { text-align: center; color: var(--text-muted); font-size: 13px; }

.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.btn-logout { background: var(--card-2); color: var(--text); border: 1px solid var(--border); }

.admin-stats { display: flex; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  min-width: 120px;
}
.stat-number { font-size: 26px; font-weight: 900; color: var(--accent); }
.stat-label { color: var(--text-muted); font-size: 13px; }
.stat-link { justify-content: center; align-items: center; color: var(--accent); font-weight: 700; }

.admin-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.admin-table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--border); font-size: 14px; }
.admin-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.admin-thumb.thumb-placeholder { display: flex; align-items: center; justify-content: center; }
.admin-thumb.thumb-placeholder span { font-size: 16px; }
.row-actions { display: flex; gap: 8px; }
.btn-small { padding: 6px 14px; border-radius: 8px; background: var(--card-2); color: var(--text); font-size: 13px; font-weight: 700; border: 1px solid var(--border); cursor: pointer; }
.btn-danger { background: rgba(255,107,107,0.12); color: #ff6b6b; border-color: rgba(255,107,107,0.3); }

.order-items-list { margin: 0; padding-inline-start: 18px; font-size: 13px; }

.current-image-note { font-size: 13px; color: var(--text-muted); margin-bottom: -8px; }
.admin-thumb-preview { width: 100px; height: 100px; object-fit: cover; border-radius: 10px; }

.alert-error {
  background: rgba(255,107,107,0.12);
  color: #ff8a8a;
  border: 1px solid rgba(255,107,107,0.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-weight: 700;
}

.site-footer { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--border); }

@media (max-width: 720px) {
  .product-detail { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .hero h1 .hero-brand { font-size: 38px; }
  .main-nav { display: none; }
}
