/* ============ ABB 41 км — тёмная «инженерная» тема ============ */
:root {
  --bg: #07090d;
  --bg-2: #0c1017;
  --panel: rgba(18, 24, 34, 0.72);
  --panel-solid: #121822;
  --line: rgba(148, 178, 220, 0.12);
  --line-2: rgba(148, 178, 220, 0.22);
  --text: #e8eef7;
  --muted: #8a97ab;
  --dim: #5b667a;
  --accent: #22d3ee;      /* «ток» */
  --accent-2: #3b82f6;
  --volt: #facc15;        /* «напряжение» */
  --ok: #34d399;
  --warn: #fb923c;
  --danger: #f43f5e;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: "Unbounded", var(--font);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(34, 211, 238, 0.35); }

/* ---------- фон ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.55;
}
.bg-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35; }
.g1 { width: 520px; height: 520px; left: -140px; top: -180px; background: var(--accent-2); animation: drift 18s ease-in-out infinite alternate; }
.g2 { width: 420px; height: 420px; right: -120px; top: 80px; background: var(--accent); opacity: 0.22; animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.1); } }
#circuit { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.8; }

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  padding: calc(14px + var(--safe-top)) clamp(16px, 4vw, 40px) 14px;
  background: rgba(7, 9, 13, 0.7);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; letter-spacing: 0.02em; }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 24px -6px rgba(250, 204, 21, 0.75); }
.logo-text { font-size: 17px; }
.logo-text b { color: var(--accent); margin-left: 4px; font-weight: 700; }

.search-trigger {
  flex: 1; min-width: 0; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  color: var(--muted); text-align: left; transition: 0.2s;
}
.search-trigger:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.06); color: var(--text); }
.search-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd {
  font: 500 11px var(--mono); padding: 3px 7px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); color: var(--muted);
}
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a { padding: 9px 14px; border-radius: 12px; color: var(--muted); font-weight: 500; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.topnav a:hover, .topnav a.active { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.topnav .btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: #04141a; font: 700 11px/20px var(--font); text-align: center; font-style: normal;
}

/* ---------- нижний таб-бар (мобайл / Telegram) ---------- */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom)); z-index: 45;
  display: none; justify-content: space-around; align-items: center;
  height: var(--tabbar-h); border-radius: 22px;
  background: rgba(16, 21, 30, 0.82);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}
.tabbar > * {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 500; color: var(--dim); padding: 8px 14px; transition: color 0.2s;
}
.tabbar svg { width: 22px; height: 22px; }
.tabbar .active { color: var(--accent); }
.tabbar .active::before {
  content: ""; position: absolute; top: -1px; width: 26px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--accent); box-shadow: 0 0 14px var(--accent);
}
.tabbar .badge { position: absolute; top: 2px; right: 8px; height: 18px; min-width: 18px; line-height: 18px; font-size: 10px; }

