.configurator {
    width: 100%;
}


/*--------------------------------------------------------------
# Информация о категории
--------------------------------------------------------------*/

.configurator__category-info {
    display: grid;
    grid-template-columns: 4fr 8fr;

    margin-bottom: 24px;

    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;

    overflow: hidden;
}

.configurator__category-image {
    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 320px;
    padding: 24px;

    background: #fafafa;
}

.configurator__image {
    display: block;

    max-width: 100%;
    max-height: 280px;

    object-fit: contain;
}

.configurator__category-description {
    display: flex;
    align-items: center;

    padding: 32px;

    border-left: 1px solid #ececec;
}

.configurator__description {
    width: 100%;

    font-size: 17px;
    color: #666;
    line-height: 1.7;
}

.configurator__description p {
    margin-bottom: 12px;
}

.configurator__description p:last-child {
    margin-bottom: 0;
}


/*--------------------------------------------------------------
# Левая колонка — параметры
--------------------------------------------------------------*/

.configurator__parameters {
    height: auto;

    padding: 24px;

    background: #fff;

    border: 1px solid #e8e8e8;
    border-radius: 16px;
}

.configurator__parameter {
    margin-bottom: 32px;
}

.configurator__parameter:last-child {
    margin-bottom: 0;
}

.configurator__parameter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;
    margin-bottom: 16px;
}

.configurator__parameter-title {
    position: relative;
    display: inline-block;

    margin: 0;
    padding-bottom: 8px;

    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;

    color: #00743C;
}

.configurator__parameter-title::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: 0;

    width: 45px;
    height: 2px;

    background: #00743C;
    border-radius: 2px;
}


/*--------------------------------------------------------------
# Ссылка на преимущество
--------------------------------------------------------------*/

.configurator__parameter-benefit-link {
    display: inline-flex;
    align-items: center;

    gap: 6px;
    flex-shrink: 0;

    padding: 5px 8px;

    font-size: 13px;
    font-weight: 500;
    line-height: 1;

    color: #00743C;
    text-decoration: none;

    border-radius: 6px;

    transition:
        color .2s ease,
        background-color .2s ease;
}

.configurator__parameter-benefit-link:hover {
    color: #005a2e;
    background: #f4faf6;
    text-decoration: none;
}

.configurator__parameter-benefit-link i {
    font-size: 11px;

    transition: transform .2s ease;
}

.configurator__parameter-benefit-link:hover i {
    transform: translateY(2px);
}


/*--------------------------------------------------------------
# Опции
--------------------------------------------------------------*/

.configurator__options {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

.configurator__option {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px 12px;

    border-radius: 8px;

    cursor: pointer;

    transition: background-color .2s ease;
}

.configurator__option:hover {
    background: #f4faf6;
}

.configurator__input {
    flex-shrink: 0;

    accent-color: #00743C;
}

.configurator__option-label {
    flex: 1;

    min-width: 0;

    font-size: 16.5px;
    line-height: 1.45;

    color: #333;
}


/*--------------------------------------------------------------
# Цена конкретной опции
--------------------------------------------------------------*/

.configurator__option-price {
    flex-shrink: 0;

    margin-left: auto;

    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;

    color: #555;

    white-space: nowrap;
}

.configurator__option-price--base {
    color: #555;
}

.configurator__option-price--modifier {
    color: #555;
}


/*--------------------------------------------------------------
# Итоговая стоимость выбранной конфигурации
--------------------------------------------------------------*/

.configurator__selection-price {
    position: relative;

    width: 100%;

    margin-top: 24px;
    padding: 18px 20px;

    background: #fbfbfb;

    border: 1px solid #ececec;
    border-radius: 12px;

    z-index: 100;
}


/*
 * Плавающий блок цены.
 *
 * При выборе базового продукта Stimulus добавляет
 * класс configurator__selection-price--fixed.
 *
 * left и width передаются из Stimulus через
 * CSS custom properties, чтобы блок оставался
 * ровно над своей исходной колонкой.
 */
.configurator__selection-price--fixed {
    position: fixed;

    left: var(--configurator-selection-price-left);
    bottom: 24px;

    width: var(--configurator-selection-price-width);

    margin-top: 0;

    z-index: 1000;

    /*
     * Чётко отделяем floating-блок от страницы.
     */
    border: 1px solid #d9d9d9;

    box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
}


/*
 * Placeholder сохраняет место исходного блока
 * в документе, пока сам блок находится
 * в position: fixed.
 */
.configurator__selection-price-placeholder {
    display: block;

    width: 100%;
}


/*--------------------------------------------------------------
# Строки итоговой цены
--------------------------------------------------------------*/

.configurator__selection-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 7px 0;

    color: #555;
}

