/* =====================================================================
   ПАНЕЛЬ УПРАВЛЕНИЯ КОНСТРУКТОРОМ НА ГЛАВНОЙ СТРАНИЦЕ
   ===================================================================== */

.calc-toolbar {
    --ct-green: #27a32b;
    --ct-green-dark: #1d7f21;
    --ct-ink: #2b3a30;
    width: 100%;
    max-width: 100%;
    margin: 14px 0 16px 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    overflow-x: hidden;
}

.calc-toolbar__bar {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f7faf7;
    border: 1px solid #d2e6d2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    max-width: 100%;
    box-sizing: border-box;
}

.calc-toolbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 38px;
    min-width: 230px;
    max-width: 100%;
    padding: 6px 14px 6px 10px;
    border: 1px solid #d4e8d4;
    border-radius: 8px;
    font: 600 13.5px/1.2 inherit;
    font-family: inherit;
    color: var(--ct-ink);
    background: #ffffff;
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.calc-toolbar__btn:hover {
    background: #eaf5ea;
    border-color: #b3dfb5;
    color: #1a6b1d;
    box-shadow: 0 2px 6px rgba(39,163,43,0.12);
}
.calc-toolbar__btn:active { transform: scale(0.98); }
.calc-toolbar__btn:focus-visible {
    outline: 2px solid #27a32b;
    outline-offset: 1px;
}

.calc-toolbar__label {
    flex: 0 1 auto;
    text-align: center;
}

.calc-toolbar__icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #27a32b;
    transition: transform .3s ease, background-color .2s ease;
}
.calc-toolbar__icon svg { width: 14px; height: 14px; display: block; }

/* Кнопка свернуть: при сворачивании меняет вид */
.calc-toolbar__btn--toggle[aria-expanded="false"] .calc-toolbar__icon { transform: rotate(180deg); }
.calc-toolbar__btn--toggle[aria-expanded="false"] {
    background: #27a32b;
    color: #fff;
    border-color: #1d7f21;
}
.calc-toolbar__btn--toggle[aria-expanded="false"] .calc-toolbar__icon {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Кнопка для слабовидящих */
.calc-toolbar__btn--a11y .calc-toolbar__icon {
    background: #3c4a41;
}
/* Включённый режим — без тёмного фона: светло-жёлтая плашка, чёрный текст и рамка */
.calc-toolbar__btn--a11y[aria-pressed="true"],
.calc-toolbar__btn--a11y[aria-pressed="true"]:hover {
    background: #ada87f;
    color: #000;
    border-color: #000;
    box-shadow: inset 0 0 0 1px #000;
}
.calc-toolbar__btn--a11y[aria-pressed="true"] .calc-toolbar__icon {
    background: #ffffff;
    color: #000;
    box-shadow: inset 0 0 0 2px #000;
}
.calc-toolbar__btn--a11y[aria-pressed="true"]:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

.calc-toolbar__sep {
    display: none;
}

/* ---------- Сворачиваемый блок (с полной защитой от горизонтального скролла на 320px) ---------- */
.calc-collapsible {
    display: grid;
    grid-template-rows: 1fr;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: grid-template-rows .5s cubic-bezier(.4, 0, .2, 1), opacity .4s ease;
    opacity: 1;
    overflow-x: hidden;
}
.calc-collapsible__inner {
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.calc-collapsible.is-animating .calc-collapsible__inner,
.calc-collapsible.is-collapsed .calc-collapsible__inner { overflow: hidden; }
.calc-collapsible.is-collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
}
.calc-collapsible.is-collapsed.is-done { visibility: hidden; }

/* Подсказка в свернутом состоянии */
.calc-collapsed-hint {
    margin: 0;
    font-size: 15px;
    color: #4b5a51;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
}
.calc-collapsed-hint[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
    .calc-collapsible,
    .calc-toolbar__icon,
    .calc-toolbar__btn { transition: none; }
    .calc-toolbar__btn--toggle[aria-expanded="false"] { animation: none; }
}

@media (max-width: 560px) {
    .calc-toolbar__bar {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 8px;
        border-radius: 14px;
        gap: 8px;
    }
    .calc-toolbar__btn {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        justify-content: center;
        padding: 8px 10px;
        font-size: 14px;
        min-height: 40px;
        box-sizing: border-box;
    }
}

/* =====================================================================
   СДИЗАРМИРОВАНИЕ ЯДОВИТЫХ ЧЁРНЫХ ПОЛОС СЕЛЕКТОВ В ОБЫЧНОМ РЕЖИМЕ
   ===================================================================== */
#calc-neck-select,
#calc-pipe-select,
#calc-delivery-select {
    background: #f8faf8 !important;
    color: #2c3e35 !important;
    border: 1px solid #27a32b !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#calc-neck-select:hover,
#calc-pipe-select:hover,
#calc-delivery-select:hover {
    background: #ffffff !important;
    border-color: #1e7e21 !important;
    box-shadow: 0 2px 6px rgba(39,163,43,0.15) !important;
}