/* ---------- раскладка ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 120px; outline: none; }
.view { animation: rise 0.35s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- hero ---------- */
.hero { position: relative; padding: 36px 0 28px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px;
  font: 500 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.25);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.hero h1 {
  font: 700 clamp(30px, 5.4vw, 60px)/1.05 var(--display); letter-spacing: -0.02em; margin: 18px 0 14px; max-width: 900px;
}
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2) 50%, var(--volt)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); max-width: 620px; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 30px; max-width: 820px; }
.stat { padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.stat b { display: block; font: 700 clamp(20px, 2.6vw, 28px) var(--display); }
.stat span { color: var(--muted); font-size: 13px; }
.stat b.c-accent { color: var(--accent); } .stat b.c-ok { color: var(--ok); } .stat b.c-volt { color: var(--volt); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 34px 0 16px; }
.section-head h2 { font: 600 22px var(--display); margin: 0; letter-spacing: -0.01em; }
.section-head .meta { color: var(--muted); font: 500 13px var(--mono); }

/* ---------- бренды ---------- */
.brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 16px;
  border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  overflow: hidden; isolation: isolate; transition: transform 0.25s, border-color 0.25s;
}
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(34, 211, 238, 0.16), transparent 60%);
}
.tile:hover { transform: translateY(-3px); border-color: rgba(34, 211, 238, 0.4); }
.tile:hover::before { opacity: 1; }
.tile-logo {
  height: 92px; border-radius: 12px; background: #f4f6fa; display: grid; place-items: center; overflow: hidden;
}
.tile-logo img { max-width: 78%; max-height: 70%; object-fit: contain; }
.tile-logo .ph { font: 700 22px var(--display); color: #1a2130; }
.tile-name { font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile-name svg { color: var(--dim); transition: 0.25s; }
.tile:hover .tile-name svg { color: var(--accent); transform: translateX(3px); }
.tile-meta { display: flex; gap: 10px; color: var(--muted); font: 500 12px var(--mono); }
.tile-meta .on { color: var(--ok); }
.bar { height: 3px; border-radius: 3px; background: rgba(255,255,255,0.06); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--ok)); border-radius: inherit; }

