/* NexStore Digital – Dark Theme CSS */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #09090b;
  --bg2:       #18181b;
  --bg3:       #27272a;
  --border:    #3f3f46;
  --border2:   #27272a;
  --text:      #fafafa;
  --text2:     #a1a1aa;
  --text3:     #71717a;
  --blue:      #3b82f6;
  --blue-dark: #1d4ed8;
  --indigo:    #6366f1;
  --emerald:   #10b981;
  --amber:     #f59e0b;
  --red:       #ef4444;
  --radius:    12px;
  --radius-sm: 8px;
  --font:      'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', monospace;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ── Navbar ────────────────────────────────────── */
.navbar {
  border-bottom: 1px solid var(--border2);
  background: rgba(9,9,11,.8);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; color: var(--text);
}
.nav-brand svg { color: var(--blue); }
.nav-tabs { display: flex; gap: 4px; background: var(--bg2); padding: 4px; border-radius: 10px; }
.nav-tab {
  padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--text2); transition: all .15s;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active { background: var(--bg3); color: var(--text); }

/* ── Layout ────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
main { flex: 1; }
.page { padding: 48px 0; }

/* ── Hero ──────────────────────────────────────── */
.hero {
  border: 1px solid var(--border2);
  background: linear-gradient(135deg, rgba(24,24,27,.6), rgba(9,9,11,1), rgba(24,24,27,.2));
  border-radius: 24px; padding: 64px 48px; text-align: center;
  position: relative; overflow: hidden; margin-bottom: 64px;
}
.hero-glow-l { position:absolute; top:0; left:25%; width:288px; height:288px; background:rgba(59,130,246,.08); border-radius:50%; filter:blur(100px); pointer-events:none; }
.hero-glow-r { position:absolute; bottom:0; right:25%; width:288px; height:288px; background:rgba(99,102,241,.08); border-radius:50%; filter:blur(100px); pointer-events:none; }
.hero-content { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(30,58,138,.4); border: 1px solid rgba(37,99,235,.25);
  color: #60a5fa; font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 4px 12px; border-radius: 99px; margin-bottom: 24px;
}
.hero h1 { font-size: clamp(2rem,5vw,3rem); font-weight: 800; line-height: 1.15; color: var(--text); margin-bottom: 16px; }
.hero h1 span { background: linear-gradient(90deg,#60a5fa,#818cf8,#6366f1); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.hero p { font-size: 15px; color: var(--text2); line-height: 1.7; margin-bottom: 32px; }
.hero-usps { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; padding-top: 24px; border-top: 1px solid var(--border2); max-width: 380px; margin: 0 auto; }
.usp { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.usp-icon { font-size: 20px; }
.usp span { font-size: 11px; font-weight: 600; color: var(--text2); }

/* ── Category Filters ──────────────────────────── */
.catalog-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; border-bottom: 1px solid var(--border2); padding-bottom: 20px; margin-bottom: 32px; }
.catalog-title h2 { font-size: 20px; font-weight: 700; }
.catalog-title p { font-size: 12px; color: var(--text3); margin-top: 2px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 6px; background: rgba(24,24,27,.6); padding: 4px; border-radius: 14px; border: 1px solid rgba(63,63,70,.4); }
.filter-tab {
  padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--text2); cursor: pointer; border: none; background: transparent;
  transition: all .15s;
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active { background: var(--bg3); color: var(--text); }

/* ── Product Grid ──────────────────────────────── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 24px; }
.product-card {
  border: 1px solid var(--border2); border-radius: 16px;
  background: rgba(24,24,27,.3); overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .2s, transform .2s;
}
.product-card:hover { border-color: var(--border); transform: translateY(-2px); }
.product-img { width: 100%; height: 180px; object-fit: cover; }
.product-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.product-cat { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; }
.product-title { font-size: 16px; font-weight: 700; color: var(--text); }
.product-desc { font-size: 13px; color: var(--text2); line-height: 1.6; flex: 1; }
.product-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-top: 1px solid var(--border2); }
.product-price { font-size: 22px; font-weight: 800; color: var(--text); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer; font-family: var(--font); font-weight: 600; border-radius: var(--radius-sm); transition: all .15s; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg,var(--blue),var(--indigo)); color: #fff; padding: 10px 18px; font-size: 13px; }
.btn-primary:hover { opacity: .9; transform: scale(.98); }
.btn-secondary { background: var(--bg3); color: var(--text2); padding: 8px 16px; font-size: 13px; border: 1px solid var(--border); }
.btn-secondary:hover { color: var(--text); border-color: var(--border2); }
.btn-danger { background: rgba(239,68,68,.15); color: var(--red); border: 1px solid rgba(239,68,68,.3); padding: 6px 12px; font-size: 12px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-success { background: rgba(16,185,129,.15); color: var(--emerald); border: 1px solid rgba(16,185,129,.3); padding: 6px 12px; font-size: 12px; }

/* ── Stats Cards ───────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card { border: 1px solid var(--border2); background: rgba(24,24,27,.4); border-radius: 16px; padding: 24px; display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-family: var(--mono); font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 6px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-icon-blue { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); }
.stat-icon-indigo { background: rgba(99,102,241,.1); border: 1px solid rgba(99,102,241,.3); }
.stat-icon-purple { background: rgba(168,85,247,.1); border: 1px solid rgba(168,85,247,.3); }

/* ── Tables ────────────────────────────────────── */
.table-wrap { border: 1px solid var(--border2); border-radius: 16px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: rgba(24,24,27,.3); }
th { padding: 12px 16px; text-align: left; font-family: var(--mono); font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border2); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid rgba(39,39,42,.6); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(24,24,27,.3); }

/* ── Badges ────────────────────────────────────── */
.badge-cat { display: inline-block; background: var(--bg3); border-radius: 6px; padding: 2px 8px; font-size: 11px; color: var(--text2); }
.badge-success { display: inline-flex; align-items: center; gap: 4px; background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: var(--emerald); padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-danger  { display: inline-flex; align-items: center; gap: 4px; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);  color: var(--red);     padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-warn    { display: inline-flex; align-items: center; gap: 4px; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: var(--amber);   padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-blue    { display: inline-flex; align-items: center; gap: 4px; background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: var(--blue);    padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }

/* ── Forms ─────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text2); }
.form-control {
  background: rgba(9,9,11,.5); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 10px 14px; font-family: var(--font); font-size: 13px;
  width: 100%; transition: border-color .15s; outline: none;
}
.form-control:focus { border-color: var(--blue); }
.form-control::placeholder { color: var(--text3); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; font-family: var(--mono); font-size: 12px; }
.form-hint { font-size: 11px; color: var(--text3); }

/* ── Card / Panel ──────────────────────────────── */
.card { border: 1px solid var(--border2); border-radius: 16px; background: rgba(24,24,27,.3); }
.card-header { padding: 16px 24px; border-bottom: 1px solid var(--border2); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 24px; }
.card-title { font-size: 15px; font-weight: 700; }

/* ── Modal ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(9,9,11,.85); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  width: 100%; max-width: 540px; border: 1px solid var(--border);
  border-radius: 20px; background: var(--bg2); box-shadow: 0 25px 60px rgba(0,0,0,.6);
  display: flex; flex-direction: column; max-height: 90vh;
}
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border2); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text3); cursor: pointer; padding: 6px; border-radius: 8px; transition: all .15s; }
.modal-close:hover { background: var(--bg3); color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border2); display: flex; gap: 12px; }
.modal-footer .btn { flex: 1; justify-content: center; }

/* ── Alert / Flash ─────────────────────────────── */
.flash { padding: 12px 20px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 13px; font-weight: 500; }
.flash-success { background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.3); color: var(--emerald); }
.flash-error   { background: rgba(239,68,68,.15);  border: 1px solid rgba(239,68,68,.3);  color: var(--red); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.alert-info   { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }

/* ── Sandbox toggle ────────────────────────────── */
.gateway-panel { border: 1px solid var(--border2); border-radius: 16px; padding: 20px 24px; background: rgba(24,24,27,.2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.toggle-wrap { display: flex; align-items: center; gap: 12px; }
.toggle-label { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; }
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--bg3); border-radius: 99px; cursor: pointer;
  transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--amber); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Toolbar row ───────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border2); padding-bottom: 20px; margin-bottom: 24px; }
.toolbar-left { display: flex; align-items: center; gap: 6px; background: var(--bg2); padding: 4px; border-radius: 12px; }
.tab-btn { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text2); background: none; border: none; cursor: pointer; transition: all .15s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--bg3); color: var(--text); }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.search-wrap { position: relative; }
.search-wrap input { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 8px 12px 8px 36px; font-size: 12px; width: 220px; outline: none; }
.search-wrap input:focus { border-color: var(--blue); }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 14px; pointer-events: none; }
.btn-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text2); cursor: pointer; transition: all .15s; text-decoration: none; }
.btn-icon:hover { color: var(--text); }

