.overlay {
    position: fixed;
    z-index: 5;
    height: 100%;
    width: 100%;
    top: 40px;
    left: 0;
    background-color: rgba(0,0,0,0.6); /* затемнение фона */
    display: none;
}
.overlay.active {
    display: block;
}
.overlay .flex-popup {
    height: 97%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.overlay .flex-popup .popup {
    position: relative;
    background-color: #fff;  /* цвет фона всплывающего блока */
    padding: 35px 35px;
    border-radius: 20px;
    box-shadow: 0 20px 12px -16px rgba(0,0,0,.2),
    0 8px 24px 18px rgba(0,0,0,.15);
    margin: 0 10px;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    height: 80%;
    display: flex;
}
@media (max-width: 550px) {
    .popup {
        width: 100%;
    }
}
@media (min-width: 550px) and (max-width: 1200px) {
    .popup {
        width: 70%;
    }
}
@media (min-width: 1200px) {
    .popup {
        width: 50%;
    }
}
.popup_media-video-wrapper, .popup_media-video, iframe {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}
.popup span {
    position: absolute;
    top: 17px;
    right: 20px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}
.popup .photo-wrapper {

}
.popup .photo {
    /*height: 300px;*/
    max-height: 500px;
    /*margin-left: auto;*/
    /*margin-right: auto;*/
}
.popup h2 {
    padding-top: 35px;
}