.configurator__selection-price-row strong {
    flex-shrink: 0;

    margin-left: auto;

    font-size: 22px;
    font-weight: 700;

    color: #8B0000;

    text-align: right;
    white-space: nowrap;
}

.configurator__selection-price-row--total {
    margin-top: 10px;
    padding: 14px 16px;

    background: #fff;

    border: 2px solid #e8e8e8;
    border-radius: 10px;
}

.configurator__selection-price-row--total span {
    font-size: 16px;
    font-weight: 600;

    color: #222;
}

.configurator__selection-price-row--total strong {
    font-size: 28px;
    font-weight: 700;

    color: #8B0000;
}


/*--------------------------------------------------------------
# Правая колонка — результат
--------------------------------------------------------------*/

.configurator__result {
    height: 100%;

    padding: 32px;

    background: #fff;

    border: 1px solid #e8e8e8;
    border-radius: 16px;
}

.configurator__title {
    position: relative;
    display: inline-block;

    margin: 0 0 20px;

    font-size: 28px;
    font-weight: 600;
    line-height: 1.4;

    color: #222;
}

.configurator__title::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: -8px;

    width: 70px;
    height: 3px;

    background: #00743C;
    border-radius: 3px;
}


/*--------------------------------------------------------------
# Секции
--------------------------------------------------------------*/

.configurator__section {
    margin-top: 30px;
    padding-top: 26px;

    border-top: 1px solid #ececec;
}

.configurator__section-title {
    position: relative;
    display: inline-block;

    margin: 0 0 20px;
    padding-bottom: 8px;

    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;

    color: #00743C;
}

.configurator__section-title::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: 0;

    width: 50px;
    height: 2px;

    background: #00743C;
    border-radius: 2px;
}


/*--------------------------------------------------------------
# Характеристики
--------------------------------------------------------------*/

.configurator__characteristics {
    overflow: hidden;

    border: 1px solid #ececec;
    border-radius: 12px;
}

.configurator__characteristic {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 14px 18px;

    background: #fff;

    border-bottom: 1px solid #f3f3f3;
}

.configurator__characteristic:nth-child(even) {
    background: #fcfcfc;
}

.configurator__characteristic:last-child {
    border-bottom: none;
}

.configurator__characteristic-name {
    font-size: 16.5px;
    line-height: 1.45;

    color: #666;
}

.configurator__characteristic-value {
    flex-shrink: 0;

    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.45;

    color: #222;

    text-align: right;
}


/*--------------------------------------------------------------
# Цена
--------------------------------------------------------------*/

.configurator__price {
    padding: 24px;

    background: #fbfbfb;

    border: 1px solid #ececec;
    border-radius: 14px;
}

.configurator__price-base {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding-bottom: 12px;

    font-size: 16px;
    line-height: 1.45;

    color: #555;
}

.configurator__price-base strong {
    flex-shrink: 0;

    font-size: 24px;
    font-weight: 700;

    color: #444;

    text-align: right;
}


/*--------------------------------------------------------------
# Модификаторы цены
--------------------------------------------------------------*/

.configurator__modifiers {
    margin: 18px 0;
}

.configurator__modifier {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 12px 0;

    border-bottom: 1px dashed #ececec;
}

.configurator__modifier:last-child {
    border-bottom: none;
}

.configurator__modifier-info {
    min-width: 0;
}

.configurator__modifier-parameter {
    margin-bottom: 2px;

    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.4;

    color: #888;
}

.configurator__modifier-name {
    font-size: 16.5px;
    font-weight: 500;
    line-height: 1.45;

    color: #333;
}

.configurator__modifier-value {
    flex-shrink: 0;

    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.4;

    color: #555;

    white-space: nowrap;
}


/*--------------------------------------------------------------
# Разделитель цены
--------------------------------------------------------------*/

.configurator__price-divider {
    height: 1px;

    margin: 22px 0;

    background: #e4e4e4;
}


/*--------------------------------------------------------------
# Итоговая стоимость
--------------------------------------------------------------*/

.configurator__price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 8px 0;

    color: #555;
}

