/* ===== ОБЩИЕ СТИЛИ ДЛЯ МОДАЛОК ===== */
.video-modal,
.image-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    padding: 20px;
}

.video-modal.show,
.image-modal.show {
    display: flex;
}

/* Щёлк вне области */
.video-modal::before,
.image-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
}

/* ===== ВИДЕО-МОДАЛКА ===== */
.video-modal .modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(255, 94, 0, 0.4);
    border: 2px solid var(--neon);
    aspect-ratio: 16/9;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal .modal-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* ===== IMAGE-МОДАЛКА ===== */
.image-modal .modal-container {
    position: relative;
    max-width: 95%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10001;
}

.image-modal .modal-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.image-modal img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(255, 94, 0, 0.3);
    object-fit: contain;
}

/* ===== КНОПКИ ===== */
.video-modal .close,
.image-modal .modal-close {
    position: absolute;
    top: -45px;
    right: 0;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 94, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 10002;
}

.video-modal .close:hover,
.image-modal .modal-close:hover {
    background: rgba(255, 94, 0, 0.7);
    transform: scale(1.1);
}

.image-modal .nav-btn {
    width: 45px;
    height: 45px;
    font-size: 22px;
    color: #fff;
    background: rgba(0,0,0,0.5);
    border: 2px solid var(--neon);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-modal .nav-btn:hover {
    background: var(--neon);
    color: #fff;
}
.image-modal .prev-btn { margin-right: 10px; }
.image-modal .next-btn { margin-left: 10px; }

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .video-modal .modal-content {
        width: 95%;
        border-radius: 12px;
    }
    .image-modal .modal-container {
        width: 95%;
    }
    .video-modal .close,
    .image-modal .modal-close {
        top: -35px;
        right: -5px;
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
    .image-modal .nav-btn {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .image-modal .modal-main { gap: 10px; }
}

@media (max-width: 480px) {
    .video-modal .modal-content {
        aspect-ratio: 9/16; /* вертикальное видео */
    }
    .video-modal .close,
    .image-modal .modal-close {
        top: -30px;
        right: -3px;
        font-size: 24px;
        width: 30px;
        height: 30px;
    }
    .image-modal .nav-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .image-modal img {
        max-width: 95vw;
        max-height: 75vh;
    }
}