#calc-neck-select:focus,
#calc-pipe-select:focus,
#calc-delivery-select:focus {
    background: #ffffff !important;
    border-color: #27a32b !important;
    outline: 2px solid #27a32b !important;
    outline-offset: 1px !important;
}

#calc-neck-select option,
#calc-pipe-select option,
#calc-delivery-select option {
    background: #ffffff !important;
    color: #2c3e35 !important;
    padding: 6px 10px !important;
}

/* =====================================================================
   РЕЖИМ ДЛЯ СЛАБОВИДЯЩИХ — СВЕТЛАЯ ВЫСОКОКОНТРАСТНАЯ СХЕМА
   Ориентиры: ГОСТ Р 52872-2019 (схема «чёрным по белому»), WCAG 2.1:
     1.4.3/1.4.6 — контраст текста ≥ 7:1 (#000 на #fff = 21:1,
                   #000 на #fff176 ≈ 18:1);
     1.4.11     — контраст рамок/элементов управления ≥ 3:1;
     1.4.12     — межстрочный интервал ~1.5, без сжатия букв;
     2.3.3/2.2.2 — без мигания и анимаций;
     2.4.7      — видимый фокус.
   НИКАКИХ тёмных фонов: всё белое, выбранное — светло-жёлтое (#fff176)
   + утолщённая чёрная рамка. Размер и семейство шрифта, сетка НЕ меняются.
   Экстремальная специфичность — для перебивки стилей Pip-Boy.
   ===================================================================== */

/* ---------- 0. Сброс тёмных фонов, свечений и анимаций на всех элементах ---------- */
html body #calc-collapsible.is-a11y :is(div, section, form, p, span, label, a, i, b, strong, em, ul, ol, li, small),
html body #quiz-collapsible.is-a11y :is(div, section, form, p, span, label, a, i, b, strong, em, ul, ol, li, small) {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}
html body #calc-collapsible.is-a11y *,
html body #quiz-collapsible.is-a11y * {
    animation: none !important;
    filter: none !important;
    text-transform: none !important;     /* КАПС читается хуже */
    letter-spacing: 0.02em !important;   /* без «разрядки» 1–2px, но и без сжатия */
}
html body #calc-collapsible.is-a11y *::before,
html body #calc-collapsible.is-a11y *::after,
html body #quiz-collapsible.is-a11y *::before,
html body #quiz-collapsible.is-a11y *::after {
    animation: none !important;
    text-shadow: none !important;
}

/* ---------- 1. Типографика (без смены размера и гарнитуры) ---------- */
html body #calc-collapsible.is-a11y :is(p, li, .row-title, .der),
html body #quiz-collapsible.is-a11y :is(p, li, .frss, .cons),
html body #quiz-collapsible.is-a11y .step-quest label span {
    line-height: 1.5 !important;
}
/* Заголовки и ключевые цифры — жирные, с чёткой сплошной чертой вместо пунктира */
html body #calc-collapsible.is-a11y .h3cal,
html body #quiz-collapsible.is-a11y .h22 {
    font-weight: 700 !important;
    border-bottom: 2px solid #000 !important;
}
html body #calc-collapsible.is-a11y :is(.receipt-price, .finalPrice, .label, .shop-title, #tech-volume, #tech-weight, #tech-height),
html body #quiz-collapsible.is-a11y :is(#summary-list strong, .summary-total) {
    font-weight: 700 !important;
}
/* Пунктирные разделители → сплошные чёрные (лучше различимы) */
html body #calc-collapsible.is-a11y .page-calc__price .services-table p,
html body #calc-collapsible.is-a11y .divzz,
html body #quiz-collapsible.is-a11y #summary-list li {
    border-color: #000 !important;
    border-style: solid !important;
}
/* Ссылки — чёрные, подчёркнутые, с подсветкой при наведении */
html body #calc-collapsible.is-a11y a[href],
html body #quiz-collapsible.is-a11y a[href] {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
}
html body #calc-collapsible.is-a11y a[href]:hover,
html body #quiz-collapsible.is-a11y a[href]:hover {
    background-color: #fff176 !important;
}
/* Плейсхолдеры — тёмно-серые, а не бледно-зелёные */
html body #calc-collapsible.is-a11y ::placeholder,
html body #quiz-collapsible.is-a11y ::placeholder {
    color: #4a4a4a !important;
    opacity: 1 !important;
}
/* Видимый фокус для клавиатуры */
html body #calc-collapsible.is-a11y :focus-visible,
html body #quiz-collapsible.is-a11y :focus-visible {
    outline: 3px solid #000 !important;
    outline-offset: 2px !important;
}
html body #calc-collapsible.is-a11y,
html body #quiz-collapsible.is-a11y,
html body #calc-collapsible.is-a11y #quiz,
html body #quiz-collapsible.is-a11y #quiz,
html body #calc-collapsible.is-a11y #quiz_form,
html body #quiz-collapsible.is-a11y #quiz_form {
    background: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
}

