.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: all .3s ease-in-out;
    min-width: 360px;
}

.popup-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.popup-wrapper {
    padding: 40px 5px 40px 40px;
    width: 90%;
    max-width: 530px;
    position: relative;
    border-radius: 24px;
    background: #FFF;
    overflow: hidden;
}

.popup {
    height: 100%;
    overflow-y: scroll;
    padding-right: 35px; /* важно для контента, чтобы он не заезжал под скролл */
    box-sizing: content-box; /* чтобы padding добавлялся поверх ширины */
}

.popup::-webkit-scrollbar {
    width: 5px !important;
    background-color: transparent;
}


.popup::-webkit-scrollbar-thumb {
    margin-right: 10px;
    transform: translateX(20px);
    border-radius: 10px;
    background: rgb(170, 170, 170, .4);
}

.popup::-webkit-scrollbar-track {
    border-radius: 5px;
    background-color: transparent;
}

.popup__title {
    margin: 16px 0 24px 0;
    font-size: 32px;
    font-style: normal;
    font-weight: 600;
    line-height: 115%;
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}

.popup__form {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fff;
    color: var(--color-text);
    box-shadow: none;
    padding: 0;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

.popup-wrapper {
    transition: all .4s ease-in-out;
    transform: translateY(0);
}

.hidden .popup-wrapper {
    transform: translateY(100px);
}

.popup__form label {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    gap: 6px;
    color: var(--color-text);
    font-weight: 400;
    margin: 0;
}

.popup__form input {
    padding: 12px 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    color: var(--color-text);
    border-radius: 8px;
    border: 1px solid var(--Input-input-border-default, #DEDEE0);
    background: var(--Input-input-background-default, #FFF);
}

.popup__form input.error {
    border-color: #F5222D;
}

.popup__form .alt-messenger {
    color: #c080ff;
    text-decoration: underline;
    font-size: 14px;
}

.popup__form .note {
    color: var(--color-text);
}

.popup__form .buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    gap: 24px;
}

.change-messenger {
    cursor: pointer;
    display: inline-block;
    border-bottom: 1px dashed var(--color-violet);
    color: var(--color-violet);
    width: max-content;
    transition: border-bottom-color .3s ease-in-out;
}

.change-messenger:hover {
    border-bottom-color: transparent;
}

.messenger-layout {
    transform: translateX(0);
    transition: all .3s ease-in-out;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    background: #ffffff;
    z-index: 15;
    padding: 1px;
}

.messenger-layout.hidden {
    transform: translateX(100%);
}

.messenger-layout__title {
    color: var(--color-text);
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
    line-height: 28px;
}

.messenger-layout__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.messenger-layout__item {
    padding: 20px;
    border-radius: 16px;
    background: var(--Background-background-primary-default, #FFF);
    box-shadow: 0px 24px 30px -24px rgba(208, 206, 217, 0.40), 0px 0px 0px 1px rgba(61, 59, 53, 0.08), 0px 2px 6px 0px rgba(61, 59, 53, 0.06);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color .3s ease-in-out;
    gap: 12px;
}

.messenger-layout__item.active,
.messenger-layout__item:hover {
    border-radius: 16px;
    background: #F4F4F7;
    box-shadow: 0px 24px 30px -24px rgba(208, 206, 217, 0.40), 0px 0px 0px 1px rgba(61, 59, 53, 0.08), 0px 2px 6px 0px rgba(61, 59, 53, 0.06);
}

.popup-overlay .success-icon {
    margin-left: -16px;
}

@media screen and (max-height: 950px) {
    .popup-overlay:not(#order-tarif-popup-success) .popup-wrapper {
        top: 20px;
        max-height: calc(100% - 40px);
        overflow: auto;
        height: 100%;
        position: absolute;
    }
}

@media screen and (max-width: 768px) {
    .popup-wrapper {
        top: 0;
        bottom: 0;
        overflow: auto;
        height: 100%;
        position: absolute;
        border-radius: 0;
        width: 100%;
        padding: 16px 5px 16px 16px;
        max-height: 100%;

    }

    .popup {
        padding-right: 5px;
    }

    .popup__title {
        font-size: 24px;
        line-height: 32px;
        margin-top: 20px;
    }

    .popup-close {
        top: 10px;
        right: 10px;
    }

    .popup__form .buttons {
        justify-content: space-between;
    }

    .popup__form .buttons .btn {
        width: 50%;
    }
}

#tarif-compare .popup-wrapper {
    top: 20px;
    max-height: calc(100% - 40px);
    overflow-y: auto;
    height: 100%;
    position: absolute;
}