:root {
  --navy: #16337a; --primary: #1d4ed8; --primary-hover: #1e40af; --primary-soft: #e8efff; --on-primary: #fff;
  --accent: #f26b1d; --accent-hover: #d9590f; --on-accent: #fff;
  --bg: #f3f4f7; --card: #fff; --fg: #1a1d24; --heading: #11151c; --muted: #eef0f4; --muted-fg: #5b6270;
  --border: #e3e6ec; --border-strong: #cdd2dc; --danger: #c62828; --warn-bg: #fff4e5; --warn-fg: #8a4b00;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .05);
  --font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --head: "Rubik", var(--font);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--fg); background: var(--bg); }
h1, h2, h3 { font-family: var(--head); color: var(--heading); line-height: 1.2; margin: 0; font-weight: 600; }
a { color: var(--primary); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted-fg); }
.small { font-size: 13px; }

/* верхняя строка и шапка */
.topline { background: var(--navy); color: #dbe4ff; font-size: 13px; }
.topline-in { display: flex; align-items: center; gap: 18px; min-height: 34px; }
.topline a { color: #dbe4ff; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.topline a:hover { color: #fff; text-decoration: underline; }
.topline svg { width: 15px; height: 15px; }
.tl-wa { margin-left: auto; font-weight: 700; color: #fff !important; }
.top { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); }
.logo-mark { width: 42px; height: 42px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.logo-mark svg { width: 24px; height: 24px; }
.logo-t { display: flex; flex-direction: column; line-height: 1.1; }
.logo-t b { font: 700 23px var(--head); letter-spacing: -.01em; }
.logo-t small { font-size: 12px; color: var(--muted-fg); margin-top: 2px; }
.top-claim { display: flex; flex-direction: column; border-left: 1px solid var(--border); padding-left: 24px; line-height: 1.25; }
.top-claim b { font-family: var(--head); font-weight: 600; }
.top-claim span { color: var(--muted-fg); font-size: 13px; }
.wa-top { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px;
  background: #fff; border: 1px solid var(--border-strong); color: var(--heading); font-weight: 700; text-decoration: none; transition: border-color .2s, color .2s; }
.wa-top svg { color: #1aa34a; }
.wa-top:hover { border-color: #1aa34a; color: #13803a; }
.crumbs { padding-top: 20px; }
.crumbs h1 { font-size: 26px; }
.perks { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; }
.perks li { display: inline-flex; align-items: center; gap: 6px; }
.perks svg { color: var(--primary); }

/* раскладка */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 330px; gap: 18px; padding-top: 16px; padding-bottom: 40px; align-items: start; }
.steps { position: sticky; top: 84px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow); }
.step { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 10px; border: 0; border-radius: 8px; background: none;
  text-align: left; cursor: pointer; transition: background .15s; }
.step:hover { background: var(--muted); }
.step[aria-current="step"] { background: var(--primary-soft); }
.step[aria-current="step"] .st b { color: var(--primary); }
.step .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--muted); font: 600 12px var(--head); flex-shrink: 0; color: var(--muted-fg); }
.step .num svg { width: 15px; height: 15px; }
.step.done .num { background: var(--primary); color: #fff; }
.step .st { min-width: 0; }
.step .st b { display: block; font-size: 14px; font-weight: 700; }
.step .st span { display: block; font-size: 12px; color: var(--muted-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .st b .req { display: inline; color: var(--accent); }

.pick { min-width: 0; }
.pick-head { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.pick-head h2 { font-size: 22px; }
.pick-head p { margin: 4px 0 0; font-size: 14px; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.search { flex: 1 1 320px; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 12px; }
.search svg { color: var(--muted-fg); }
.search input { flex: 1; border: 0; min-height: 44px; background: none; outline: none; font-size: 15px; min-width: 0; }
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
select { min-height: 44px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--card); padding: 0 10px; cursor: pointer; }
.facets { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.facets:empty { display: none; }
.facet { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.facet-t { font-size: 12px; font-weight: 700; color: var(--muted-fg); min-width: 90px; }
.chip { min-height: 34px; padding: 3px 12px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--card); cursor: pointer; font-size: 14px;
  transition: background .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .n { opacity: .6; font-size: 12px; margin-left: 4px; }

/* товары */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: grid; grid-template-columns: 104px minmax(0, 1fr) 190px; gap: 16px; align-items: center; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; transition: box-shadow .15s, border-color .15s; }
.item:hover { box-shadow: 0 4px 16px rgba(16, 24, 40, .08); }
.item.sel { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.ph { width: 104px; height: 104px; border-radius: 8px; background: #fff; border: 0; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; padding: 0; }
.ph img { width: 100%; height: 100%; object-fit: contain; }
.ph.none { cursor: default; background: var(--muted); color: var(--muted-fg); font-size: 12px; }
.info { min-width: 0; }
.name { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; color: var(--heading); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; font-size: 13px; }
.tag { background: var(--muted); color: var(--heading); border-radius: 4px; padding: 1px 7px; font-weight: 600; font-size: 12px; }
.buy { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.price { font: 700 22px var(--head); color: var(--heading); white-space: nowrap; text-align: right; }
.qty { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; height: 40px; align-self: flex-end; }
.qty button { width: 38px; border: 0; background: var(--muted); cursor: pointer; font-size: 18px; }
.qty span { min-width: 34px; display: grid; place-items: center; font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; font-weight: 700; transition: background .15s, border-color .15s, color .15s; }
.btn.pri { background: var(--primary); color: var(--on-primary); }
.btn.pri:hover { background: var(--primary-hover); }
.btn.sel { background: var(--card); color: var(--primary); border-color: var(--primary); }
.btn.cta { background: var(--accent); color: var(--on-accent); width: 100%; font-size: 16px; min-height: 50px; }
.btn.cta:hover { background: var(--accent-hover); }
.btn.wide { width: 100%; margin-top: 8px; }
.btn.ghost { background: var(--card); border-color: var(--border-strong); color: var(--heading); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.empty { background: var(--card); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted-fg); }
.more { text-align: center; margin-top: 14px; }

/* сборка */
.summary { position: sticky; top: 84px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  max-height: calc(100vh - 100px); overflow-y: auto; }
.summary h2 { font-size: 19px; margin-bottom: 8px; }
.build { list-style: none; padding: 0; margin: 0 0 10px; }
.build li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--muted); font-size: 13.5px; }
.build .bt { font-size: 12px; color: var(--muted-fg); font-weight: 700; grid-column: 1 / -1; display: flex; justify-content: space-between; }
.build .bn { overflow-wrap: anywhere; }
.build .bp { font-weight: 700; white-space: nowrap; }
.build .x { border: 0; background: none; color: var(--danger); cursor: pointer; font-size: 12px; padding: 0; font-weight: 700; }
.build .missing { color: var(--muted-fg); }
.warn:empty { display: none; }
.warn { background: var(--warn-bg); color: var(--warn-fg); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 10px; }
.warn p { margin: 0 0 4px; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 12px; font-size: 16px; }
.total b { font: 700 26px var(--head); color: var(--heading); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.row2 .btn { padding: 0 8px; font-size: 14px; }
.mbar { display: none; }

/* окно данных покупателя */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(17, 21, 28, .5); }
dialog form { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
dialog label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
dialog input { min-height: 44px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 12px; font-size: 16px; }

/* увеличение фото */
.zoom { position: fixed; z-index: 60; background: #fff; border-radius: 12px; border: 1px solid var(--border-strong);
  box-shadow: 0 20px 50px rgba(16, 24, 40, .25); padding: 10px; pointer-events: none; }
.zoom img { width: 100%; height: 100%; object-fit: contain; }
.lb { position: fixed; inset: 0; z-index: 70; background: rgba(17, 21, 28, .88); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 20px; cursor: zoom-out; }
.lb img { max-width: min(96vw, 900px); max-height: 78vh; background: #fff; border-radius: 12px; padding: 10px; object-fit: contain; }
.lb p { color: #fff; max-width: 860px; text-align: center; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--heading); color: #fff; padding: 12px 18px; border-radius: 8px;
  z-index: 80; max-width: calc(100vw - 32px); }
.foot { background: var(--navy); color: #dbe4ff; padding: 22px 0 90px; font-size: 14px; margin-top: 10px; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.foot a { color: #fff; }

@media (max-width: 1200px) {
  .layout { grid-template-columns: 210px minmax(0, 1fr) 290px; gap: 12px; }
  .item { grid-template-columns: 84px minmax(0, 1fr); }
  .ph { width: 84px; height: 84px; }
  .buy { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .price { text-align: left; }
  .top-claim { display: none; }
}
@media (max-width: 900px) {
  .topline .addr:nth-child(2) { display: none; }
  .wa-top span { display: none; }
  .wa-top { padding: 0 12px; }
  .logo-t b { font-size: 20px; }
  .crumbs h1 { font-size: 21px; }
  .perks li:nth-child(n+3) { display: none; }
  .layout { grid-template-columns: 1fr; padding-top: 10px; }
  .steps { position: sticky; top: 68px; z-index: 20; display: flex; overflow-x: auto; border-radius: 0; margin: 0 -16px; padding: 6px 16px; scrollbar-width: none; gap: 4px; }
  .step { width: auto; flex-shrink: 0; min-height: 44px; }
  .step .st span { display: none; }
  .summary { position: fixed; inset: auto 0 0 0; top: auto; max-height: 85vh; border-radius: 16px 16px 0 0; z-index: 40; transform: translateY(110%); transition: transform .25s ease; }
  .summary.open { transform: none; }
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--card); border-top: 1px solid var(--border); padding: 10px 16px; box-shadow: 0 -4px 16px rgba(16, 24, 40, .1); }
  .mbar .btn { width: auto; min-height: 46px; }
  .mbar b { font: 700 19px var(--head); }
  .zoom { display: none; }
}
@media (max-width: 520px) {
  .item { gap: 10px; padding: 10px; }
  .price { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
