/* Схема подбора товара (#1212). Цвета — из темы схемы (style на .scheme). */

@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url(../fonts/oswald-cyrillic-wght.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url(../fonts/oswald-latin-wght.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

.scheme {
    --scheme-dim: 0.3;
    --scheme-line: 3px;
    --scheme-heading: inherit;
    background: var(--scheme-bg);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--scheme-radius);
    padding: 28px 16px 32px;
    margin-block: 32px; /* в статье блок идёт между абзацами — не прилипать к тексту */
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: #0f172a;
}
.scheme--font-oswald { --scheme-heading: 'Oswald', var(--font-display, sans-serif); }
/* Ключ golos — из ТЗ; Golos Text на сайте нет, лишний веб-шрифт не грузим — берём шрифт сайта. */
.scheme--font-golos { --scheme-heading: var(--font-display, sans-serif); }

.scheme__head { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.scheme__title {
    margin: 0;
    font-family: var(--scheme-heading);
    font-weight: 700;
    font-size: clamp(24px, 4vw, 40px);
    line-height: 1.1;
    letter-spacing: .01em;
    text-transform: uppercase;
}
.scheme__subtitle { margin: 0; font-size: 17px; color: #334155; }

/* Цепочка выбранных ответов */
.scheme__crumbs { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 30px; }
.scheme__crumbs[hidden] { display: none; }
.scheme__crumb {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
    border: 0; border-radius: 999px; cursor: pointer;
    background: color-mix(in srgb, var(--scheme-main) 12%, #fff); color: #0f172a;
    font: inherit; font-weight: 500; font-size: 13px; line-height: 1;
}
.scheme__crumb:hover { background: color-mix(in srgb, var(--scheme-main) 22%, #fff); }
.scheme__reset { border: 0; background: none; cursor: pointer; color: var(--scheme-main); font-weight: 600; font-size: 14px; }
.scheme__hint { font-size: 14px; color: #64748b; }

/* ── Без JS: вложенное дерево ─────────────────────────────────────────── */
.scheme__canvas { position: relative; }
.scheme-branch { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.scheme-branch__answers { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 16px; }
.scheme-branch__answer { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ── Элементы ─────────────────────────────────────────────────────────── */
.scheme-q {
    display: flex; align-items: center; gap: 14px;
    box-sizing: border-box; max-width: 340px; min-height: 64px; padding: 10px 18px;
    border: 2px solid var(--scheme-main); border-radius: var(--scheme-radius);
    background: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--scheme-main) 22%, #fff);
    transition: opacity .25s, box-shadow .25s;
}
.scheme-q__icon { width: 44px; height: 44px; flex-shrink: 0; color: var(--scheme-main); }
.scheme-q__icon svg, .scheme-q__icon img { width: 100%; height: 100%; object-fit: contain; }
.scheme-q__text { font-size: 18px; line-height: 1.3; font-weight: 600; }

.scheme-a {
    /* Окантовка: свой цвет ответа (--scheme-border), иначе цвет кнопки. */
    --scheme-a-edge: var(--scheme-border, var(--scheme-answer, var(--scheme-main)));
    --scheme-a-glow: 0 0 0 0 transparent;
    box-sizing: border-box; cursor: pointer; font: inherit;
    border: 2px solid var(--scheme-a-edge);
    background: var(--scheme-answer, #fff); color: var(--scheme-on-answer, var(--scheme-main));
    box-shadow: var(--scheme-a-glow);
    transition: opacity .25s, box-shadow .25s, background .25s, color .25s;
}
/* Заливка не под рамкой — иначе пунктир того же цвета, что кнопка, не виден. */
.scheme-a--dashed { border-style: dashed; background-clip: padding-box; }
.scheme-a--dotted { border-style: dotted; background-clip: padding-box; }
.scheme-a--glow { --scheme-a-glow: 0 0 14px 2px color-mix(in srgb, var(--scheme-a-edge) 60%, transparent); }
.scheme-a:focus-visible { outline: 3px solid color-mix(in srgb, var(--scheme-main) 45%, transparent); outline-offset: 2px; }
.scheme-a--pill {
    min-width: 72px; height: 38px; padding: 0 18px; border-radius: 999px;
    font-weight: 700; font-size: 16px;
}
.scheme-a--option {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-width: 120px; max-width: 200px; min-height: 56px; padding: 6px 14px;
    border-radius: var(--scheme-radius); font-weight: 600; font-size: 15px; line-height: 1.2; text-align: center;
}
.scheme-a__hint { font-size: 12.5px; font-weight: 500; opacity: .85; }
.scheme-a--pill .scheme-a__hint { display: none; }
.scheme-a--outline[aria-pressed="true"] { background: var(--scheme-main); color: var(--scheme-on-main); }
.scheme-a[aria-pressed="true"] { box-shadow: 0 0 0 4px color-mix(in srgb, var(--scheme-a-edge) 28%, transparent), var(--scheme-a-glow); }

/* ── Анимация ответов текущего вопроса (тема: answer_animation) ───────── */
.scheme-branch__answer:nth-child(2) > .scheme-a, .scheme__steps-answers > .scheme-a:nth-child(2) { --scheme-a-delay: .15s; }
.scheme-branch__answer:nth-child(3) > .scheme-a, .scheme__steps-answers > .scheme-a:nth-child(3) { --scheme-a-delay: .3s; }
.scheme-branch__answer:nth-child(4) > .scheme-a, .scheme__steps-answers > .scheme-a:nth-child(4) { --scheme-a-delay: .45s; }
.scheme-branch__answer:nth-child(5) > .scheme-a, .scheme__steps-answers > .scheme-a:nth-child(5) { --scheme-a-delay: .6s; }
.scheme--anim-pulse .scheme-a.is-current { animation: scheme-pulse 1.6s ease-out var(--scheme-a-delay, 0s) infinite; }
.scheme--anim-bounce .scheme-a.is-current { animation: scheme-bounce 1.8s ease-in-out var(--scheme-a-delay, 0s) infinite; }
.scheme--anim-sway .scheme-a.is-current { animation: scheme-sway 2.2s ease-in-out var(--scheme-a-delay, 0s) infinite; }
/* Блик — полоса поверх кнопки. На холсте кнопка и так position: absolute, правило ниже его не перебивает. */
.scheme--anim-shine .scheme-a.is-current { position: relative; overflow: hidden; }
.scheme--anim-shine .scheme-a.is-current::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(110deg, transparent 30%, var(--scheme-a-shine, rgba(255, 255, 255, .55)) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: scheme-shine 2.6s ease-in-out var(--scheme-a-delay, 0s) infinite;
}
.scheme-a--outline { --scheme-a-shine: color-mix(in srgb, var(--scheme-main) 30%, transparent); }
/* Под курсором кнопка замирает — по движущейся сложнее попасть. */
.scheme-a.is-current:hover { animation-play-state: paused; }

@keyframes scheme-pulse {
    0% { box-shadow: var(--scheme-a-glow), 0 0 0 0 color-mix(in srgb, var(--scheme-a-edge) 55%, transparent); filter: none; }
    35% { filter: brightness(1.12); }
    70%, 100% { box-shadow: var(--scheme-a-glow), 0 0 0 10px color-mix(in srgb, var(--scheme-a-edge) 0%, transparent); filter: none; }
}
@keyframes scheme-bounce {
    0%, 40%, 100% { transform: translateY(0); }
    15% { transform: translateY(-7px); }
    25% { transform: translateY(0); }
    32% { transform: translateY(-3px); }
}
@keyframes scheme-sway {
    0%, 50%, 100% { transform: rotate(0); }
    10% { transform: rotate(-4deg); }
    20% { transform: rotate(3deg); }
    30% { transform: rotate(-2deg); }
    40% { transform: rotate(1deg); }
}
@keyframes scheme-shine {
    0% { transform: translateX(-120%); }
    45%, 100% { transform: translateX(120%); }
}

.scheme-r {
    box-sizing: border-box; width: 230px; display: flex; flex-direction: column; overflow: hidden;
    border: 2px solid var(--scheme-main); border-radius: var(--scheme-radius); background: #fff;
    transition: opacity .25s, box-shadow .25s, border-color .25s;
}
.scheme-r--double { width: 380px; }
.scheme-r__head {
    background: var(--scheme-main); color: var(--scheme-on-main); text-align: center; padding: 7px 8px;
    font-family: var(--scheme-heading); font-weight: 600; font-size: 14px; letter-spacing: .06em;
    transition: background .25s;
}
.scheme-r__products { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); flex-grow: 1; }
.scheme-r--double .scheme-r__products { grid-template-columns: 1fr 1fr; }
.scheme-r--double .scheme-r__product + .scheme-r__product { border-left: 1px solid #e2e8f0; }
.scheme-r__product { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; min-width: 0; }
.scheme-r__photo { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #f1f5f9; }
.scheme-r__photo img { width: 100%; height: 100%; object-fit: contain; }
.scheme-r__name {
    color: #0f172a; text-align: center; text-decoration: none;
    font-family: var(--scheme-heading); font-weight: 700; font-size: 24px; line-height: 1.1; overflow-wrap: anywhere;
}
.scheme-r--double .scheme-r__name { font-size: 20px; }
.scheme-r__name:hover { color: var(--scheme-main); }
.scheme-r__subtitle { margin: 0; text-align: center; font-size: 13px; font-weight: 600; color: #334155; }
.scheme-r__price { margin: 0; text-align: center; font-weight: 700; font-size: 15px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.scheme-r__stock { font-size: 12px; font-weight: 600; color: var(--color-success, #15803d); }
.scheme-r__benefits { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.scheme-r__benefits li { display: flex; gap: 8px; font-size: 13px; line-height: 1.3; color: #334155; }
.scheme-r__benefit-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--scheme-main); border: 1.5px solid currentColor; border-radius: 50%; box-sizing: border-box; }
.scheme-r__benefit-icon:has(svg, img) { border: 0; }
.scheme-r__benefit-icon svg, .scheme-r__benefit-icon img { width: 100%; height: 100%; object-fit: contain; }
.scheme-r__go {
    margin-top: auto; display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 10px;
    border: 0; border-radius: 8px; cursor: pointer; text-decoration: none; text-align: center;
    background: var(--scheme-main); color: var(--scheme-on-main); font: inherit; font-weight: 600; font-size: 14px; line-height: 1.2;
    transition: background .25s, filter .2s;
}
.scheme-r__go:hover { filter: brightness(1.08); }
.scheme-r__engineer { display: flex; flex-direction: column; gap: 12px; padding: 14px 12px 12px; flex-grow: 1; }
.scheme-r__engineer-text { margin: 0; font-size: 14px; line-height: 1.4; color: #334155; text-align: center; }

/* ── Состояния ────────────────────────────────────────────────────────── */
.scheme .is-dim { opacity: var(--scheme-dim); }
.scheme-q.is-next { box-shadow: 0 0 0 5px color-mix(in srgb, var(--scheme-main) 20%, transparent), 0 3px 0 color-mix(in srgb, var(--scheme-main) 22%, #fff); }
.scheme-r.is-won {
    border-color: var(--scheme-win);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--scheme-win) 20%, transparent), 0 10px 24px rgba(15, 23, 42, .12);
}
.scheme-r.is-won .scheme-r__head,
.scheme-r.is-won .scheme-r__go { background: var(--scheme-win); color: var(--scheme-on-win); }

/* ── Раскладка на холсте (scheme-layout.js) ───────────────────────────── */
.scheme.is-laid-out .scheme__canvas { transform-origin: top left; }
.scheme.is-laid-out .scheme-branch,
.scheme.is-laid-out .scheme-branch__answers,
.scheme.is-laid-out .scheme-branch__answer { display: contents; }
.scheme.is-laid-out .scheme__canvas .scheme-q,
.scheme.is-laid-out .scheme__canvas .scheme-a,
.scheme.is-laid-out .scheme__canvas .scheme-r { position: absolute; margin: 0; z-index: 1; }
.scheme.is-laid-out .scheme__canvas .scheme-q,
.scheme.is-laid-out .scheme__canvas .scheme-a--option { width: max-content; }
/* Холст в колонке статьи уменьшается — текст карточек укрупняем на --scheme-boost (scheme.js),
   чтобы на экране он оставался читаемым. Ширины карточек не трогаем: растёт только высота. */
.scheme.is-laid-out .scheme__canvas .scheme-q__text { font-size: calc(18px * var(--scheme-boost, 1)); }
.scheme.is-laid-out .scheme__canvas .scheme-a--pill { font-size: calc(16px * var(--scheme-boost, 1)); height: calc(38px * var(--scheme-boost, 1)); }
.scheme.is-laid-out .scheme__canvas .scheme-a--option { font-size: calc(15px * var(--scheme-boost, 1)); }
.scheme.is-laid-out .scheme__canvas .scheme-a__hint { font-size: calc(12.5px * var(--scheme-boost, 1)); }
.scheme.is-laid-out .scheme__canvas .scheme-r__subtitle,
.scheme.is-laid-out .scheme__canvas .scheme-r__benefits li { font-size: calc(13px * var(--scheme-boost, 1)); }
.scheme.is-laid-out .scheme__canvas .scheme-r__price { font-size: calc(15px * var(--scheme-boost, 1)); }
.scheme.is-laid-out .scheme__canvas .scheme-r__stock { font-size: calc(12px * var(--scheme-boost, 1)); }
.scheme.is-laid-out .scheme__canvas .scheme-r__engineer-text { font-size: calc(14px * var(--scheme-boost, 1)); }
/* Кнопка в половине двойной карточки — укрупняем меньше, иначе «Перейти к товару →» в две строки. */
.scheme.is-laid-out .scheme__canvas .scheme-r__go { font-size: calc(14px * min(var(--scheme-boost, 1), 1.15)); }
.scheme.is-laid-out .scheme__canvas .scheme-r--double .scheme-r__go { font-size: 14px; }
/* Уменьшенный холст: рамка с итоговым размером и обрезкой. Без неё область прокрутки
   в части браузеров считается по исходному, неуменьшенному холсту. */
.scheme__scroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; }
/* padding — место под кольцо выбранной карточки у края (FRAME_PAD в scheme.js). */
.scheme__frame { box-sizing: content-box; padding: 10px; margin: 0 auto; overflow: hidden; overflow: clip; }
.scheme.is-steps .scheme__scroll { display: none; }
.scheme-line { position: absolute; background: var(--scheme-line-color, var(--scheme-main)); transition: opacity .25s, background .25s; z-index: 0; }
.scheme-line.is-dim { background: #cbd5e1; opacity: .6; }

/* ── По шагам (узкий экран или show_full_scheme=0) ────────────────────── */
.scheme__steps { display: none; flex-direction: column; align-items: center; gap: 14px; }
.scheme.is-steps .scheme__canvas { display: none; }
.scheme.is-steps .scheme__steps { display: flex; }
.scheme__steps .scheme-q { width: 100%; max-width: 420px; }
.scheme__steps-answers { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; max-width: 420px; }
.scheme__steps-answers .scheme-a { flex: 1 1 120px; max-width: none; }
.scheme__steps .scheme-r { width: 100%; max-width: 420px; }
.scheme__steps-progress { font-size: 13px; color: #64748b; }

/* «Получить подбор на почту» — под достигнутым результатом */
.scheme__email {
    margin: 22px auto 0; max-width: 560px; padding: 18px 20px; border-radius: var(--scheme-radius);
    background: color-mix(in srgb, var(--scheme-main) 8%, #fff); border: 1px solid color-mix(in srgb, var(--scheme-main) 25%, #fff);
    display: flex; flex-direction: column; gap: 10px; position: relative;
}
.scheme__email[hidden] { display: none; }
.scheme__email-title { margin: 0; font-family: var(--scheme-heading); font-weight: 700; font-size: 18px; color: #0f172a; }
.scheme__email-text { margin: 0; font-size: 14px; color: #475569; }
.scheme__email-row { display: flex; gap: 8px; flex-wrap: wrap; }
.scheme__email-input {
    flex: 1 1 220px; min-width: 0; height: 44px; padding: 0 14px; font-size: 15px;
    border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a;
}
/* Форма «Спросить инженера»: поля столбиком, без строки .scheme__email-row. */
.scheme__email > .scheme__email-input { flex: none; }
.scheme__email > .scheme__email-submit { align-self: flex-start; }
.scheme__email-input--area { height: auto; padding: 10px 14px; line-height: 1.4; resize: vertical; font-family: inherit; }
.scheme__email-input:focus { outline: 2px solid var(--scheme-main); outline-offset: 1px; border-color: transparent; }
.scheme__email-submit {
    flex: 0 0 auto; height: 44px; padding: 0 20px; border: 0; border-radius: 8px; cursor: pointer;
    background: var(--scheme-main); color: var(--scheme-on-main); font-weight: 600; font-size: 15px;
}
.scheme__email-submit:disabled { opacity: .6; cursor: default; }
.scheme__email-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.scheme__email-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.4; color: #64748b; }
.scheme__email-consent input { margin-top: 2px; flex-shrink: 0; }
.scheme__email-consent a { color: inherit; text-decoration: underline; }
.scheme__email-status { margin: 0; font-size: 14px; }
.scheme__email-status:empty { display: none; }
.scheme__email-status.is-error { color: var(--color-danger, #b91c1c); }
.scheme__email-status.is-done { color: var(--color-success, #15803d); font-weight: 600; }

/* Подвал */
.scheme__footer {
    list-style: none; margin: 6px 0 0; padding: 22px 0 0; border-top: 1px solid var(--color-border, #e2e8f0);
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px;
}
.scheme__footer-link { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: 15px; font-weight: 500; color: #0f172a; text-decoration: none; }
a.scheme__footer-link:hover { color: var(--scheme-main); }
.scheme__footer-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--scheme-main); color: var(--scheme-on-main); display: flex; align-items: center; justify-content: center; }
.scheme__footer-icon svg, .scheme__footer-icon img { width: 32px; height: 32px; object-fit: contain; }

@media (max-width: 640px) {
    .scheme { padding: 20px 12px 24px; }
    .scheme__subtitle { font-size: 15px; }
    .scheme__footer-icon { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
    .scheme *, .scheme-line { transition: none !important; }
    .scheme-a, .scheme-a::after { animation: none !important; }
}
