:root {
  --bg: #070914;
  --panel: #0d1223;
  --panel-2: #121a2e;
  --line: rgba(41, 240, 255, 0.24);
  --cyan: #29f0ff;
  --pink: #ff3fa4;
  --lime: #b8ff3d;
  --text: #f5f7ff;
  --muted: #9cabc9;
  --danger: #ff5578;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(41, 240, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 240, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 75% 0%, rgba(255, 63, 164, 0.13), transparent 34%),
    var(--bg);
  background-size: 38px 38px, 38px 38px, auto, auto;
  font-family: Inter, Arial, sans-serif;
  letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
.scanlines { position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .12; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.06) 4px); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 20, 0.9);
  backdrop-filter: blur(16px);
  padding: 10px clamp(18px, 4vw, 54px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand img { width: 42px; height: 42px; object-fit: cover; border: 1px solid var(--cyan); }
.brand span { display: grid; gap: 3px; }
.brand strong { font-size: 18px; }
.brand small, .eyebrow { color: var(--cyan); font-family: "Share Tech Mono", monospace; font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.support-link { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.support-link > span:last-child { display: grid; gap: 2px; }
.support-link small { color: var(--muted); font: 9px "Share Tech Mono", monospace; }
.support-link strong { color: var(--cyan); font-size: 12px; }
.support-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--lime); color: var(--lime); font: 700 10px "Share Tech Mono", monospace; }
.support-link:hover strong { color: var(--lime); }
.network { display: flex; align-items: center; gap: 8px; color: var(--lime); font: 12px "Share Tech Mono", monospace; }
.network i, .live-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 14px var(--lime); }

main { width: min(1440px, 100%); margin: 0 auto; padding: 20px clamp(18px, 4vw, 54px) 64px; }
.command-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-left: 3px solid var(--pink); padding: 4px 0 6px 18px; }
.command-head h1 { margin: 0 0 7px; font-size: clamp(30px, 4vw, 48px); line-height: 1; text-transform: uppercase; text-shadow: 3px 0 rgba(255, 63, 164, .45), -2px 0 rgba(41, 240, 255, .4); }
.command-head p { margin: 0; color: var(--muted); max-width: 740px; line-height: 1.6; }
.metric { flex: 0 0 122px; border: 1px solid var(--line); background: var(--panel); padding: 11px 13px; text-align: right; }
.metric span { display: block; color: var(--lime); font: 25px "Share Tech Mono", monospace; }
.metric small { color: var(--muted); }

