:root {
  --ink: #0b1020; --ink-2: #111833; --ink-3: #1a2245; --line-d: #252e57;
  --bg: #f5f6fb; --card: #ffffff; --line: #e5e7f0; --text: #141a2e; --muted: #626a85; --muted-d: #9aa3c4;
  --brand: #5b4cff; --brand-2: #7a6dff; --brand-ink: #ffffff; --brand-soft: #eeecff;
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --gold: #f5b301;
  --r: 12px; --r-sm: 8px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --max: 1200px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: var(--text); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

/* ---------- buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: var(--r-sm);
  border: 1px solid transparent; font: 600 14px/1 inherit; font-family: inherit; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: .15s; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); }
.btn-outline { background: transparent; color: var(--text); border-color: #cfd3e3; }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost-d { background: transparent; color: #fff; border-color: #4a5385; }
.btn-ghost-d:hover { border-color: #fff; }
.btn-danger { background: #fff; color: var(--bad); border-color: #f3c3c3; }
.btn-danger:hover { background: #fdecec; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d5d9e6; border-radius: var(--r-sm); font: inherit; color: var(--text); background: #fff; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--brand); }
.alert { padding: 12px 14px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert-success { background: #ecfdf3; border-color: #b7ebc9; color: #146c3a; }
.alert-error { background: #fef1f1; border-color: #f6c9c9; color: #9b1c1c; }
.alert-info { background: #eef4ff; border-color: #c8d8ff; color: #1e3a8a; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--brand-soft); color: var(--brand); }
.badge-ok { background: #e7f8ee; color: var(--ok); } .badge-warn { background: #fff4e0; color: var(--warn); } .badge-bad { background: #fdecec; color: var(--bad); }
.badge-gray { background: #eef0f6; color: var(--muted); }

/* ---------- header */
.site-head { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line-d); }
.site-head .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo img { width: 32px; height: 32px; }
.nav { display: flex; gap: 22px; font-size: 14px; }
.nav a { color: #c9cfe8; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.on { color: #fff; text-decoration: none; border-bottom-color: var(--brand); }
.head-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { position: relative; display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 8px; color: #c9cfe8; background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--ink-3); color: #fff; }
.count { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.head-search { display: none; background: var(--ink-2); border-bottom: 1px solid var(--line-d); padding: 12px 0; }
.head-search.open { display: block; }
.head-search form { display: flex; gap: 10px; }
.head-search input { background: var(--ink-3); border-color: var(--line-d); color: #fff; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; gap: 0; background: var(--ink); border-bottom: 1px solid var(--line-d); padding: 8px 20px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line-d); }
  .menu-btn { display: inline-flex; }
  .head-tools .hide-sm { display: none; }
}

/* ---------- dark hero + page heads */
.dark { background: var(--ink); color: #fff; }
.hero { position: relative; overflow: hidden; background:
  radial-gradient(900px 420px at 85% 10%, rgba(91, 76, 255, .35), transparent 60%),
  radial-gradient(700px 400px at 10% 100%, rgba(0, 170, 255, .14), transparent 60%),
  linear-gradient(180deg, #0b1020 0%, #0d1330 100%); }
.hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(180deg, #000 0%, transparent 85%); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; padding-top: 72px; padding-bottom: 56px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #8f88ff; font-weight: 700; margin-bottom: 14px; }
.hero h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.05; margin-bottom: 18px; }
.hero h1 .accent { background: linear-gradient(90deg, #7f72ff, #4fc3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: #c3c9e4; max-width: 520px; font-size: 16px; margin-bottom: 26px; }
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line-d); }
.trust div { display: flex; gap: 12px; align-items: flex-start; }
.trust .ti { width: 38px; height: 38px; border-radius: 10px; background: var(--ink-3); display: grid; place-items: center; color: #9a91ff; flex: none; }
.trust b { display: block; font-size: 14px; } .trust span { font-size: 12px; color: var(--muted-d); }
@media (max-width: 760px) { .trust { grid-template-columns: 1fr 1fr; } }
.page-head { background: linear-gradient(180deg, #0b1020, #10173a); color: #fff; padding: 34px 0 30px; }
.page-head p { color: #b8bfdc; margin: 0; }
.crumbs { font-size: 12px; color: #8e96b8; margin-bottom: 10px; }
.crumbs a { color: #b8bfdc; }
.section { padding: 44px 0; }
.section-dark { background: var(--ink); color: #fff; padding: 40px 0; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.sec-head a { font-size: 14px; font-weight: 600; }
.section-dark .sec-head a { color: #9a91ff; }

/* ---------- product cards */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; color: var(--text); transition: transform .15s, box-shadow .15s; }
a.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(16, 24, 40, .12); }
.card-dark { background: var(--ink-2); border-color: var(--line-d); color: #fff; box-shadow: none; }
.thumb { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #1b2050, #3a2f9c 60%, #5b4cff); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { color: #fff; opacity: .9; width: 56px; height: 56px; }
.thumb .vbadge { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 4px 7px; display: flex; gap: 4px; align-items: center; }
.thumb .tbadge { position: absolute; right: 10px; top: 10px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 700; font-size: 15px; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.price { font-weight: 800; font-size: 16px; }
.stars { display: inline-flex; align-items: center; gap: 2px; color: var(--gold); font-size: 13px; }
.stars .n { color: var(--muted); margin-left: 4px; font-size: 12px; }
.card-dark .stars .n { color: var(--muted-d); }
.empty { text-align: center; padding: 48px 20px; border: 1px dashed #cfd3e3; border-radius: var(--r); color: var(--muted); background: #fff; }
.section-dark .empty { background: transparent; border-color: var(--line-d); color: var(--muted-d); }

/* ---------- catalog */
.catalog { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 28px 0 56px; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; align-self: start; position: sticky; top: 84px; }
.filters h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.filters h4:first-of-type { margin-top: 14px; }
.cat-list a { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 6px; color: var(--text); font-size: 14px; }
.cat-list a:hover { background: var(--bg); text-decoration: none; }
.cat-list a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.cat-list .n { color: var(--muted); font-size: 12px; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.toolbar select { width: auto; }
@media (max-width: 860px) { .catalog { grid-template-columns: 1fr; } .filters { position: static; } }

/* ---------- product page */
.pd { display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; padding: 30px 0 10px; }
.gallery .main { border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #1b2050, #5b4cff); display: grid; place-items: center; }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; width: 92px; height: 58px; flex: none; cursor: pointer; background: #ddd; }
.thumbs button.on { border-color: var(--brand); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.buy { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); align-self: start; }
.buy .price { font-size: 30px; margin: 10px 0 12px; }
.perks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.perks div { display: flex; gap: 10px; font-size: 13px; }
.perks .pi { width: 34px; height: 34px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.perks b { display: block; font-size: 13px; } .perks span { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 28px 0 22px; overflow-x: auto; }
.tabs a { padding: 12px 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on, .tabs a:hover { color: var(--brand); border-bottom-color: var(--brand); text-decoration: none; }
.tab { display: none; } .tab.on { display: block; }
.prose { max-width: 820px; }
.prose img { border-radius: 8px; }
.prose code { background: #eef0f6; padding: 2px 6px; border-radius: 5px; font-size: 13px; }
.prose pre { background: var(--ink); color: #e3e7ff; padding: 14px; border-radius: 8px; overflow: auto; }
.prose pre code { background: none; padding: 0; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; }
.ticks li::before { content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b4cff' stroke-width='3'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/12px no-repeat; margin-top: 2px; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #000; margin-bottom: 24px; }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.review { border-bottom: 1px solid var(--line); padding: 16px 0; }
.rate-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rate-input input { display: none; }
.rate-input label { font-size: 26px; color: #d3d6e2; cursor: pointer; margin: 0; }
.rate-input input:checked ~ label, .rate-input label:hover, .rate-input label:hover ~ label { color: var(--gold); }
@media (max-width: 900px) { .pd { grid-template-columns: 1fr; } }

/* ---------- panels: cart, checkout, account */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.two { display: grid; grid-template-columns: 1fr 380px; gap: 28px; padding: 30px 0 56px; align-items: start; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.line-item { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.li-thumb { width: 84px; height: 58px; border-radius: 8px; overflow: hidden; flex: none; background: linear-gradient(135deg, #1b2050, #5b4cff); display: grid; place-items: center; color: #fff; }
.li-thumb img { width: 100%; height: 100%; object-fit: cover; }
.li-main { flex: 1; min-width: 0; }
.li-main b { display: block; }
.sum-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.sum-total { font-size: 18px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.pay-box { border: 2px solid var(--brand); background: #faf9ff; border-radius: var(--r-sm); padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.pay-methods { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.secure { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 12px; }
.acct { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 30px 0 56px; align-items: start; }
.side-nav a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.side-nav a:hover { background: var(--bg); text-decoration: none; }
.side-nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side-nav button { all: unset; display: flex; gap: 10px; align-items: center; padding: 10px 12px; font-size: 14px; cursor: pointer; width: 100%; box-sizing: border-box; border-radius: 8px; }
.side-nav button:hover { background: var(--bg); }
.who { display: flex; gap: 12px; align-items: center; padding: 6px 4px 16px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.subtabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.subtabs a { padding: 8px 0; color: var(--muted); font-size: 14px; font-weight: 600; border-bottom: 2px solid transparent; }
.subtabs a.on { color: var(--brand); border-bottom-color: var(--brand); text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stat b { display: block; font-size: 22px; } .stat span { color: var(--muted); font-size: 13px; }
@media (max-width: 860px) { .acct { grid-template-columns: 1fr; } }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfe; }
.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }

/* ---------- auth + messages */
.auth { max-width: 440px; margin: 48px auto 72px; }
.center-card { max-width: 560px; margin: 48px auto 72px; text-align: center; }
.big-ok { width: 74px; height: 74px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin: 0 auto 18px; }
.big-ok .icon { width: 38px; height: 38px; }
.big-wait { width: 74px; height: 74px; border-radius: 50%; border: 5px solid var(--brand-soft); border-top-color: var(--brand); margin: 0 auto 18px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.kv { text-align: left; margin: 22px 0; }
.kv div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.err-code { font-size: 96px; font-weight: 900; line-height: 1; background: linear-gradient(90deg, #7f72ff, #4fc3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- footer */
.site-foot { background: var(--ink); color: #aab2d4; padding: 48px 0 26px; font-size: 14px; margin-top: auto; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.site-foot h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.site-foot a { color: #aab2d4; display: block; padding: 3px 0; }
.site-foot a:hover { color: #fff; }
.foot-bottom { border-top: 1px solid var(--line-d); margin-top: 32px; padding-top: 18px; font-size: 12px; color: #7d86ab; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

/* ---------- legal */
.legal { max-width: 820px; padding: 34px 0 64px; }
.legal h2 { margin-top: 30px; font-size: 19px; }
.legal li { margin-bottom: 6px; }
.legal-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }

/* ---------- admin */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-side { background: var(--ink); color: #c9cfe8; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .logo { padding: 4px 8px 18px; }
.admin-side a, .admin-side button { display: flex; gap: 10px; align-items: center; color: #c9cfe8; padding: 10px 10px; border-radius: 8px; font-size: 14px; width: 100%; background: none; border: 0; font-family: inherit; cursor: pointer; text-align: left; }
.admin-side a:hover, .admin-side button:hover { background: var(--ink-3); color: #fff; text-decoration: none; }
.admin-side a.on { background: var(--brand); color: #fff; }
.admin-main { padding: 26px 30px 60px; min-width: 0; }
.admin-main h1 { font-size: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.img-pick { display: flex; gap: 12px; flex-wrap: wrap; }
.img-pick figure { margin: 0; width: 150px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; font-size: 12px; }
.img-pick img { width: 150px; height: 94px; object-fit: cover; }
.img-pick figcaption { padding: 6px 8px; display: grid; gap: 4px; }
@media (max-width: 860px) { .admin-shell { grid-template-columns: 1fr; } .admin-side { position: static; height: auto; } .form-grid { grid-template-columns: 1fr; } .admin-main { padding: 20px 16px; } }
.panel, .card:not(.card-dark) { color: var(--text); }
.login-bg { justify-content: center; align-items: center; background: radial-gradient(800px 400px at 80% 0%, rgba(91, 76, 255, .35), transparent 60%), linear-gradient(180deg, #0b1020, #0d1330); }
.is-busy { opacity: .6; cursor: progress !important; }