/* Принудительно делаем весь текст черным на ВСЕХ элементах */
html body #calc-collapsible.is-a11y *,
html body #quiz-collapsible.is-a11y * {
    color: #000000 !important;
    text-shadow: none !important;
}

/* ---------- 2. Контейнеры: металлический корпус и «экраны» Pip-Boy → белые ---------- */
html body #calc-collapsible.is-a11y .page-calc.cover,
html body #calc-collapsible.is-a11y .page-calc__form.calc-col,
html body #calc-collapsible.is-a11y #tech-specs-container,
html body #calc-collapsible.is-a11y .page-calc__price > .page-calc__price-block,
html body #calc-collapsible.is-a11y .services-table.summary,
html body #quiz-collapsible.is-a11y #quiz,
html body #quiz-collapsible.is-a11y #quiz_form,
html body #quiz-collapsible.is-a11y #quiz-summary-box,
html body #quiz-collapsible.is-a11y #success_block,
html body #quiz-collapsible.is-a11y .quiz-step {
    background: #ffffff !important;
    background-image: none !important;
    border-color: #000000 !important;
    box-shadow: none !important;
}
html body #calc-collapsible.is-a11y #tech-specs-container,
html body #calc-collapsible.is-a11y .page-calc__price > .page-calc__price-block,
html body #calc-collapsible.is-a11y .page-calc__form.calc-col,
html body #quiz-collapsible.is-a11y #quiz_form,
html body #quiz-collapsible.is-a11y #quiz-summary-box {
    border-width: 2px !important;
    border-style: solid !important;
}
/* Плашки внутри теххарактеристик */
html body #calc-collapsible.is-a11y #tech-specs-container > div:nth-of-type(1) > div {
    background: #ffffff !important;
    border: 1px solid #000 !important;
    box-shadow: none !important;
}

/* ---------- 3. Схема септика: возвращаем светлый «бетон» вместо тёмных градиентов ---------- */
html body #calc-collapsible.is-a11y .page-calc__stack {
    filter: none !important;
}
html body #calc-collapsible.is-a11y .page-calc__element,
html body #calc-collapsible.is-a11y .page-calc__cap,
html body #calc-collapsible.is-a11y .page-calc__neck,
html body #calc-collapsible.is-a11y .page-calc__ko6 {
    background: linear-gradient(90deg, #c9cfd4 0%, #eef1f4 15%, #eef1f4 85%, #c9cfd4 100%) !important;
    border-color: #000 !important;
    box-shadow: none !important;
}
html body #calc-collapsible.is-a11y .page-calc__element {
    border-left: 1px solid #000 !important;
    border-right: 1px solid #000 !important;
}
html body #calc-collapsible.is-a11y .page-calc__bottom {
    background: #c9cfd4 !important;
    border: 1px solid #000 !important;
}
html body #calc-collapsible.is-a11y .page-calc__hatch {
    background: #6cc35f !important;
    border: 2px solid #000 !important;
    box-shadow: none !important;
}
html body #calc-collapsible.is-a11y .page-calc__pipe,
html body #calc-collapsible.is-a11y .page-calc__pipe span {
    background: #9aa3aa !important;
    box-shadow: none !important;
}

/* ---------- 4. Инпуты и селекты (выпадающие списки) ---------- */
html body #calc-collapsible.is-a11y select,
html body #calc-collapsible.is-a11y input,
html body #calc-collapsible.is-a11y textarea,
html body #quiz-collapsible.is-a11y select,
html body #quiz-collapsible.is-a11y input,
html body #quiz-collapsible.is-a11y textarea {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