.controls { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 18px 0 14px; }
.search-field { flex: 1; max-width: 470px; display: grid; gap: 7px; color: var(--cyan); font: 11px "Share Tech Mono", monospace; }
.search-field input, .checkout-stage input {
  width: 100%; min-height: 48px; border: 1px solid var(--line); outline: none; color: var(--text); background: rgba(3, 7, 18, .84); padding: 0 14px;
}
.search-field input:focus, .checkout-stage input:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(41, 240, 255, .1); }
.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.category-tabs button { min-height: 40px; border: 1px solid rgba(255,255,255,.12); color: var(--muted); background: var(--panel); padding: 0 15px; cursor: pointer; text-transform: uppercase; font-weight: 800; }
.category-tabs button.active { color: #061014; border-color: var(--lime); background: var(--lime); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 12px; align-items: start; }
.product-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 118px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    linear-gradient(90deg, rgba(41,240,255,.1), transparent 46%),
    rgba(10, 15, 31, .92);
  padding: 16px 26px 16px 28px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(41,240,255,.03);
}
.product-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.product-card:hover { border-color: rgba(41,240,255,.62); transform: translateY(-1px); transition: .18s ease; background-color: rgba(12, 19, 39, .96); }
.product-main { min-width: 0; }
.product-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.product-code { color: rgba(41,240,255,.72); font: 20px "Share Tech Mono", monospace; white-space: nowrap; }
.product-category {
  display: inline-grid;
  place-items: center;
  min-width: 68px;
  min-height: 36px;
  border: 1px solid rgba(41,240,255,.48);
  border-radius: 5px;
  color: #071121;
  background: linear-gradient(90deg, var(--cyan), #63f4df);
  padding: 0 12px;
  font-size: 19px;
  font-weight: 900;
  text-transform: uppercase;
}
.product-card h2 {
  margin: 0 0 4px;
  max-width: 100%;
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.product-card p { display: none; }
.product-foot { display: contents; }
.product-price { display: block; color: var(--lime); font-size: clamp(22px, 2.2vw, 30px); line-height: 1.05; font-weight: 900; }
.select-btn, .primary-btn { border: 0; color: #061014; background: linear-gradient(90deg, var(--cyan), var(--lime)); cursor: pointer; font-weight: 800; text-transform: uppercase; }
.select-btn { min-width: 96px; min-height: 54px; padding: 0 18px; font-size: 21px; box-shadow: 0 0 20px rgba(41,240,255,.1); }
.empty-state { border: 1px dashed var(--line); color: var(--muted); padding: 60px 20px; text-align: center; }

.checkout-dialog { width: min(540px, calc(100% - 24px)); max-height: calc(100vh - 24px); border: 1px solid var(--cyan); border-radius: 0; color: var(--text); background: var(--panel); padding: 0; box-shadow: var(--shadow); }
.checkout-dialog.result-ready { width: min(1040px, calc(100% - 24px)); }
.checkout-dialog::backdrop { background: rgba(0, 0, 0, .78); backdrop-filter: blur(5px); }
.dialog-shell { padding: 22px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.dialog-head h2 { margin: 4px 0 0; font-size: 21px; }
.icon-btn { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.15); color: var(--text); background: transparent; cursor: pointer; font-size: 25px; }
.checkout-stage { display: grid; gap: 15px; padding-top: 18px; }
.checkout-stage label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.order-summary { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid rgba(255,255,255,.1); }
.order-summary div { display: grid; gap: 5px; padding: 12px; }
.order-summary div + div { border-left: 1px solid rgba(255,255,255,.1); }
.order-summary span, .invoice-row span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.order-summary strong { color: var(--lime); }
.primary-btn, .secondary-btn { min-height: 48px; padding: 0 16px; }
.primary-btn:disabled { filter: grayscale(1); cursor: wait; }
.secondary-btn { border: 1px solid rgba(255,85,120,.45); color: var(--danger); background: transparent; cursor: pointer; font-weight: 800; text-transform: uppercase; }
.form-message { min-height: 18px; margin: 0; color: var(--danger); font-size: 12px; }

.payment-stage { padding-top: 18px; }
.payment-layout { display: grid; grid-template-columns: 1fr; gap: 18px; }
.result-ready .payment-layout { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
.payment-main { min-width: 0; }
.status-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 16px; }
.status-step { display: grid; justify-items: center; gap: 6px; color: #5e6986; font-size: 10px; text-transform: uppercase; }
.status-step b { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #3b4665; font: 12px "Share Tech Mono", monospace; }
.status-step.active { color: var(--cyan); }
.status-step.active b { border-color: var(--cyan); background: rgba(41,240,255,.1); box-shadow: 0 0 12px rgba(41,240,255,.25); }
.invoice-row { display: flex; justify-content: space-between; gap: 12px; border: 1px dashed rgba(255,255,255,.18); padding: 10px; }
.invoice-row strong { color: var(--cyan); overflow-wrap: anywhere; text-align: right; }
.qr-frame { width: min(300px, 85%); aspect-ratio: 1; display: grid; place-items: center; margin: 16px auto; border: 1px solid var(--line); background: #fff; padding: 10px; }
.qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.payment-total { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed rgba(255,255,255,.18); padding-top: 12px; }
.payment-total span { color: var(--muted); }
.payment-total strong { color: var(--lime); font-size: 22px; }
.countdown { margin: 10px 0; color: var(--pink); text-align: center; font: 13px "Share Tech Mono", monospace; }
.live-status { display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid rgba(184,255,61,.22); background: rgba(184,255,61,.05); padding: 11px; color: var(--lime); font-weight: 800; text-transform: uppercase; }
.order-result { min-width: 0; border: 1px solid rgba(184,255,61,.32); background: rgba(184,255,61,.045); padding: 15px; }
.result-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(184,255,61,.2); padding-bottom: 12px; }
.result-head h3 { margin: 3px 0 0; font-size: 18px; }
.secondary-btn.compact { min-height: 36px; padding: 0 12px; }
.result-box { max-height: 500px; overflow: auto; margin: 13px 0 0; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.65 "Share Tech Mono", monospace; }
.payment-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 80; max-width: 360px; border: 1px solid var(--cyan); color: var(--text); background: var(--panel-2); padding: 13px 15px; box-shadow: var(--shadow); }

@media (max-width: 760px) {
  .product-grid { grid-template-columns: 1fr; gap: 12px; }
  .controls, .command-head { align-items: stretch; flex-direction: column; }
  .category-tabs { justify-content: flex-start; }
  .metric { width: 100%; text-align: left; }
  .result-ready .payment-layout { grid-template-columns: 1fr; }
  .checkout-dialog.result-ready { width: min(560px, calc(100% - 20px)); }
}
@media (max-width: 520px) {
  .network { display: none; }
  .support-link small { display: none; }
  .support-link strong { font-size: 11px; }
  .topbar-actions { gap: 8px; }
  main { padding-left: 13px; padding-right: 13px; }
  .topbar { padding-left: 13px; padding-right: 13px; }
  .product-card { min-height: 105px; gap: 12px; padding: 14px 18px 14px 22px; }
  .product-head { gap: 10px; margin-bottom: 8px; }
  .product-category { min-width: 54px; min-height: 30px; border-radius: 4px; font-size: 15px; padding: 0 9px; }
  .product-code { font-size: 17px; }
  .product-card h2 { font-size: 21px; }
  .product-price { font-size: 25px; }
  .select-btn { min-width: 78px; min-height: 48px; padding: 0 12px; font-size: 18px; }
  .payment-actions { grid-template-columns: 1fr; }
  .dialog-shell { padding: 16px; }
}
@media (max-width: 390px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-card { padding-right: 12px; }
  .product-code { font-size: 15px; }
  .product-card h2 { font-size: 19px; }
  .product-price { font-size: 22px; }
  .select-btn { min-width: 70px; min-height: 44px; font-size: 16px; }
}