/* ── License key box ───────────────────────────── */
.key-box { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25); border-radius: 8px; padding: 12px 16px; font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--amber); letter-spacing: .05em; text-align: center; border-left: 4px solid var(--amber); }
.deliverable-box { background: rgba(9,9,11,.5); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.deliverable-box pre { font-family: var(--mono); font-size: 12px; color: #e2e8f0; white-space: pre-wrap; word-break: break-all; }

/* ── Empty state ───────────────────────────────── */
.empty { text-align: center; padding: 80px 20px; color: var(--text3); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty h3 { font-size: 15px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.empty p { font-size: 13px; }

/* ── Loading ───────────────────────────────────── */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--blue); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Delivery content panel ────────────────────── */
.delivery-panel { border: 1px solid var(--border2); border-radius: 12px; background: rgba(9,9,11,.5); overflow: hidden; }
.delivery-panel-header { padding: 10px 16px; background: rgba(39,39,42,.4); border-bottom: 1px solid var(--border2); display: flex; align-items: center; justify-content: space-between; }
.delivery-panel-header span { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; }
.delivery-panel pre { padding: 16px; font-family: var(--mono); font-size: 12px; color: #e2e8f0; white-space: pre-wrap; max-height: 160px; overflow-y: auto; }

/* ── Auth Gate ─────────────────────────────────── */
.auth-gate { max-width: 440px; margin: 80px auto; border: 1px solid var(--border); border-radius: 24px; background: linear-gradient(135deg,rgba(24,24,27,.6),rgba(9,9,11,1)); padding: 40px; text-align: center; }
.auth-gate h2 { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.auth-gate p  { font-size: 13px; color: var(--text2); line-height: 1.7; margin-bottom: 28px; }
.auth-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--bg3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; font-size: 26px; }

/* ── Divider ───────────────────────────────────── */
.divider { display: flex; align-items: center; gap: 12px; color: var(--text3); font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border2); }

/* ── Footer ────────────────────────────────────── */
.footer { border-top: 1px solid var(--border2); padding: 32px 0; text-align: center; font-size: 12px; color: var(--text3); }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 40px 20px; }
  .hero h1 { font-size: 1.8rem; }
  .hero-usps { grid-template-columns: repeat(3,1fr); gap: 8px; }
  .catalog-header { flex-direction: column; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { flex-wrap: wrap; }
  .search-wrap input { width: 100%; }
}

/* ── Purchase/Sale detail ──────────────────────── */
.sale-card { border: 1px solid var(--border2); border-radius: 16px; background: rgba(24,24,27,.2); padding: 24px; display: flex; flex-direction: column; gap: 20px; transition: border-color .2s; }
.sale-card:hover { border-color: var(--border); }
.sale-meta { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 12px; font-size: 12px; color: var(--text2); }
.sale-meta-item { display: flex; align-items: center; gap: 6px; }

/* ── Code / mono areas ─────────────────────────── */
.code-preview { background: rgba(39,39,42,.5); border: 1px solid rgba(63,63,70,.5); border-radius: 6px; padding: 8px 10px; font-family: var(--mono); font-size: 11px; color: var(--text2); max-height: 48px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ── Keys Stock ────────────────────────────────── */
.stock-infinite { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: var(--emerald); }
.stock-keys     { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: var(--amber); }
.stock-out      { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: var(--red); }

.stock-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-family: var(--mono); font-size: 11px; font-weight: 600; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-green  { background: var(--emerald); }
.dot-amber  { background: var(--amber); }
.dot-red    { background: var(--red); }

/* ── Checkout steps ────────────────────────────── */
.step-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 28px; }
.step-icon-success { background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.5); }
.step-icon-error   { background: rgba(239,68,68,.15);  border: 1px solid rgba(239,68,68,.5); }
.step-text-center  { text-align: center; padding: 32px 0; }
.progress-bar { width: 180px; height: 3px; background: var(--bg3); border-radius: 99px; overflow: hidden; margin: 20px auto 0; }
.progress-fill { height: 100%; background: var(--blue); width: 40%; border-radius: 99px; animation: progress 1s ease-in-out infinite alternate; }
@keyframes progress { from { width: 20%; } to { width: 80%; } }

/* ── Summary box ───────────────────────────────── */
.summary-box { background: rgba(9,9,11,.5); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.summary-price { font-size: 22px; font-weight: 800; color: var(--blue); }
