/* МОДАЛЬНОЕ ОКНО формы обратной связи "Обсудите сборку с нашими экспертами" */
.modal.modal-build-support {
    .modal-close {
        top: 16px;
        right: 16px;
        padding: 16px;
    }

    .modal-content {
        width: 724px;
        padding: 32px;
    }

    h2 {
        margin-top: 0;
        margin-bottom: 24px;
        font-size: 24px;
        line-height: 110%;
    }

    .form-input-wrap textarea {
        display: block;
        padding: 30px 20px 0;
        height: 133px;
        width: 100%;
        font-family: "TTFirsText DemiBold", sans-serif;
        font-size: 1.16rem;
        letter-spacing: 0.02em;
        background: #F5F5F5;
        border-radius: 8px;
        border: none;
        outline: none;
        -moz-appearance: none;
        -webkit-appearance: none;
        appearance: none;
    }

    @media (max-width: 767px) {
        .form-input-wrap textarea ::-webkit-input-placeholder {
            color: transparent;
        }

        .form-input-wrap textarea ::-moz-placeholder {
            color: transparent;
        }

        .form-input-wrap textarea :-ms-input-placeholder {
            color: transparent;
        }

        .form-input-wrap textarea::-webkit-input-placeholder {
            color: transparent;
        }

        .form-input-wrap textarea::-moz-placeholder {
            color: transparent;
        }

        .form-input-wrap textarea:-ms-input-placeholder {
            color: transparent;
        }

        .form-input-wrap textarea::-ms-input-placeholder {
            color: transparent;
        }

        .form-input-wrap textarea::placeholder {
            color: transparent;
        }
    }
    @media (min-width: 768px) {
        .form-input-wrap textarea {
            font-size: 1rem;
        }
    }
    .form-input-wrap textarea {
        overflow-y: auto;
        resize: none;
        scrollbar-width: thin;
        scrollbar-color: #BDBDBD transparent;
    }
    .form-input-wrap textarea::-webkit-scrollbar {
        width: 4px;
    }
    .form-input-wrap textarea::-webkit-scrollbar-track {
        background: transparent;
    }
    .form-input-wrap textarea::-webkit-scrollbar-thumb {
        background: #BDBDBD;
        border-radius: 2px;
    }

    .form-input-wrap textarea:focus {
        box-shadow: inset 0 0 0 1px #141414;
    }
    .form-input-wrap textarea.error {
        box-shadow: inset 0 0 0 1px #EA1E61;
    }
    .form-input-wrap textarea[disabled] {
        color: #757575;
    }
    .form-input-wrap:has(textarea) label {
        background: rgb(245, 245, 245);
        padding: 0 4px;
        top: 8px;
        left: 16px;
        border-radius: 4px;
        box-shadow: 0 0 2px 1px #F5F5F5;
        z-index: 2;
    }
    .checkbox {
        margin: 18px 0;
    }

    .btn-jivo-chat {
        background: #E8F4FF;
        color: #0066CC;
        height: 44px;
    }
    .btn-jivo-chat:hover {
        background-color: #D7EBFF;
    }
    .btn-jivo-chat.modal-btn svg {
        margin-left: 16px;
    }
}

/* МОДАЛЬНОЕ ОКНО "Обратите внимание!" */
.modal.modal-build-warning {
    z-index: 15;
    .modal-close {
        top: 16px;
        right: 16px;
        padding: 16px;
    }
    .modal-content {
        width: 724px;
        padding: 32px;
        bottom: 0;
    }
    h2 {
        margin-top: 0;
        margin-bottom: 24px;
        font-size: 24px;
        line-height: 110%;
    }
    h3 {
        margin: 0;
        font-size: 16px;
        line-height: 129%;
    }
    .mark-dot::before {
        content: "";
        display: inline-block;
        vertical-align: middle;
        margin-right: 10px;
        width: 8px;
        height: 8px;
        border-radius: 0.5rem;
    }
    .mark-red::before {
        background: #EA1E61;
    }
    .mark-blue::before {
        background: #4DA6FF;
    }
    .content-block {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
        margin: 24px 0;
    }
    .info-item {
        padding: 12px;
        border-radius: 8px;
        background-color: #F5F5F5;
    }
    .text-p {
        margin-top: 16px;
        line-height: 129%;
        font-size: 14px;
    }
    .button-create-build-red {
        display: block;
        position: relative;
        height: 53px;
        width: 100%;
        margin-bottom: 16px;
        color: #FFF;
        line-height: 129%;
        text-align: center;
        align-content: center;
        border-radius: 8px;
        background: #EA1E61;
        transition: 0.2s;
        font-size: 14px;
    }
    .button-create-build-red:hover {
        background: #EA1E61DB;
    }
    .button-create-build-red svg {
        position: absolute;
        top: 50%;
        right: 24px;
        transform: translateY(-50%);
        stroke: #fff;
    }
    .button-return-builder svg {
        transform: rotate(180deg);
        margin: 0 12px 0 0;
    }
    .button-return-builder span {
        font-size: 14px;
    }

    @media (max-width: 767px) {
        .modal-content {
            width: auto;
            padding: 32px 16px 16px;
        }
        h2 {
            font-size: 20px;
            margin-bottom: 16px;
        }
        .content-block {
            margin: 16px 0;
        }
    }
}

