.modal {
  display: none; /* Скрыть модальное окно по умолчанию */
  position: fixed;
  z-index: 1500;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgb(0,0,0); /* Цвет фона */
  background-color: rgba(0,0,0,0.9); /* Черный фон с небольшой прозрачностью */
}

/* Стиль для изображения внутри модального окна */
.modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Стили для кнопок "Закрыть", "Следующий" и "Предыдущий" */
.close {
  position: fixed; /* или absolute, в зависимости от вашей верстки */
  top: 10px;
  right: 25px;
  color: #f1f1f1;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1501; /* Убедитесь, что z-index выше, чем у всех остальных элементов */
}

.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
}

.prev {
  left: 0;
  border-radius: 3px 0 0 3px;
}

.next {
  right: 0;
  border-radius: 0 3px 3px 0;
}

/* Эффект при наведении на кнопки "Следующий" и "Предыдущий" */
.prev:hover, .next:hover {
  background-color: rgba(0,0,0,0.8);
}