body.panel-is-open {
    overflow: hidden;
}

.modal-overlay, .drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    visibility: hidden;
    pointer-events: none;
    background: #e9ecefb3;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity .4s, visibility .4s;
}

.modal-overlay.is-open, .drawer-overlay.is-open {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

.modal__close,
.drawer__close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;
    cursor: pointer;
}

.modal__close span,
.drawer__close span {
    display: block;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
    transition: transform .2s ease;
}

.modal__close:hover span,
.drawer__close:hover span {
    transform: rotate(90deg);
}

.modal__header,
.drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex: 0 0 auto;
    min-height: 74px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--bg-border);
}

.site .modal__title,
.site .drawer__title {
    margin: 0;
}

.modal__content,
.drawer__content {
    overflow-y: auto;
    font-size: 15px;
    color: var(--text);
	padding: 24px;
}

.modal__content > :first-child,
.drawer__content > :first-child {
    margin-top: 0;
}

.modal__content > :last-child,
.drawer__content > :last-child {
    margin-bottom: 0;
}

.modal__content h3,
.drawer__content h3 {
    margin: 28px 0 12px;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 600;
    color: #111;
}

.modal-overlay {
    align-items: center;
    justify-content: center;
}

.modal {
    position: relative;
    width: min(760px, calc(100vw - 60px));
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .22);
    opacity: 0;
    transform: translateY(25px) scale(.97);
    transition: opacity .3s ease, transform .35s cubic-bezier(.22, 1, .36, 1);
}

.modal-overlay.is-open .modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.drawer-overlay {
    justify-content: flex-end;
}

.drawer {
    position: relative;
    width: min(520px, 100vw);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    transform: translateX(100%);
    transition: transform .4s ease;
}

.drawer-overlay.is-open .drawer {
    transform: translateX(0);
}

.open-modal,
.open-drawer {
    cursor: pointer;
}

@media (max-width: 767px) {
    .modal-overlay, .drawer-overlay {
        top: 70px;
    }

    .modal {
        width: 100%;
        max-height: calc(100vh - 70px);
        height: 100vh;
    }

    .drawer {
        width: 100%;
        max-height: calc(100vh - 70px);
        height: 100vh;
    }

    .modal__header,
    .drawer__header {
        min-height: 68px;
        padding: 12px 16px;
    }

    .modal__content,
    .drawer__content {
        padding: 16px;
    }

    .site .modal__title,
    .site .drawer__title {
        font-size: 16px;
    }
}