/* ---------- 5. Кнопки и варианты ответа: обычное состояние — белые ---------- */
html body #calc-collapsible.is-a11y .calc-btn,
html body #calc-collapsible.is-a11y .page-calc__cols-item,
html body #calc-collapsible.is-a11y .vko,
html body #calc-collapsible.is-a11y .photo-toggle,
html body #calc-collapsible.is-a11y .calc-send-btn,
html body #calc-collapsible.is-a11y button,
html body #quiz-collapsible.is-a11y button,
html body #quiz-collapsible.is-a11y .btn,
html body #quiz-collapsible.is-a11y .city_button,
html body #quiz-collapsible.is-a11y .nac,
html body #quiz-collapsible.is-a11y #to_submit,
html body #quiz-collapsible.is-a11y .step-quest label {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    opacity: 1 !important;
}
/* Наведение — светло-серый фон (отличается от «выбрано») */
html body #calc-collapsible.is-a11y .calc-btn:hover,
html body #calc-collapsible.is-a11y .page-calc__cols-item:hover,
html body #calc-collapsible.is-a11y .vko:hover,
html body #calc-collapsible.is-a11y .photo-toggle:hover,
html body #calc-collapsible.is-a11y .calc-send-btn:hover,
html body #calc-collapsible.is-a11y button:hover,
html body #quiz-collapsible.is-a11y button:hover,
html body #quiz-collapsible.is-a11y .btn:hover,
html body #quiz-collapsible.is-a11y .city_button:hover,
html body #quiz-collapsible.is-a11y .nac:hover,
html body #quiz-collapsible.is-a11y #to_submit:hover,
html body #quiz-collapsible.is-a11y .step-quest label:hover {
    background: #ececec !important;
    background-color: #ececec !important;
    color: #000000 !important;
    box-shadow: none !important;
}
/* Картинки в вариантах ответа — без затемнения */
html body #quiz-collapsible.is-a11y .step-quest img {
    opacity: 1 !important;
}

/* ---------- 6. ВЫБРАННОЕ / АКТИВНОЕ — светло-жёлтая плашка + двойная чёрная рамка ----------
   (вместо чёрной инверсии: тёмных фонов в режиме нет). Толщина рамки
   добирается inset-тенью, чтобы размеры элементов не прыгали. */
html body #calc-collapsible.is-a11y .calc-btn.active,
html body #calc-collapsible.is-a11y .page-calc__cols-item.active,
html body #calc-collapsible.is-a11y .photo-toggle.checked,
html body #quiz-collapsible.is-a11y .step-quest label.checked,
html body #quiz-collapsible.is-a11y .btn-next,
html body #quiz-collapsible.is-a11y #to_submit {
    background: #c3b963 !important;
    background-color: #fff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: inset 0 0 0 2px #000000 !important;
    font-weight: 700 !important;
}
html body #calc-collapsible.is-a11y .calc-btn.active *,
html body #calc-collapsible.is-a11y .page-calc__cols-item.active *,
html body #calc-collapsible.is-a11y .photo-toggle.checked *,
html body #quiz-collapsible.is-a11y .step-quest label.checked *,
html body #quiz-collapsible.is-a11y #to_submit * {
    color: #000000 !important;
    font-weight: 700 !important;
}
/* Маркер выбранного варианта в квизе — чёрная точка на жёлтом, без мигания */
html body #quiz-collapsible.is-a11y .step-quest label.checked::before {
    background: #000000 !important;
    box-shadow: none !important;
}
/* Галочка на фото-чекбоксах — жёлтый кружок с чёрной обводкой */
html body #calc-collapsible.is-a11y .photo-toggle .checkmark {
    background: #fff176 !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-sizing: border-box !important;
    font-weight: 700 !important;
}

/* ---------- 7. Неактивные (disabled) кнопки: без полупрозрачности, пунктирная рамка ---------- */
html body #calc-collapsible.is-a11y .disabled,
html body #quiz-collapsible.is-a11y .btn.disabled {
    opacity: 1 !important;
    color: #4a4a4a !important;
    border-style: dashed !important;
    background: #ffffff !important;
    box-shadow: none !important;
}
html body #calc-collapsible.is-a11y .disabled * {
    color: #4a4a4a !important;
}

/* ---------- 8. Прогресс-бар и чекбокс согласия квиза ---------- */
html body #quiz-collapsible.is-a11y #progress_bar {
    background: #ffffff !important;
    border: 1px solid #000000 !important;
}
html body #quiz-collapsible.is-a11y #progress_in {
    background: #ffd600 !important;
    box-shadow: inset -2px 0 0 #000000 !important;
}
html body #quiz-collapsible.is-a11y #acceptance-line input[type="checkbox"] {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
}
html body #quiz-collapsible.is-a11y #acceptance-line input[type="checkbox"]:checked {
    background: #fff176 !important;
}
html body #quiz-collapsible.is-a11y #acceptance-line input[type="checkbox"]:checked::after {
    color: #000000 !important;
}

/* ---------- 9. Отключаем все сканлайны и виньетки (квиз + левая колонка конструктора) ---------- */
html body #quiz-collapsible.is-a11y #quiz_form::before,
html body #quiz-collapsible.is-a11y #quiz_form::after,
html body #calc-collapsible.is-a11y #quiz_form::before,
html body #calc-collapsible.is-a11y #quiz_form::after,
html body #calc-collapsible.is-a11y .page-calc__form.calc-col::before {
    display: none !important;
}
