/* Стили для попапа изображений */
.image-popup {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Убираем ограничения размера и белый фон */
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 10px;
    overflow: visible; /* Изменено с hidden на visible */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.popup-image {
    /* Основные изменения для увеличения изображений */
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 95vh;
    min-width: 300px; /* Минимальная ширина */
    min-height: 200px; /* Минимальная высота */
    object-fit: contain;
    display: block;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.popup-close {
    position: absolute;
    top: -50px; /* Вынесли кнопку над изображением */
    right: 0;
    background: rgba(255, 255, 255, 0.9); /* Светлая кнопка */
    color: #333;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Анимация появления */
.image-popup.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.popup-content.show {
    animation: zoomIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7); /* Изменено с 0.5 на 0.7 */
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Курсор на главном изображении */
.main-image {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.main-image:hover {
    transform: scale(1.02);
}

/* Настройки для ноутбуков (768px - 1366px) */
@media (min-width: 768px) and (max-width: 1366px) {
    .popup-content {
        max-width: 80vw; /* Уменьшено с 95vw до 80vw */
        max-height: 80vh; /* Уменьшено с 95vh до 80vh */
    }

    .popup-image {
        max-width: 80vw; /* Уменьшено с 95vw до 80vw */
        max-height: 80vh; /* Уменьшено с 95vh до 80vh */
        min-width: 350px; /* Увеличен минимум для ноутбуков */
        min-height: 250px;
    }
}

/* Настройки для больших экранов (1367px и выше) */
@media (min-width: 1367px) {
    .popup-content {
        max-width: 85vw; /* Умеренное уменьшение для больших экранов */
        max-height: 85vh;
    }

    .popup-image {
        max-width: 85vw;
        max-height: 85vh;
        min-width: 400px;
        min-height: 300px;
    }
}

/* Адаптив для мобильных */
@media (max-width: 767px) {
    .popup-content {
        max-width: 98vw;
        max-height: 98vh;
    }

    .popup-image {
        max-width: 98vw;
        max-height: 98vh;
        min-width: 250px; /* Уменьшенный минимум для мобильных */
    }

    .popup-close {
        top: -45px;
        right: -5px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}