:root {
  --bg: #f4f6f8;
  --paper: #ffffff;
  --ink: #14202b;
  --muted: #5d6b78;
  --line: #dde3e9;
  --navy: #12324a;
  --accent: #e8900c;
  --accent-ink: #ffffff;
  --hot: rgba(232, 144, 12, .18);
  --ok: #1f8a4c;
  --warn: #b5650a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 50, 74, .06), 0 6px 20px rgba(18, 50, 74, .06);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
a { color: var(--navy); }
button { font: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, "Cascadia Mono", monospace; letter-spacing: .01em; }

/* шапка */
.top { position: sticky; top: 0; z-index: 10; display: flex; gap: 16px; align-items: center;
  padding: 10px 24px; background: var(--navy); color: #fff; }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 22px; letter-spacing: .02em; }
.logo svg { width: 30px; height: 30px; fill: var(--accent); transform: rotate(-20deg); }
.logo b { color: var(--accent); font-weight: 700; }
.search { flex: 1; }
.search input { width: 100%; padding: 10px 14px; border-radius: 10px; border: 0; font: inherit; background: #fff; color: var(--ink); }
.cartlink { position: relative; color: #fff; padding: 6px; }
.cartlink svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; }
.cartlink circle { fill: #fff; stroke: none; }
.badge { position: absolute; top: -2px; right: -4px; background: var(--accent); color: #fff; border-radius: 10px;
  font-size: 12px; min-width: 20px; padding: 1px 6px; text-align: center; font-weight: 600; }
.demo-bar { background: #fff4e0; color: #7a4a06; font-size: 13px; text-align: center; padding: 5px 16px; }

main { max-width: 1240px; margin: 0 auto; padding: 24px; min-height: 60vh; }
.foot { max-width: 1240px; margin: 0 auto; padding: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }

h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 19px; margin: 32px 0 12px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }

/* главная */
.hero { background: linear-gradient(120deg, var(--navy), #1d5277); color: #fff; border-radius: var(--radius); padding: 28px 32px; }
.hero h1 { font-size: 30px; }
.hero p { margin: 6px 0 0; max-width: 680px; opacity: .9; }
.hero .plane { display: inline-block; margin-top: 14px; background: rgba(255,255,255,.12); padding: 4px 12px; border-radius: 20px; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.sys h3 { margin: 0 0 8px; font-size: 16px; }
.sys ul { list-style: none; padding: 0; margin: 0; }
.sys li { padding: 4px 0; font-size: 14px; display: flex; gap: 8px; }
.sys li .n { color: var(--muted); min-width: 52px; font-size: 12px; padding-top: 2px; }
.sys li.off { color: #9aa6b1; }
.sys li a { font-weight: 600; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 8px; background: #e7f4ec; color: var(--ok); margin-left: 6px; vertical-align: 1px; }
.tag.ex { background: #f0f2f5; color: var(--muted); }
.kit { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.kit:hover { outline: 2px solid var(--accent); }
.kit .title { font-weight: 600; font-size: 16px; }
.kit .sum { margin-top: auto; font-weight: 600; color: var(--navy); }

/* узел */
.node { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.drawing { position: sticky; top: 76px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.drawing .wrap { position: relative; }
.drawing img { width: 100%; display: block; user-select: none; }
.dot { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 2px solid var(--accent); background: rgba(255,255,255,.35); padding: 0; transition: transform .12s, background .12s; }
.dot:hover, .dot:focus-visible { background: var(--hot); transform: scale(1.15); outline: none; }
.dot.sel { border-width: 3px; background: rgba(232, 144, 12, .3); box-shadow: 0 0 0 6px var(--hot); }
.dot.att { border-color: var(--navy); background: rgba(18,50,74,.15); }
.dot.dim { opacity: .25; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 4px 0; }
.serial { display: flex; gap: 8px; align-items: center; margin: 12px 0; flex-wrap: wrap; font-size: 14px; }
.serial input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; width: 150px; font: inherit; }
.serial .res { color: var(--muted); }

table.parts { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; font-size: 14px; }
.parts th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.parts td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.parts tr { cursor: pointer; }
.parts tbody tr:hover { background: #f7f9fb; }
.parts tr.sel { background: #fff4e0; }
.parts tr.att { background: #eef3f8; }
.parts tr.dim { opacity: .4; }
.parts tr.asm td { cursor: default; background: #fafbfc; font-size: 13px; }
.parts .idx { font-weight: 700; width: 34px; text-align: center; }
.parts .en { display: block; font-size: 12px; color: var(--muted); }
.parts .q { text-align: center; width: 44px; }
.parts .pr { text-align: right; white-space: nowrap; width: 90px; }
.pill { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 6px; background: #eef1f4; color: var(--muted); margin-left: 4px; }
.pill.f { background: #e6eef6; color: var(--navy); }
.pill.s { background: #e7f4ec; color: var(--ok); }

/* карточка детали */
.detail { margin-bottom: 14px; border-left: 4px solid var(--accent); }
.detail .head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.detail .big { font-size: 22px; font-weight: 700; }
.detail .pn { font-size: 18px; }
.detail dl { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; margin: 10px 0; font-size: 14px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.fix { background: #eef3f8; border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: 14px; }
.fix b { color: var(--navy); }
.fix a { cursor: pointer; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn { border: 0; border-radius: 9px; padding: 9px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.stock-ok { color: var(--ok); }
.stock-no { color: var(--warn); }

/* корзина */
.cart-row { display: grid; grid-template-columns: 1fr 120px 110px 32px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: #fff; }
.qty span { min-width: 28px; text-align: center; }
.x { border: 0; background: none; color: var(--muted); font-size: 20px; }
.total { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; flex-wrap: wrap; gap: 12px; }
.form { display: grid; gap: 8px; max-width: 520px; margin-top: 16px; }
.form input, .form textarea { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.empty { text-align: center; padding: 40px; }

.modal { position: fixed; inset: 0; background: rgba(10, 20, 30, .5); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal .box { background: #fff; border-radius: var(--radius); max-width: 560px; width: 100%; padding: 20px; }
.modal pre { background: #f4f6f8; padding: 12px; border-radius: 8px; white-space: pre-wrap; font-size: 13px; max-height: 50vh; overflow: auto; }

@media (max-width: 860px) {
  .top { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  main, .foot { padding: 16px; }
  .node { grid-template-columns: 1fr; }
  .drawing { position: static; padding: 6px; }
  .dot { width: 20px; height: 20px; margin: -10px 0 0 -10px; border-width: 1.5px; }
  .parts .en { display: none; }
  .parts th.code, .parts td.code { display: none; }
  .cart-row { grid-template-columns: 1fr auto; }
  .hero { padding: 22px 20px; }
}

/* цена со скидкой, промокод, согласие (сервер) */
s.old { color: var(--muted); font-weight: normal; margin-right: 4px; }
.promo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.promo input { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; width: 160px; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.consent input { margin-top: 3px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* каталог «В наличии» и карточка товара (склад) */
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn.ghost.light { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.cats .cat { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-decoration: none; color: inherit; }
.cats .cat .title { font-weight: 600; }
.cats .cat:hover, .prod:hover { outline: 2px solid var(--accent); }
.catalog { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.filters summary { font-weight: 600; cursor: pointer; }
.filters input[type=search] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; margin: 10px 0 6px; }
.filters fieldset { border: 0; padding: 0; margin: 12px 0 0; }
.filters legend { font-weight: 600; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.chk { display: flex; gap: 6px; align-items: center; font-size: 14px; padding: 2px 0; cursor: pointer; }
.prod { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; text-decoration: none; color: inherit; margin-bottom: 10px; }
.prod .title { font-weight: 600; }
.prod .sum { text-align: right; font-weight: 600; white-space: nowrap; }
.prod .line { grid-column: 1 / -1; font-size: 13px; }
.prod.ph { grid-template-columns: 64px minmax(0, 1fr) auto; }
.prod.ph .line { grid-column: 2 / -1; }
.prod .thumb { grid-row: span 3; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--line); }
.gallery { margin-bottom: 12px; }
.ph-main { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 8px; background: var(--line); }
.ph-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ph-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.ph-thumbs button.on { border-color: var(--accent); }
.ph-thumbs img { display: block; width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.product { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 12px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.offer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.offer .buy { grid-column: 1 / -1; }
.buy { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.num { width: 80px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; text-align: right; }
.pre { white-space: pre-wrap; }
@media (max-width: 860px) { .catalog, .product { grid-template-columns: 1fr; } }
