/* Основные стили */
body.modal-open {
    overflow: hidden;
    padding-right: 15px; /* Компенсация для скроллбара */
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.7);
    z-index: 1;
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 30px auto;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    overflow: hidden;
    animation: modalopen 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 2;
}

@keyframes modalopen {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    background: none;
    border: none;
    padding: 0;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
}

.modal-container {
    display: flex;
}

.modal-image-column {
    width: 50%;
    background-size: cover;
    background-position: center;
    min-height: 400px;
}

.modal-content-column {
    width: 50%;
    padding: 40px;
    overflow-y: auto;
    max-height: 80vh;
}

/* Форма внутри модалки */
.modal-content-column form {
    margin-top: 20px;
}

.modal-content-column .form-error {
    color: #ff0000;
    margin-bottom: 15px;
}

/* Адаптивность */
@media (max-width: 768px) {
    body.modal-open {
        padding-right: 0;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
    }
    
    .modal-image-column {
        display: none;
    }
    
    .modal-content-column {
        width: 100%;
        padding: 25px;
    }
}