/* ---------- хлебные крошки / заголовок ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--dim); }
.page-title { font: 700 clamp(24px, 3.6vw, 38px)/1.15 var(--display); margin: 0 0 6px; letter-spacing: -0.015em; }
.page-sub { color: var(--muted); margin: 0 0 22px; }

/* ---------- подкатегории ---------- */
.subcats { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 10px; }
.subcat {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); transition: 0.2s;
}
.subcat:hover { border-color: rgba(34, 211, 238, 0.4); background: rgba(34, 211, 238, 0.06); }
.subcat .thumb { width: 46px; height: 46px; border-radius: 10px; background: #f4f6fa; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.subcat .thumb img { width: 100%; height: 100%; object-fit: contain; }
.subcat .thumb svg { color: #8592a8; }
.subcat .t { flex: 1; min-width: 0; }
.subcat .t b { display: block; font-weight: 600; font-size: 14px; line-height: 1.3; }
.subcat .t span { color: var(--muted); font: 500 11px var(--mono); }

/* ---------- панель фильтров ---------- */
.toolbar {
  position: sticky; top: 72px; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 18px 0 16px; padding: 10px; border-radius: 16px;
  background: rgba(12, 16, 23, 0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
}
.field {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px;
  border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--muted);
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); }
.chip {
  height: 42px; padding: 0 14px; border-radius: 12px; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: 14px; transition: 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { color: #04141a; background: var(--accent); border-color: var(--accent); }
select.chip { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238a97ab' stroke-width='2'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
select.chip option { background: var(--panel-solid); color: var(--text); }
.count { margin-left: auto; color: var(--muted); font: 500 12px var(--mono); padding: 0 6px; }

/* ---------- товары ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); overflow: hidden; transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 1; background: #fff; display: block; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 14px; transition: opacity 0.35s, transform 0.4s; }
.card:hover .card-media img.main { transform: scale(1.04); }
.card-media img.alt { opacity: 0; }
.card:hover .card-media img.alt { opacity: 1; }
.card:hover .card-media img.main.has-alt { opacity: 0; }
.noimg { position: absolute; inset: 0; display: grid; place-items: center; color: #b8c1d1; }
.noimg svg { width: 44px; height: 44px; stroke-width: 1.2; }
.stock {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 99px;
  font: 600 11px var(--font); backdrop-filter: blur(6px);
}
.stock::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stock.in { color: #047857; background: rgba(209, 250, 229, 0.92); }
.stock.out { color: #b45309; background: rgba(254, 243, 199, 0.92); }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px; flex: 1; }
.card-title { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.card-title:hover { color: var(--accent); }
.sku { color: var(--dim); font: 500 11px var(--mono); }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font: 700 18px var(--display); letter-spacing: -0.01em; white-space: nowrap; }
.price small { font: 500 12px var(--font); color: var(--muted); margin-left: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 14px; border-radius: 12px; font-weight: 600; font-size: 14px; transition: 0.2s; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #031118; box-shadow: 0 8px 24px -10px rgba(34, 211, 238, 0.8); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; transform: none; cursor: default; }
.btn-soft { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); }
.btn-soft:hover { background: rgba(255, 255, 255, 0.1); }
.btn-lg { height: 52px; padding: 0 22px; border-radius: 14px; font-size: 16px; }
.btn-icon { width: 40px; padding: 0; }

.stepper { display: inline-flex; align-items: center; height: 40px; border-radius: 12px; background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.35); }
.stepper button { width: 36px; height: 100%; display: grid; place-items: center; color: var(--accent); font-size: 18px; font-weight: 600; }
.stepper button:hover { background: rgba(34, 211, 238, 0.12); }
.stepper span { min-width: 28px; text-align: center; font: 600 14px var(--mono); }
.stepper.lg { height: 52px; border-radius: 14px; }
.stepper.lg button { width: 48px; }

.more { display: flex; justify-content: center; padding: 30px 0; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ico { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--accent); }
.empty .ico svg { width: 32px; height: 32px; }
.empty h3 { color: var(--text); font: 600 20px var(--display); margin: 0 0 8px; }

/* ---------- карточка товара ---------- */
.product { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.gallery { position: sticky; top: 90px; }
.gallery-main { position: relative; aspect-ratio: 1; border-radius: 24px; background: #fff; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; padding: 30px; transition: transform 0.3s; }
.gallery-main.zoom { cursor: zoom-out; }
.gallery-main.zoom img { transform: scale(1.9); }
.thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; }
.thumbs button { width: 72px; height: 72px; border-radius: 14px; background: #fff; border: 2px solid transparent; overflow: hidden; flex-shrink: 0; opacity: 0.6; transition: 0.2s; }
.thumbs button.on { border-color: var(--accent); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.p-info h1 { font: 700 clamp(22px, 3vw, 32px)/1.2 var(--display); margin: 10px 0 12px; letter-spacing: -0.015em; }
.p-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px; font: 500 12px var(--mono); background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--muted); }
.tag.copy:hover { color: var(--accent); border-color: rgba(34,211,238,0.4); }
.tag svg { width: 14px; height: 14px; }
.buy { margin: 22px 0; padding: 20px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.buy .price { font-size: 34px; }
.buy-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.buy-row .btn-primary { flex: 1; }
.buy-row [data-buy] > * { flex: 1; justify-content: space-between; }
.buy-row [data-buy] > .btn { justify-content: center; }
.buy-note { margin-top: 14px; display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
.buy-note div { display: flex; gap: 8px; align-items: center; }
.buy-note svg { width: 16px; height: 16px; color: var(--accent); }
.specs { border-radius: 18px; border: 1px solid var(--line); overflow: hidden; }
.specs h3, .desc h3 { font: 600 16px var(--display); margin: 0; padding: 16px 18px; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--line); }
.specs dl { margin: 0; display: grid; grid-template-columns: 1fr auto; }
.specs dt, .specs dd { margin: 0; padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.specs dt { color: var(--muted); }
.specs dd { text-align: right; font-weight: 600; font-family: var(--mono); font-size: 13px; }
.specs dl > :nth-last-child(-n+2) { border-bottom: 0; }
.desc { margin-top: 16px; border-radius: 18px; border: 1px solid var(--line); overflow: hidden; }
.desc p { margin: 0; padding: 16px 18px; color: #c4cede; white-space: pre-line; font-size: 14px; line-height: 1.65; }

/* ---------- корзина ---------- */
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.cart-list { display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; padding: 12px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.line .img { width: 84px; height: 84px; border-radius: 12px; background: #fff; overflow: hidden; position: relative; }
.line .img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.line .t { min-width: 0; }
.line .t a { font-weight: 600; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line .t a:hover { color: var(--accent); }
.line .r { display: flex; flex-direction: column; align-items: end; gap: 8px; }
.line .sum { font: 700 16px var(--display); }
.rm { color: var(--dim); font-size: 12px; } .rm:hover { color: var(--danger); }
.summary { position: sticky; top: 90px; padding: 22px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line-2); backdrop-filter: blur(12px); }
.summary h3 { font: 600 18px var(--display); margin: 0 0 16px; }
.sum-row { display: flex; justify-content: space-between; color: var(--muted); padding: 6px 0; font-size: 14px; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 18px; margin-top: 8px; border-top: 1px dashed var(--line-2); }
.sum-total b { font: 700 28px var(--display); }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.form input, .form textarea {
  width: 100%; padding: 13px 14px; border-radius: 12px; outline: none; resize: vertical;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line-2); transition: 0.2s;
}
.form input:focus, .form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); }
.form .err { color: var(--danger); font-size: 13px; min-height: 18px; }
.form input.bad { border-color: var(--danger); }
.legal { color: var(--dim); font-size: 12px; text-align: center; margin: 4px 0 0; }

/* ---------- вход / профиль / успех ---------- */
.auth { max-width: 440px; margin: 30px auto; padding: 30px; border-radius: 26px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.auth .ico { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 18px; background: linear-gradient(135deg, rgba(34,211,238,0.2), rgba(59,130,246,0.2)); border: 1px solid rgba(34,211,238,0.35); color: var(--accent); }
.auth .ico svg { width: 28px; height: 28px; }
.auth h1 { font: 700 26px var(--display); margin: 0 0 6px; }
.auth p { color: var(--muted); margin: 0 0 22px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); box-shadow: 0 0 24px -4px var(--accent); }
.success-mark { width: 84px; height: 84px; margin: 10px auto 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.4); color: var(--ok); animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1); }
.success-mark svg { width: 40px; height: 40px; stroke-width: 2.4; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

/* ---------- палитра поиска ---------- */
.palette { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: calc(10vh + var(--safe-top)) 14px 14px; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(3, 5, 9, 0.7); backdrop-filter: blur(6px); animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.palette-box { position: relative; width: 100%; max-width: 680px; max-height: 76vh; display: flex; flex-direction: column; border-radius: 22px; background: rgba(14, 19, 27, 0.96); border: 1px solid var(--line-2); box-shadow: 0 40px 100px -20px #000, 0 0 0 1px rgba(34,211,238,0.08); overflow: hidden; animation: rise 0.25s cubic-bezier(.2,.8,.2,1); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--accent); }
.palette-input input { flex: 1; background: none; border: 0; outline: none; font-size: 17px; color: var(--text); }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-input kbd { cursor: pointer; }
.palette-results { overflow-y: auto; padding: 8px; }
.pr-group { padding: 10px 10px 6px; color: var(--dim); font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.pr { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; }
.pr.sel, .pr:hover { background: rgba(34, 211, 238, 0.08); }
.pr .im { width: 44px; height: 44px; border-radius: 10px; background: #fff; flex-shrink: 0; overflow: hidden; display: grid; place-items: center; color: #8592a8; }
.pr .im img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.pr .tx { flex: 1; min-width: 0; }
.pr .tx b { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr .tx span { color: var(--dim); font: 500 11px var(--mono); }
.pr .pp { font: 600 14px var(--display); white-space: nowrap; }
.pr mark { background: none; color: var(--accent); }
.pr-hint { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 28px + var(--safe-bottom)); z-index: 120;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 14px; background: #f1f5fb; color: #0b0f16; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); transition: 0.3s cubic-bezier(.2,.8,.2,1); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* skeleton */
.sk { background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- адаптив ---------- */
@media (max-width: 960px) {
  .product, .cart { grid-template-columns: 1fr; }
  .gallery, .summary { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .topnav, .search-trigger kbd { display: none; }
  .tabbar { display: flex; }
  .topbar { gap: 12px; }
  .search-trigger span { font-size: 14px; }
  main { padding-top: 18px; padding-bottom: calc(var(--tabbar-h) + 40px + var(--safe-bottom)); }
  .hero { padding: 14px 0 10px; }
  .hero h1 { font-size: clamp(20px, 6.2vw, 34px); overflow-wrap: anywhere; }
  .brands { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { padding: 10px; gap: 10px; }
  .tile-logo { height: 74px; }
  .tile-name { font-size: 14px; }
  .tile-meta { font-size: 10.5px; gap: 6px; flex-wrap: wrap; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-body { padding: 10px; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .card-foot .btn, .card-foot .stepper { width: 100%; justify-content: space-between; }
  .card-foot .btn { justify-content: center; }
  .price { font-size: 16px; }
  .toolbar { top: 64px; }
  .logo-text { display: none; }
  .toolbar { gap: 8px; padding: 8px; }
  .toolbar .field { flex-basis: 100%; }
  .toolbar .chip { flex: 1; justify-content: center; }
  .count { display: none; }
  .line { grid-template-columns: 64px 1fr; }
  .line .img { width: 64px; height: 64px; }
  .line .r { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .palette { padding-top: calc(12px + var(--safe-top)); }
  .palette-box { max-height: calc(100vh - 24px - var(--safe-top)); }
}

/* ---------- режим Telegram Mini App ---------- */
body.tg .topbar { padding-top: calc(10px + var(--tg-safe-top, 0px)); }
body.tg .topnav, body.tg .search-trigger kbd { display: none; }
body.tg .tabbar { display: flex; bottom: calc(10px + var(--tg-safe-bottom, 0px)); }
body.tg main { padding-bottom: calc(var(--tabbar-h) + 40px + var(--tg-safe-bottom, 0px)); }
body.tg .logo-text { display: none; }
body.tg.tg-main-btn .tabbar { display: none; }
body.tg.tg-main-btn main { padding-bottom: 40px; }
body.tg .toolbar { top: calc(64px + var(--tg-safe-top, 0px)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #circuit { display: none; }
}

/* ---------- заявка вместо цен ---------- */
.brand-chip {
  position: absolute; top: 10px; left: 10px; z-index: 2; max-width: calc(100% - 20px);
  padding: 4px 9px; border-radius: 99px; font: 600 11px var(--font); color: #1e293b;
  background: rgba(241, 245, 249, 0.92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-foot > div { width: 100%; }
.card-foot .btn, .card-foot .stepper { width: 100%; }
.card-foot .stepper { justify-content: space-between; }
.ask { font: 700 26px var(--display); letter-spacing: -0.01em; }
.ask-sm { font-size: 20px !important; color: var(--accent); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.step { position: relative; padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); display: grid; gap: 4px; }
.step i { font: 500 12px var(--mono); color: var(--accent); font-style: normal; }
.step b { font: 600 16px var(--display); }
.step span { color: var(--muted); font-size: 13px; }
.contacts { display: grid; gap: 8px; }
.contact { display: grid; grid-template-columns: 22px 1fr; gap: 2px 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.contact svg { grid-row: span 2; color: var(--accent); }
.contact span { color: var(--muted); font-size: 12px; }
.contact b { font-weight: 600; }
.contact a:hover { color: var(--accent); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } .ask { font-size: 22px; } }

/* фото всегда поверх значка-заглушки */
.gallery-main img, .line .img img, .card-media img { position: relative; z-index: 1; }
.card-media img { position: absolute; }
.thumbs button { opacity: 0.75; }
@media (max-width: 760px) { .toolbar { position: static; } }

/* цена над кнопкой в карточке */
.card-foot { flex-direction: column; align-items: stretch; gap: 10px; }
.line .sum { font: 700 16px var(--display); white-space: nowrap; }
