.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: 90%;
    max-height: 90%;
    overflow: hidden;
}
.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;
}