/* Адаптивный плеер видео: соотношение 9:16 для вертикальных, 16:9 для горизонтальных. */

.popup-video {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* переопределяем 90% / 90vh из style.css */
  width: auto;
  height: auto;
}

.popup-video.popup-video--vertical {
  width: auto;
  max-width: 90%;
  height: 90vh;
  aspect-ratio: 9 / 16;
}

.popup-video.popup-video--horizontal {
  width: 90%;
  max-width: 900px;
  height: auto;
  aspect-ratio: 16 / 9;
}

.popup-video__body {
  width: 100%;
  height: 100%;
}

.popup-video__body video,
.popup-video__body iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
  display: block;
}

/* Кнопка закрытия. На десктопе — снаружи правого края (рядом с попапом).
   На мобиле — внутри, ниже верха (чтобы не пересекаться с иконкой звука iOS). */
.popup-video__close {
  position: absolute;
  top: 12px;
  right: -48px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  color: #333;
  z-index: 2;
  padding: 0;
  transition: background .15s;
}

.popup-video__close:hover {
  background: #fff;
}

@media (max-width: 768px) {
  .popup-video__close {
    top: 56px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 26px;
  }
  .popup-video.popup-video--vertical {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 90vh;
  }
  .popup-video.popup-video--horizontal {
    width: 100%;
    max-width: 100%;
  }
}
