:root {
  --bg: #0b0e13;
  --bg-soft: #10141c;
  --panel: #131926;
  --panel-2: #1a2233;
  --border: #232c3f;
  --border-soft: #1d2536;
  --text: #e8edf6;
  --muted: #8b95ab;
  --accent: #7c5cff;
  --accent-2: #2dd4bf;
  --danger: #f4573f;
  --warn: #f0b429;
  --ok: #34d17b;
  --radius: 12px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(124, 92, 255, 0.14), transparent 60%),
    radial-gradient(700px 380px at -10% 10%, rgba(45, 212, 191, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
::selection { background: rgba(124, 92, 255, 0.4); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11, 14, 19, 0.82);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo-dot {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
}
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 0.93rem; font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav-spacer { flex: 1; }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  padding: 9px 16px; border-radius: 999px; cursor: pointer; font-size: 0.92rem; font-weight: 600;
}
.cart-btn:hover { border-color: var(--accent); }
.cart-count {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; color: #fff;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 0.93rem; padding: 10px 18px;
  transition: transform 0.06s ease, filter 0.15s ease, border-color 0.15s ease;
  user-select: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #6246ea); color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-soft { background: var(--panel-2); color: var(--text); border-color: var(--border-soft); }
.btn-soft:hover { border-color: var(--accent); }
.btn-danger { background: rgba(244, 87, 63, 0.12); color: var(--danger); border-color: rgba(244, 87, 63, 0.35); }
.btn-danger:hover { background: rgba(244, 87, 63, 0.2); }
.btn-ok { background: rgba(52, 209, 123, 0.12); color: var(--ok); border-color: rgba(52, 209, 123, 0.35); }
.btn-ok:hover { background: rgba(52, 209, 123, 0.2); }
.btn-sm { padding: 6px 12px; font-size: 0.83rem; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: 1rem; border-radius: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--muted); border-radius: 999px; padding: 6px 14px; font-size: 0.82rem; margin-bottom: 22px;
}
.hero-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 209, 123, 0.15); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(52, 209, 123, 0.05); } }
.hero h1 {
  margin: 0 0 14px; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.12; letter-spacing: -0.02em; font-weight: 800;
}
.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 28px; font-size: 1.02rem; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.stats-row {
  display: flex; justify-content: center; gap: 48px; flex-wrap: wrap;
  margin-top: 46px; padding: 22px 0; border-top: 1px solid var(--border-soft);
}
.stat b { display: block; font-size: 1.5rem; letter-spacing: -0.01em; }
.stat span { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Sections ---------- */
section.block { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.65rem; letter-spacing: -0.02em; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 0.94rem; }

/* ---------- Product grid ---------- */
.grid-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.p-card {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.p-card:hover { border-color: #33405c; transform: translateY(-3px); box-shadow: var(--shadow); }
.p-thumb { position: relative; aspect-ratio: 16/10; background: var(--bg-soft); display: block; }
.p-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-thumb .no-img { width: 100%; height: 100%; display: grid; place-items: center; color: #3b4763; font-size: 2rem; }
.p-sold {
  position: absolute; top: 10px; left: 10px; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(4px);
  color: #ffd166; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(255, 209, 102, 0.25);
}
.p-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.p-title { font-weight: 600; font-size: 0.98rem; line-height: 1.35; color: var(--text); }
.p-title:hover { color: var(--accent-2); text-decoration: none; }
.p-desc { color: var(--muted); font-size: 0.84rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }
.price { font-weight: 800; font-size: 1.08rem; letter-spacing: -0.01em; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.73rem; font-weight: 700; border: 1px solid;
}
.badge-ok { color: var(--ok); border-color: rgba(52, 209, 123, 0.4); background: rgba(52, 209, 123, 0.09); }
.badge-out { color: var(--danger); border-color: rgba(244, 87, 63, 0.4); background: rgba(244, 87, 63, 0.09); }

.sort-bar { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.88rem; }
select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea {
  background: var(--bg-soft); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 0.92rem; outline: none; width: 100%;
}
select:focus, input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
label.f-label { display: block; font-size: 0.82rem; color: var(--muted); font-weight: 600; margin: 0 0 6px; }
.f-group { margin-bottom: 14px; }

/* ---------- Feature cards ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 22px;
}
.feature .ico { font-size: 1.5rem; margin-bottom: 10px; }
.feature h3 { margin: 0 0 6px; font-size: 1rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* ---------- FAQ ---------- */
.faq-item { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq-q { width: 100%; text-align: left; background: none; border: none; color: var(--text); font: inherit; font-weight: 600; padding: 16px 18px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-q::after { content: '+'; color: var(--muted); font-size: 1.2rem; }
.faq-item.open .faq-q::after { content: '–'; }
.faq-a { display: none; padding: 0 18px 16px; color: var(--muted); font-size: 0.92rem; }
.faq-item.open .faq-a { display: block; }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--border-soft); padding: 30px 0; margin-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.86rem; }
.footer-links { display: flex; gap: 16px; }

/* ---------- Cart drawer & overlay ---------- */
.overlay { position: fixed; inset: 0; background: rgba(4, 6, 10, 0.66); z-index: 90; opacity: 0; pointer-events: none; transition: opacity 0.18s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: -420px; width: min(400px, 92vw); height: 100vh; z-index: 95;
  background: var(--bg-soft); border-left: 1px solid var(--border); display: flex; flex-direction: column;
  transition: right 0.22s ease;
}
.drawer.show { right: 0; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border-soft); font-weight: 700; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 1.25rem; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { color: var(--text); background: var(--panel); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-empty { text-align: center; color: var(--muted); padding: 48px 10px; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.cart-item img, .cart-item .ci-ph { width: 58px; height: 58px; border-radius: 9px; object-fit: cover; background: var(--panel-2); flex: none; }
.ci-mid { flex: 1; min-width: 0; }
.ci-title { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-price { color: var(--accent-2); font-weight: 700; font-size: 0.88rem; }
.qty-box { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 8px; margin-top: 6px; }
.qty-box button { background: none; border: none; color: var(--text); width: 26px; height: 26px; cursor: pointer; font-size: 0.95rem; }
.qty-box button:hover { color: var(--accent-2); }
.qty-box span { min-width: 24px; text-align: center; font-size: 0.85rem; }
.ci-x { align-self: flex-start; }
.drawer-foot { border-top: 1px solid var(--border-soft); padding: 16px 20px; }
.subtotal-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-weight: 700; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; visibility: hidden; }
.modal.show { visibility: visible; }
.modal .overlay { z-index: -1; }
.modal-card {
  width: min(480px, 100%); background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow);
  transform: translateY(8px); opacity: 0; transition: all 0.18s;
}
.modal.show .modal-card { transform: none; opacity: 1; }
.modal-card h3 { margin: 0 0 4px; }
.modal-sub { color: var(--muted); font-size: 0.88rem; margin: 0 0 18px; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 18px; border-radius: 12px; font-size: 0.9rem; box-shadow: var(--shadow); animation: toast-in 0.2s ease;
}
.toast.err { border-color: rgba(244, 87, 63, 0.5); }
.toast.ok { border-color: rgba(52, 209, 123, 0.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Invoice page ---------- */
.invoice-shell { max-width: 880px; margin: 34px auto 70px; padding: 0 20px; }
.inv-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.inv-avatar { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 1.2rem; }
.inv-shop-name { font-size: 1.25rem; font-weight: 800; }
.inv-domain { color: var(--muted); font-size: 0.84rem; }
.inv-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 800px) { .inv-grid { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 14px; padding: 20px; }
.card h4 { margin: 0 0 14px; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.inv-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.inv-item:last-child { border-bottom: none; }
.inv-item img, .inv-item .ph { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--panel-2); flex: none; }
.inv-item .t { font-weight: 600; font-size: 0.93rem; }
.inv-item .q { color: var(--muted); font-size: 0.8rem; }
.inv-item .amt { margin-left: auto; font-weight: 700; white-space: nowrap; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); font-size: 0.92rem; }
.sum-total { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 12px !important; color: var(--text) !important; font-weight: 800 !important; font-size: 1.15rem !important; }

.pay-methods { display: flex; flex-direction: column; gap: 9px; }
.pay-opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--bg-soft); cursor: pointer; font-weight: 600; font-size: 0.92rem;
  transition: border-color 0.12s;
}
.pay-opt:hover { border-color: var(--accent); }
.pay-opt.sel { border-color: var(--accent); background: rgba(124, 92, 255, 0.08); }
.pay-opt .sym { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; flex: none; }
.sym.btc { background: rgba(247, 147, 26, 0.15); color: #f7931a; }
.sym.eth { background: rgba(98, 126, 234, 0.15); color: #627eea; }
.sym.sol { background: rgba(153, 69, 255, 0.15); color: #9945ff; }
.sym.usdt { background: rgba(38, 180, 111, 0.15); color: #26b46f; }
.pay-opt small { display: block; color: var(--muted); font-weight: 500; font-size: 0.78rem; }

.addr-box { background: var(--bg-soft); border: 1px dashed var(--border); border-radius: 11px; padding: 13px 14px; word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; color: var(--accent-2); }
.copy-row { display: flex; gap: 8px; margin-top: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; border: 1px solid; }
.st-pending { color: var(--warn); border-color: rgba(240, 180, 41, 0.4); background: rgba(240, 180, 41, 0.09); }
.st-submitted { color: #59a7ff; border-color: rgba(89, 167, 255, 0.4); background: rgba(89, 167, 255, 0.09); }
.st-completed { color: var(--ok); border-color: rgba(52, 209, 123, 0.4); background: rgba(52, 209, 123, 0.09); }
.st-rejected { color: var(--danger); border-color: rgba(244, 87, 63, 0.4); background: rgba(244, 87, 63, 0.09); }

.steps { display: flex; gap: 6px; margin: 4px 0 16px; }
.step { flex: 1; height: 5px; border-radius: 99px; background: var(--border); }
.step.done { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.key-box { background: rgba(45, 212, 191, 0.07); border: 1px solid rgba(45, 212, 191, 0.3); border-radius: 11px; padding: 13px 14px; font-family: ui-monospace, Consolas, monospace; font-size: 0.86rem; white-space: pre-wrap; word-break: break-all; }

.note { color: var(--muted); font-size: 0.82rem; }
.secure-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.8rem; margin-top: 14px; }

/* ---------- Admin ---------- */
.admin-shell { max-width: 1200px; margin: 26px auto 80px; padding: 0 20px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.tabs { display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--border-soft); padding: 5px; border-radius: 12px; width: fit-content; }
.tab { background: none; border: none; color: var(--muted); font: inherit; font-weight: 600; font-size: 0.9rem; padding: 8px 18px; border-radius: 9px; cursor: pointer; }
.tab.active { background: var(--panel-2); color: var(--text); }
.tab:hover:not(.active) { color: var(--text); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.sc { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 13px; padding: 17px 19px; }
.sc b { font-size: 1.45rem; display: block; }
.sc span { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tbl th { text-align: left; color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255, 255, 255, 0.015); }
.tbl .thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--panel-2); display: block; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.82rem; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.radio-row { display: flex; gap: 10px; }
.radio-card { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; cursor: pointer; display: flex; gap: 9px; align-items: center; font-size: 0.88rem; font-weight: 600; }
.radio-card input { width: auto; }
.radio-card:has(input:checked) { border-color: var(--accent); background: rgba(124, 92, 255, 0.07); }
.img-preview { margin-top: 8px; max-height: 110px; border-radius: 9px; border: 1px solid var(--border); }

.order-detail { background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 11px; padding: 13px 15px; margin-top: 8px; font-size: 0.85rem; }
.kv { display: flex; gap: 8px; margin-bottom: 5px; }
.kv b { min-width: 76px; color: var(--muted); font-weight: 600; }

.empty-state { text-align: center; color: var(--muted); padding: 42px 12px; }

/* ---------- Product detail ---------- */
.pd-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 30px; margin-top: 36px; }
@media (max-width: 820px) { .pd-grid { grid-template-columns: 1fr; } }
.pd-img { border-radius: 16px; border: 1px solid var(--border-soft); background: var(--bg-soft); aspect-ratio: 4/3; overflow: hidden; }
.pd-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-info h1 { margin: 4px 0 10px; font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1.2; }
.pd-price { font-size: 1.7rem; font-weight: 800; margin: 12px 0 4px; }
.pd-meta { color: var(--muted); font-size: 0.86rem; display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pd-actions { display: flex; gap: 10px; margin: 18px 0 8px; flex-wrap: wrap; }
.pd-desc { white-space: pre-wrap; color: #c3cbdb; font-size: 0.95rem; margin-top: 22px; border-top: 1px solid var(--border-soft); padding-top: 20px; }

.crumb { color: var(--muted); font-size: 0.85rem; padding-top: 22px; display: block; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .stats-row { gap: 28px; }
}