.configurator__price-row strong {
    flex-shrink: 0;

    font-size: 22px;
    font-weight: 700;

    color: #8B0000;

    text-align: right;
    white-space: nowrap;
}

.configurator__price-row--total {
    margin-top: 18px;
    padding: 18px 20px;

    background: #fff;

    border: 2px solid #e8e8e8;
    border-radius: 12px;
}

.configurator__price-row--total span {
    font-size: 18px;
    font-weight: 600;

    color: #222;
}

.configurator__price-row--total strong {
    font-size: 36px;
    font-weight: 700;

    color: #8B0000;
}


/*--------------------------------------------------------------
# Placeholder / загрузка
--------------------------------------------------------------*/

.configurator__price-placeholder {
    padding: 24px;

    text-align: center;

    color: #888;
}


/*--------------------------------------------------------------
# Кнопка "К конфигуратору"
--------------------------------------------------------------*/

.configurator__back-to-configurator {
    position: fixed;

    right: 24px;
    bottom: 24px;

    z-index: 1100;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 11px 16px;

    color: #fff;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;

    background: #00743C;

    border: none;
    border-radius: 8px;

    box-shadow: 0 4px 14px rgba(0, 0, 0, .15);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(10px);

    transition:
        opacity .2s ease,
        visibility .2s ease,
        transform .2s ease,
        background-color .2s ease;
}

.configurator__back-to-configurator.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translateY(0);
}

.configurator__back-to-configurator:hover {
    color: #fff;

    background: #005a2e;

    text-decoration: none;
}

.configurator__back-to-configurator i {
    font-size: 13px;
}


/*--------------------------------------------------------------
# Планшеты
--------------------------------------------------------------*/

@media (max-width: 991px) {

    .configurator__category-info {
        grid-template-columns: 1fr 1fr;
    }

    .configurator__category-image {
        min-height: 280px;
    }

    .configurator__category-description {
        padding: 24px;
    }

    .configurator__result {
        height: auto;
    }

}


/*--------------------------------------------------------------
# Mobile
--------------------------------------------------------------*/

@media (max-width: 768px) {

    .configurator__category-info {
        display: block;
    }

    .configurator__category-image {
        min-height: 220px;
        padding: 20px;
    }

    .configurator__image {
        max-height: 200px;
    }

    .configurator__category-description {
        padding: 20px;

        border-top: 1px solid #ececec;
        border-left: none;
    }

    .configurator__description {
        font-size: 17px;
    }

    .configurator__parameters {
        height: auto;

        padding: 20px;
    }

    .configurator__parameter-header {
        align-items: flex-start;

        gap: 10px;
    }

    .configurator__parameter-title {
        font-size: 18px;
    }

    .configurator__parameter-benefit-link {
        padding: 4px 6px;

        font-size: 12px;
    }

    .configurator__parameter-benefit-link span {
        display: none;
    }

    .configurator__option {
        align-items: flex-start;
    }

    .configurator__option-label {
        font-size: 16.5px;
    }

    .configurator__option-price {
        font-size: 14px;
    }

    .configurator__selection-price {
        padding: 16px;
    }

    .configurator__selection-price-row strong {
        font-size: 20px;
    }

    .configurator__selection-price-row--total strong {
        font-size: 26px;
    }

    .configurator__result {
        padding: 20px;
    }

    .configurator__title {
        font-size: 24px;
    }

    .configurator__section-title {
        font-size: 18px;
    }

    .configurator__price {
        padding: 20px;
    }

    .configurator__modifier {
        align-items: flex-start;
    }

    .configurator__modifier-parameter {
        font-size: 14px;
    }

    .configurator__modifier-name {
        font-size: 16px;
    }

    .configurator__modifier-value {
        font-size: 16px;
        white-space: nowrap;
    }

    .configurator__price-row--total strong {
        font-size: 30px;
    }

    .configurator__characteristic {
        flex-direction: column;
        align-items: flex-start;

        gap: 4px;
    }

    .configurator__characteristic-name,
    .configurator__characteristic-value {
        font-size: 16px;
    }

    .configurator__characteristic-value {
        text-align: left;
    }

    .configurator__back-to-configurator {
        right: 16px;
        bottom: 16px;

        width: 42px;
        height: 42px;

        padding: 0;

        border-radius: 50%;
    }

    .configurator__back-to-configurator span {
        display: none;
    }

    .configurator__back-to-configurator i {
        font-size: 16px;
    }

}
