/* Мастер подбора: шаги, живая сводка, итог, форма «пришлите фото дома» */
.page-wizard section[id] { scroll-margin-top: 150px; }
.wz-top { padding-bottom: 20px; }
.wz-top h1 { margin-top: 4px; font-weight: 800; font-size: clamp(28px, 2vw + 14px, 40px); line-height: 1.1; letter-spacing: -.02em; }
.wz-lead { max-width: 72ch; margin-top: 10px; color: var(--c-text-muted); font-size: 16px; }
.wz-progress { display: none; margin-top: 18px; scroll-margin-top: 130px; }
.wz-progress__t { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 14px; color: var(--c-text-muted); }
.wz-progress__t b { color: var(--c-ink); }
.wz-progress__bar { height: 6px; border-radius: 3px; background: var(--c-tile); overflow: hidden; }
.wz-progress__bar i { display: block; height: 100%; width: 20%; border-radius: 3px; background: var(--c-primary); transition: width .25s; }

.wz { padding-block: 8px 56px; background: var(--c-bg); }
.wz__grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.wz__steps { display: grid; gap: 16px; min-width: 0; }
.wz__aside { position: sticky; top: 144px; }

/* Шаг */
.wz-step { display: block; padding: 26px 28px; border-radius: var(--r-lg); background: var(--c-bg); box-shadow: var(--sh-1); border: 1px solid var(--c-line); }
.wz-step__h { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.wz-step__h i { font-style: normal; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--c-primary); color: var(--c-on-dark); display: grid; place-items: center; font-weight: 700; }
.wz-step__h h2 { font-size: 22px; font-weight: 800; }
.wz-field { margin-bottom: 20px; }
.wz-field:last-child { margin-bottom: 0; }
.wz-field--pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.wz-lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: var(--c-ink); }
.wz-lbl small { font-weight: 500; font-size: 13px; color: var(--c-text-muted); }
.wz-help { margin-top: 4px; font-size: 14px; color: var(--c-text-muted); }
.wz-split { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.wz .opt-group--wide { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

/* Схемы-подсказки: только линии */
.wz-hint { margin: 0; padding: 12px; border-radius: 10px; background: var(--c-surface); color: var(--c-primary); }
.wz-hint svg { width: 100%; height: auto; }
.wz-hint figcaption { margin-top: 8px; font-size: 13px; color: var(--c-text-muted); text-align: center; }
.wzs-line { fill: none; stroke: var(--c-ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.wzs-gut { fill: var(--c-primary-soft); stroke: var(--c-primary); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.wzs-ext { fill: none; stroke: var(--c-border-strong); stroke-width: 1.5; stroke-dasharray: 4 4; }
.wzs-dim { fill: none; stroke: var(--c-primary); stroke-width: 2.5; }
.wzs-txt { fill: var(--c-text-muted); font: 600 12px var(--font-body); }

/* Совет про два слива */
.wz-advice { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 20px; padding: 14px 16px; border-radius: 8px; background: var(--c-warning-bg); color: var(--c-warning-text); font-weight: 500; }
.wz-advice .ico { flex: none; }
.wz-advice span { flex: 1 1 220px; }
.wz-advice .btn { height: 40px; }

/* Серии карточками */
.wz-series { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wz-ser { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border-radius: 8px; border: 1.5px solid var(--c-line-strong); background: var(--c-bg); text-align: left; transition: border-color .15s, background-color .15s; }
.wz-ser b { font: 700 16px/1.25 var(--font-heading); color: var(--c-ink); }
.wz-ser span { font-size: 13px; color: var(--c-text-muted); }
.wz-ser em { margin-top: 6px; font: 800 18px/1 var(--font-heading); font-style: normal; color: var(--c-ink); }
.wz-ser:hover { border-color: var(--c-primary); }
.wz-ser[aria-pressed="true"] { border-color: var(--c-primary); background: var(--c-primary-soft); box-shadow: 0 0 0 1px var(--c-primary); }

.wz-nav { display: none; gap: 12px; }
.wz-nav .btn { flex: 1; }

/* Сводка справа */
.wz-sum h2 { font-size: 20px; }
.wz-sum__t { font-weight: 600; color: var(--c-ink); line-height: 1.3; }
.wz-sum__rows { display: grid; gap: 8px; padding-block: 8px; border-block: 1px dashed var(--c-line-strong); }

/* Итог */
.wz-gap { margin-top: 36px; }
.wz-match__card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0; overflow: hidden; border-radius: var(--r-lg); background: var(--c-bg); box-shadow: var(--sh-2); }
.wz-match__pic { display: grid; place-items: center; min-height: 280px; padding: 20px; background: radial-gradient(110% 85% at 50% 38%, var(--c-bg) 0%, var(--c-tile) 100%); }
.wz-match__pic svg { width: min(100%, 380px); height: auto; }
.wz-match__pic img { width: min(100%, 380px); height: auto; max-height: 380px; object-fit: contain; mix-blend-mode: multiply; }
.wz-match__body { display: grid; gap: 12px; align-content: center; padding: 28px 32px; }
.wz-match__body .tag { justify-self: start; }
.wz-match__body h3 { font-size: clamp(20px, 1vw + 14px, 26px); font-weight: 800; line-height: 1.2; }
.wz-match__s { color: var(--c-text-muted); }
.wz-match__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; }
.wz-match__price .price b { font-size: 36px; }
.wz-match__btns { display: flex; flex-wrap: wrap; gap: 10px; }
.wz-parts { border-radius: 8px; background: var(--c-surface); padding: 12px 14px; }
.wz-parts summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--c-primary); }
.wz-parts summary::-webkit-details-marker { display: none; }
.wz-parts summary .ico { width: 18px; height: 18px; transition: transform .2s; }
.wz-parts[open] summary .ico { transform: rotate(180deg); }
.wz-parts ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.wz-parts li { display: flex; gap: 8px; align-items: baseline; }
.wz-parts li span { flex: 1; border-bottom: 1px dotted var(--c-line-strong); }
.wz-parts li b { font-weight: 600; color: var(--c-ink); }

/* Добавки — внутри карточки подобранного комплекта, сразу под кнопками */
.wz-extras { display: grid; gap: 10px; margin-top: 6px; padding-top: 16px; border-top: 1px dashed var(--c-line-strong); scroll-margin-top: 150px; }
.wz-extras__h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.wz-extras__h h4 { font-size: 17px; font-weight: 800; color: var(--c-ink); }
.wz-extras__h span { font-size: 13px; color: var(--c-text-muted); }
.wz-match__body .wz-extras__box { padding: 14px 16px; box-shadow: none; background: var(--c-surface); }
.wz-extras__box { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 22px 24px; border-radius: var(--r-lg); background: var(--c-bg); box-shadow: var(--sh-1); }
.wz-extras__box > .ico { width: 32px; height: 32px; color: var(--c-primary); flex: none; }
.wz-extras__box > div { flex: 1 1 280px; min-width: 0; }
.wz-extras__box b { color: var(--c-ink); }
.wz-extras__box p { margin-top: 4px; color: var(--c-text-muted); font-size: 14.5px; }
.wz-extras__foot { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.wz-extras__foot b { font: 800 20px var(--font-heading); }
.wz-tiles { flex: 1 1 100%; display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.wz-tile { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 96px; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-bg); }
.wz-tile.is-locked { background: var(--c-surface); }
.wz-tile.is-out .wz-tile__t > b { color: var(--c-text-muted); }
.wz-tile__pic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 6px; background: var(--c-tile); overflow: hidden; }
.wz-tile__pic img { width: 100%; height: 100%; padding: 4px; object-fit: contain; mix-blend-mode: multiply; }
.wz-tile__pic .ico { color: var(--c-text-muted); }
.wz-tile__t { display: grid; gap: 2px; min-width: 0; }
.wz-tile__t > b { font-weight: 700; color: var(--c-ink); }
.wz-tile__t > small { font-size: 13px; color: var(--c-text-muted); }
.wz-tile__t > .wz-tile__why { color: var(--c-body); }
.wz-tile__q { display: flex; align-items: center; gap: 6px; }
.wz-tile__q .qty { grid-template-columns: 40px auto 40px; min-width: 132px; }
.wz-tile__n { font-weight: 700; color: var(--c-ink); }
.wz-tile__x { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 6px; color: var(--c-text-muted); }
.wz-tile__x:hover { background: var(--c-surface); color: var(--c-ink); }
.wz-tile__sum { text-align: right; white-space: nowrap; }
.wz-extras__btns { display: flex; flex-wrap: wrap; gap: 10px; }
.wz-extras__more { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--c-primary); }
.wz-count { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--c-line-strong); border-radius: var(--r-lg); }
.wz-count__b { display: grid; place-items: center; width: 44px; height: 44px; color: var(--c-ink); }
.wz-count__b:disabled { color: var(--c-text-muted); cursor: default; }
.wz-count output { min-width: 32px; text-align: center; font-weight: 700; }
.wz-others { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* Фото дома */
.wz-photo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.wz-photo__text { display: grid; gap: 14px; align-content: start; }
.wz-photo__text h2 { font-size: clamp(24px, 1.2vw + 15px, 32px); font-weight: 800; }
.wz-photo__text p { max-width: 52ch; color: var(--c-text-muted); font-size: 16px; }
.wz-photo .ask__i { width: 56px; height: 56px; border-radius: 9px; background: var(--c-primary-soft); color: var(--c-primary); display: grid; place-items: center; }
.wz-photo .ask__i .ico { width: 30px; height: 30px; }
.wz-photo .form-card { box-shadow: var(--sh-2); }

/* Итог на телефоне виден, когда дошли до последнего шага */
body.page-wizard #result { display: none; }
body.page-wizard[data-wz-step="5"] #result { display: block; }

@media (min-width: 960px) {
  body.page-wizard #result { display: block; }
}
@media (max-width: 959px) {
  .wz__grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .wz__aside { display: none; }
  .wz-progress { display: block; }
  .wz-step { display: none; padding: 20px 18px; }
  .wz-step.is-cur { display: block; }
  .wz-nav { display: flex; }
  .wz-nav [hidden] { display: none; }
  .wz-match__card { grid-template-columns: 1fr; }
  .wz-match__pic { min-height: 200px; }
  .wz-match__body { padding: 20px; }
  .wz-others { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wz-photo { grid-template-columns: 1fr; }
  .wz { padding-bottom: 32px; }
}
@media (max-width: 640px) {
  .wz-split { grid-template-columns: 1fr; }
  .wz-hint { order: -1; }
  .wz-series { grid-template-columns: 1fr; }
  .wz-field--pair { grid-template-columns: 1fr; }
  .wz-match__price .price b { font-size: 30px; }
  .wz-tile { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .wz-tile__pic { width: 56px; height: 56px; }
  .wz-tile__t { grid-column: 2 / 4; }
  .wz-tile__q { grid-column: 1 / 3; grid-row: 2; }
  .wz-tile__q .qty { min-width: 120px; }
  .wz-tile__sum { grid-column: 3; grid-row: 2; }
}

