/* ── Video Background for Elementor ── */

/* Container needs relative positioning */
.vbg-has-video {
  position: relative !important;
  overflow: hidden !important;
}

/* Video wrapper */
.vbg-wrapper {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Video element */
.vbg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  object-position: center center;
}

/* Overlay */
.vbg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

/* Make sure content sits above the video */
.vbg-has-video > .elementor-container,
.vbg-has-video > .elementor-widget-wrap,
.vbg-has-video > .e-con-inner,
.vbg-has-video > .elementor-background-overlay ~ *,
.vbg-has-video > :not(.vbg-wrapper):not(.elementor-background-overlay) {
  position: relative;
  z-index: 2;
}

/* Elementor's own background overlay should also be above */
.vbg-has-video > .elementor-background-overlay {
  z-index: 1;
}

/* Hide video on mobile (when disabled) — show poster via CSS bg */
@media (max-width: 767px) {
  .vbg-no-mobile .vbg-video {
    display: none !important;
  }

  .vbg-no-mobile .vbg-wrapper {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
}

/* Smooth fade-in when video starts playing */
.vbg-video {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.vbg-video.vbg-playing {
  opacity: 1;
}

/* Editor preview hint */
.elementor-editor-active .vbg-has-video .vbg-wrapper::after {
  content: '🎬 Video BG';
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 99;
  pointer-events: none;
  font-family: -apple-system, sans-serif;
}
