.overlay {
    z-index: -1;    
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Чуть затемнил для акцента */
    padding: 20px;
    opacity: 0;
    visibility: hidden; /* Вместо z-index для корректной анимации */
    transition: 0.4s ease;
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    left: 0;    
    pointer-events: none; /* Чтобы не кликалось в скрытом состоянии */
}

.overlay.active {
    opacity: 1;
    z-index: 999;
    visibility: visible;
    pointer-events: all;

}

.modal {
    background: #FFFFFF;
    max-width: 60%;       
    max-height:65%;
    padding: 30px;
    border-radius: 8px;
    position:fixed; 
    transform: scale(0.9); 
    transition: 0.4s;
    display: block !important;
    left: 20% !important;
    top: 20% !important;
    
}

.close {
    width: 30px; 
    height: 30px;
    background: url("images/cross.svg") no-repeat center;
    background-size: contain;
    position: absolute;
    top: 60px;
    right: 60px;
    cursor: pointer;
    z-index:999999;
}

/* Фикс для плавности: анимируем модалку через оверлей */
.overlay.active .modal {
    transform: scale(1) translateY(0);
}

@media (max-width: 1566px) {


    .modal {
        background: #FFFFFF;
        max-width: 60%;       
        max-height:75%;
        padding: 30px;
        border-radius: 8px;
        position:fixed; 
        transform: scale(0.9); 
        transition: 0.4s;
        display: block !important;
        left: 20% !important;
        top: 15% !important;
        
    }
    
    
    }

@media (max-width: 991px) {


.modal {
    background: #FFFFFF;
    max-width: 90%;       
    max-height:70%;
    padding: 30px;
    border-radius: 8px;
    position:fixed; 
    transform: scale(0.9); 
    transition: 0.4s;
    display: block !important;
    left: 5% !important;
    top: 20% !important;
    
}


}