.video-modal,
.image-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}

.video-modal.show,
.image-modal.show {
  display: flex;
}

/* Закрытие по клику вне контента */
.video-modal::before,
.image-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  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;
}

.video-modal .video-container {
  position: relative;
  background: #000;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-modal .modal-video {
  width: 100%;
  height: auto;
  max-height: 80vh;
  display: block;
  background: #000;
}

/* Кнопка закрытия для видео */
.video-modal .close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  width: 40px;
  height: 40px;
  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 {
  background: rgba(255, 94, 0, 0.7);
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .video-modal .modal-content {
    width: 95%;
    border-radius: 10px;
  }
  
  .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: 40px;
    height: 40px;
    font-size: 18px;
    position: absolute;
    z-index: 10;
  }
  
  .image-modal .prev-btn {
    left: 10px;
  }
  
  .image-modal .next-btn {
    right: 10px;
  }
  
  .image-modal .modal-main {
    gap: 0;
  }
}

@media (max-width: 480px) {
  .video-modal .close,
  .image-modal .modal-close {
    top: -30px;
    right: -3px;
    font-size: 24px;
    width: 30px;
    height: 30px;
  }
  
  .image-modal .nav-btn {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .video-modal .modal-content {
    aspect-ratio: 9/16;
  }
}

/* ===== ВАЖНО: УБЕДИТЕСЬ, ЧТО ДРУГИЕ ЭЛЕМЕНТЫ НЕ ПЕРЕКРЫВАЮТ МОДАЛКИ ===== */