/* КНОПКА "Сохранить пресет" на странице конфигуратора */
.button-save-preset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    height: 44px;
    margin-top: 12px;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
    background: #fff;
    color: #141414;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}

.button-save-preset:hover {
    border-color: #141414;
    background: #F5F5F5;
}

/* МОДАЛЬНОЕ ОКНО управления пресетами */
.modal.modal-preset-manager {
    .modal-close {
        top: 16px;
        right: 16px;
        padding: 16px;
    }
    .modal-content {
        width: 520px;
        padding: 32px;
        overflow: visible;
    }
    .preset-manager-title {
        margin: 0 0 24px;
        font-size: 22px;
        line-height: 110%;
    }
    .preset-manager-form {
        display: flex;
        flex-direction: column;
        gap: 12px;

        /* Переменные SlimSelect под стилистику формы */
        --ss-bg-color      : #F5F5F5;
        --ss-border-color  : transparent;
        --ss-border-radius : 8px;
        --ss-main-height   : 62px;
        --ss-font-color    : #141414;
        --ss-spacing-s     : 10px;
    }
    /* Поля формы — плавающий лейбл внутри */
    .preset-manager-field {
        position: relative;
    }
    .preset-manager-label {
        position: absolute;
        top: 8px;
        left: 20px;
        z-index: 1;
        font-size: 11px;
        line-height: 1;
        color: #616161;
        pointer-events: none;
    }
    .preset-manager-input {
        display: block;
        width: 100%;
        height: 62px;
        padding: 20px 20px 0;
        background: #F5F5F5;
        border: 1px solid transparent;
        border-radius: 8px;
        font-size: 14px;
        color: #141414;
        outline: none;
        transition: border-color 0.2s;
        appearance: none;
        -webkit-appearance: none;
    }
    .preset-manager-input:focus {
        border-color: #141414;
    }
    .preset-manager-input.error {
        border-color: #EA1E61;
    }

    /* Предупреждение при редактировании */
    .preset-manager-edit-warning {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 14px;
        border-radius: 8px;
        background: #FFF3F7;
        color: #C41A52;
        font-size: 13px;
        line-height: 1.4;
    }

    .preset-manager-edit-warning svg {
        flex-shrink: 0;
        margin-top: 1px;
        stroke: #C41A52;
    }

    /* Загрузка файла */

    .preset-manager-file-wrap {
        position: relative;
    }

    .preset-manager-file-label {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 62px;
        padding: 16px 20px 0;
        background: #F5F5F5;
        border: 1px dashed #C0C0C0;
        border-radius: 8px;
        font-size: 14px;
        color: #757575;
        cursor: pointer;
        transition: border-color 0.2s, color 0.2s;
    }

    .preset-manager-file-label:hover {
        border-color: #141414;
        color: #141414;
    }

    .preset-manager-file-label svg {
        flex-shrink: 0;
        stroke: #141414;
    }

    .preset-manager-file-input {
        position: absolute;
        width: 0;
        height: 0;
        opacity: 0;
        overflow: hidden;
    }

    /* Превью загруженного изображения */
    .preset-manager-image-preview {
        position: relative;
        width: fit-content;
        height: 140px;
        margin-top: 8px;
        border-radius: 8px;
        overflow: hidden;
        background: #F5F5F5;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .preset-manager-image-preview img {
        height: 100%;
        object-fit: contain;
    }

    .preset-manager-image-remove {
        position: absolute;
        top: 6px;
        right: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        border: none;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.45);
        color: #fff;
        cursor: pointer;
        transition: background 0.2s;
    }

    .preset-manager-image-remove:hover {
        background: rgba(0, 0, 0, 0.7);
    }

    /* Ошибки */
    .preset-manager-field-error,
    .preset-manager-global-error {
        font-size: 12px;
        color: #EA1E61;
        margin-top: 4px;
    }

    /* Кнопка отправки */
    .preset-manager-actions {
        padding-top: 4px;
    }

    .preset-manager-submit {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 56px;
        border: none;
        border-radius: 8px;
        background: #141414;
        color: #fff;
        font-size: 15px;
        cursor: pointer;
        transition: background 0.2s;
    }

    .preset-manager-submit:hover {
        background: #333;
    }

    .preset-manager-submit:disabled {
        background: #BDBDBD;
        cursor: default;
    }

    .preset-manager-select .ss-single {
        margin-left: 0;
        padding-top: 12px;
        padding-left: 10px;
    }
}

