:root {
  --bg: #0b0e14;
  --bg-elevated: #12161f;
  --bg-card: #161b26;
  --border: #232938;
  --text: #e8ecf4;
  --text-dim: #8b93a7;
  --primary: #6c5ce7;
  --primary-hover: #7d6ff2;
  --accent: #00d9a3;
  --danger: #ff5c6c;
  --warning: #ffb545;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --max-width: 1080px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-size: 1rem; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,14,20,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand { font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--text-dim); font-size: .92rem; transition: color .15s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.cart-badge {
  background: var(--primary); color: #fff; font-size: .68rem; font-weight: 700;
  border-radius: 999px; padding: 1px 6px; margin-left: 4px; vertical-align: middle;
}

/* Layout */
.section { padding: 32px 0; }
.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 { font-size: 1.9rem; margin: 0 0 8px; }
.hero p { color: var(--text-dim); margin: 0 auto; max-width: 480px; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.card:hover { border-color: #33405c; }
.product-card { display: flex; flex-direction: column; height: 100%; }
.product-thumb {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--bg-elevated);
}
.product-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-size: .92rem; font-weight: 600; }
.product-price { color: var(--accent); font-weight: 700; margin-top: auto; }
.product-stock { font-size: .75rem; color: var(--text-dim); }
.badge { display: inline-block; font-size: .68rem; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.badge-out { background: rgba(255,92,108,.15); color: var(--danger); }
.badge-ok { background: rgba(0,217,163,.15); color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: var(--radius-sm); border: none;
  font-weight: 600; font-size: .92rem; cursor: pointer; transition: background .15s, opacity .15s;
  width: 100%;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: #3a4358; }
.btn-danger { background: rgba(255,92,108,.15); color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: .82rem; width: auto; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .85rem; color: var(--text-dim); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text); padding: 11px 12px; border-radius: var(--radius-sm); outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); }
.field textarea { resize: vertical; min-height: 90px; font-family: monospace; }

/* Utility */
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

.alert {
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 16px;
}
.alert-error { background: rgba(255,92,108,.12); color: var(--danger); border: 1px solid rgba(255,92,108,.3); }
.alert-success { background: rgba(0,217,163,.12); color: var(--accent); border: 1px solid rgba(0,217,163,.3); }
.alert-warning { background: rgba(255,181,69,.12); color: var(--warning); border: 1px solid rgba(255,181,69,.3); }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin .8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 48px 16px; color: var(--text-dim); }

footer { border-top: 1px solid var(--border); padding: 24px 0; margin-top: 48px; color: var(--text-dim); font-size: .82rem; text-align: center; }

/* Detail / checkout / payment pages */
.detail-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .detail-grid { grid-template-columns: 1fr 1fr; } }
.qty-control { display: flex; align-items: center; gap: 10px; }
.qty-control button {
  width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-size: 1.1rem; cursor: pointer;
}
.qty-control span { min-width: 24px; text-align: center; font-weight: 600; }

.qris-box { text-align: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.qris-box img { max-width: 260px; margin: 0 auto; border-radius: var(--radius-sm); background: #fff; padding: 12px; }
.countdown { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .82rem; }
.status-pending { background: rgba(255,181,69,.15); color: var(--warning); }
.status-paid { background: rgba(0,217,163,.15); color: var(--accent); }
.status-expired, .status-failed, .status-cancelled { background: rgba(255,92,108,.15); color: var(--danger); }
.status-paid_no_stock { background: rgba(255,181,69,.15); color: var(--warning); }

.credential-box {
  background: var(--bg-elevated); border: 1px dashed var(--accent); border-radius: var(--radius-sm);
  padding: 14px; font-family: monospace; font-size: .88rem; white-space: pre-wrap; word-break: break-all;
}

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }

.cart-row { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.cart-row img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); }
.cart-row .info { flex: 1; min-width: 0; }
.cart-row .name { font-weight: 600; font-size: .92rem; }

@media print {
  .navbar, footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}
