.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    display: flex;
    justify-content: space-around;
    position: relative; /* Добавлено для абсолютного позиционирования close */
    flex-direction: column;
}

.modal-header {
border: 2px dotted red;
    margin: 8px;
    padding: 8px;
    text-transform: uppercase;
    text-align: center;
    font-weight: 800;
    }

.close {
    color: #aaa;
    position: absolute; /* Абсолютное позиционирование */
    right: 10px; /* Справа на 10px от края modal-content */
    top: -5px; /* Сверху на 10px от края modal-content */
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.myButton {
    cursor: pointer;
}

.image-container {
    text-align: center;
    flex-basis: 45%;
}

.modal-image {
    max-width: 100%;
    height: auto;
}

@media screen and (max-width: 600px) {
    .modal-content {
        flex-direction: column;
        width: 90%;
        margin: 10% auto;
    }

    .image-container {
        flex-basis: auto;
        margin: 0.8rem;
    }
}
.link {
    text-decoration: none;
    color: #3e3e3e;
}