/* МОДАЛЬНОЕ ОКНО просмотра пресетов сборок */
.modal-preset-group-view {
    padding: 0!important;

    .modal-dialog {
        height: 100%;
    }
    .modal-content .modal-close {
        display: none;
    }
    .modal-preset-group-inner .head-line .modal-close {
        display: block;
        top: 18px;
    }
    .modal-close svg:first-child {
        display: none;
    }
    .modal-close svg:last-child {
        display: block;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        background: #F5F5F5;
        border-radius: 0;
        overflow-y: scroll;
        scrollbar-width: thin;
        scrollbar-color: #BDBDBD transparent;
    }
    .modal-content::-webkit-scrollbar {
        width: 2px;
    }
    .modal-content::-webkit-scrollbar-track {
        background: transparent;
    }
    .modal-content::-webkit-scrollbar-thumb {
        background: #BDBDBD;
        border-radius: 2px;
    }
    h2.preset-group-title {
        margin: 0;
        padding-bottom: 24px;
        font-size: 24px;
        line-height: 120%;
    }
    h2.preset-group-title .presets-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        margin-left: 16px;
        vertical-align: middle;
        background: #141414;
        border-radius: 50%;
        color: #FFF;
        font-size: 14px;
        letter-spacing: 0;
        line-height: 1;
    }
    .preset-group-list {
        display: flex;
        flex-wrap: wrap;
        column-gap: 32px;
    }
    .preset-group-item {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 32px;
        width: calc(50% - 16px);
        background: #FFF;
        border-radius: 16px;
        margin-bottom: 24px;
        padding: 24px 16px;
        transition: 0.2s;
        cursor: pointer;
    }
    .preset-group-item:hover {
        box-shadow: 0 8px 20px 0 rgba(27, 36, 44, 0.2);
    }
    .preset-group-item__image {
        width: 200px;
        min-height: 200px;
        min-width: 200px;
        object-fit: contain;
    }
    .item-info {
        width: 100%;
    }
    .preset-group-item h3 {
        margin: 0;
        font-size: 16px;
        line-height: 129%;
    }
    .components-block {
        margin: 20px 0;
    }
    .component-line {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 12px;
        margin-bottom: 8px;
    }
    .component-icon {
        margin: 0;
        min-width: 32px;
        width: 32px;
        height: 32px;
        text-align: center;
        align-content: center;
    }
    .component-icon img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    .line-bottom {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
    }
    .preset-cost-block .cost-new {
        font-size: 20px;
        line-height: 120%;
        font-weight: 600;
    }
    .preset-cost-block .cost-old {
        font-size: 12px;
        line-height: 18px;
        color: #9E9E9E;
        text-decoration: line-through;
    }
    .btn-select-build {
        width: 152px;
        height: 44px;
        margin: 0;
    }
    .btn-select-build.modal-btn svg {
        margin-left: 12px;
    }
    .button-return-builder svg {
        transform: rotate(180deg);
        margin-top: 0;
        margin-right: 12px;
        margin-left: 0;
    }

    @media (max-width: 1199px) {
        .preset-group-list {
            display: block;
        }
        .preset-group-item {
            width: 100%;
            gap: 16px;
        }
        .preset-group-item__image {
            width: 150px;
            min-height: 150px;
            min-width: 150px;
        }
    }

    @media (max-width: 767px) {
        .modal-content {
            height: calc(100% - 52px);
            padding: 0 0 16px;
        }
        .head-line {
            position: sticky;
            top: 0;
            padding: 16px 16px 0;
            background: #F5F5F5;
            transition: top 0.2s;
        }
        .head-line.head-line-hidden {
            top: -80px;
        }
        h2.preset-group-title {
            padding-bottom: 16px;
        }
        h2.preset-group-title .presets-count {
            margin-left: 8px;
        }
        .modal-preset-group-inner .head-line .modal-close {
            top: 16px;
            right: 16px;
        }
        .preset-group-list {
            padding: 0 16px;
        }
        .preset-group-item {
            display: block;
            margin-bottom: 16px;
            padding: 16px 12px;
        }
        .preset-group-item__image {
            display: block;
            width: auto;
            max-width: 100%;
            min-width: 200px;
            max-height: 200px;
            min-height: auto;
            margin: 0 auto 20px;
        }
        .component-line .component-name {
            font-size: 14px;
        }
        .modal-btn.button-return-builder {
            width: auto;
            margin: 0 16px;
        }
    }
}
