body.no_scroll {
    overflow: hidden;
}

.modal_window {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 999;
    display: grid;
    grid-template-rows: 100vh;
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
}
.modal_window > .overlay{
    background-color: #000000aa;
    position: absolute;
    height: 100%;
    width: 100%;
}
.modal_window > .overlay.clickable{
    cursor: pointer;
}
.modal_window .cross_btn{
    color: var(--white);
    background-image: url('data:image/svg+xml, <svg fill="%23ffffff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 8px;
    background-color: #333;
    border-radius: 50%;
    position: absolute;
    width: 22px;
    height: 22px;
    right: 10px;
    top: 10px;
    user-select: none;
    cursor: pointer;
    font-size: 2em;
    z-index: 2;
}
.modal_window .cross_btn:hover{background-color: #E82E2A;}
.modal_window > .box{
    z-index: 1;
    position: relative;
    box-sizing: border-box;
    max-width: 96vw;
    max-height: 96vh;
    overflow-y: auto;
}
.modal_window > .box:not(.borderless){
    padding: 25px;
    background-color: #fff;
    border-radius: 15px;
}
/* SIZES */
.modal_window > .box.small{
    max-width: 320px;
}
.modal_window > .box.medium{
    max-width: 680px;
}
.modal_window > .box.large{
    max-width: 1280px;
}
.modal_window > .box.fullwidth{
    max-width: 100vw;
}

/* DIALOG BUTTONS */
.modal_window .dialog_buttons{
    display: flex;
    gap: 5px;
    margin: 15px 0 -5px;
}
.modal_window .dialog_buttons > span{
    cursor: pointer;
    display: inline-block;
    padding: 4px 10px;
    background-color: #ddd;
    border-radius: 5px;
}

/* VIDEO PLAYER */
.video_modal_window video{
    max-height: 95vh;
    max-width: 95vw;
    width: 100%;
    height: 100%;
}

/* IMAGE VIEW */
.image_modal_window > .box{
    overflow-y: hidden!important;
}
.image_modal_window img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 96vh;
}

/* GALLERY */
.popup_gallery{
    cursor: pointer;
}
.gallery_modal_window .box{
    position: initial!important;
}
.gallery_modal_window .tiny-slider .controls li{
    width: 30%!important;
    opacity: 0;
}
.gallery_modal_window .tiny-slider .controls li.prev{
    background: linear-gradient(90deg, transparent, #ffffff60) !important;
    left: 0 !important;
}
.gallery_modal_window .tiny-slider .controls li.next{
    background: linear-gradient(90deg, transparent, #ffffff60) !important;
    right: 0 !important;
}
.gallery_modal_window .tiny-slider .thumbnails{
    position: fixed;
    bottom: 20px;
    z-index: 1;
    left: 50%;
    transform: translateX(-50%);
}
.gallery_modal_window .tiny-slider .tns-nav-active{
    border-color: #fff;
}
.gallery_modal_window .tiny-slider img{
    vertical-align: middle!important;
    max-height: 94vh;
    object-fit: contain;
}

/* FORM */
.form_modal_window > .box:not(.borderless){
    padding: 15px;
}
.form_modal_window .content form,
.form_modal_window .content > *:last-child{
    margin-bottom: 0;
}