/* ===== Фон для затемнения ============*/
.popup-video {
  /* Скрываем по умолчанию */
  width: 80%;
  height: 90vh;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
  opacity: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  border-radius: 20px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.7);
  z-index: 10000;
  overflow: hidden;
  transition: 1s;
}

.popup-video .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 1em;
  aspect-ratio: 1;
  line-height: 0.2em;
  font-size: 3.2em;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  border: none;
  background-color: rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease-in;
}

.popup-video .close-btn:hover {
  color: red;
}

.popup-video.active {
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
  opacity: 1;
}

.popup-video.active .close-btn,
.popup-video.active .iframe-box {
  opacity: 1;
  transition: opacity 0.5s;
  transition-delay: 1s;
}

.iframe-box {
  position: absolute;
  width: 60vw;
  aspect-ratio: 1.78;
  border-radius: 10px;
  z-index: 999;
  border: none;
  /* box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5), 4px 6px 6px rgba(0, 0, 0, 0.7); */
  box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.7);
}

.iframe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s ease;
  z-index: 9999;
}
.iframe-overlay.open {
  opacity: 1;
  visibility: visible;
}
.iframe-modal {
  width: min(90vw, 1000px);
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
.iframe-wrap,
.iframe-player {
  width: 100%;
  height: 100%;
  display: block;
}
.iframe-close {
  position: absolute;
  inset: 8px 12px auto auto;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
}
