/**
 * WooCommerce Product Gallery Video — Frontend styles
 * Version: 1.4.0
 */

/* ==============================================================
 * SLIDE CONTAINER
 * ============================================================== */

.wcpgv-video-slide {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.wcpgv-video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* ==============================================================
 * DIRECT <video> ELEMENT
 * ============================================================== */

.wcpgv-video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 700px;
  object-fit: contain;
  background: #000;
}

/* ==============================================================
 * IFRAME (YouTube / Vimeo)
 * ============================================================== */

.wcpgv-video-iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  display: block;
  background: #000;
}

/* ==============================================================
 * PREVENT ZOOM OVERLAY ON VIDEO SLIDE
 * ============================================================== */

.wcpgv-video-slide .zoomImg {
  display: none !important;
}

/* ==============================================================
 * PLAY ICON ON GALLERY THUMBNAIL (FlexSlider nav)
 * ============================================================== */

.woocommerce-product-gallery
  .flex-control-thumbs
  li:has(img[alt="Product video"])::after,
.woocommerce-product-gallery
  .flex-control-nav
  li:has(img[alt="Product video"])::after {
  content: "▶";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  line-height: 26px;
  border-radius: 50%;
  text-align: center;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  padding-left: 2px;
  pointer-events: none;
  z-index: 2;
}

/* Fallback for browsers without :has() support (JS adds .wcpgv-thumb-video) */
.woocommerce-product-gallery .flex-control-thumbs li.wcpgv-thumb-video,
.woocommerce-product-gallery .flex-control-nav li.wcpgv-thumb-video {
  position: relative;
}

.woocommerce-product-gallery .flex-control-thumbs li.wcpgv-thumb-video::after,
.woocommerce-product-gallery .flex-control-nav li.wcpgv-thumb-video::after {
  content: "▶";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  line-height: 26px;
  border-radius: 50%;
  text-align: center;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  padding-left: 2px;
  pointer-events: none;
  z-index: 2;
}

/* ==============================================================
 * FALLBACK: PRODUCT HAS NO IMAGES
 * ==============================================================
 * When the gallery has no slider (FlexSlider absent or failed),
 * we render the video slide full-width so it becomes the main
 * preview instead of a thumbnail-sized block.
 * ============================================================== */

.woocommerce-product-gallery.wcpgv-no-slider
  .woocommerce-product-gallery__wrapper {
  display: block;
  width: 100%;
}

.woocommerce-product-gallery.wcpgv-no-slider
  .woocommerce-product-gallery__image,
.woocommerce-product-gallery.wcpgv-no-slider .wcpgv-video-slide {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
  position: relative;
}

.woocommerce-product-gallery.wcpgv-no-slider .wcpgv-video-wrapper {
  min-height: 0;
}

.woocommerce-product-gallery.wcpgv-no-slider .wcpgv-video,
.woocommerce-product-gallery.wcpgv-no-slider .wcpgv-video-iframe {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

/* Hide the empty thumbnail nav when there's only the video. */
.woocommerce-product-gallery.wcpgv-no-slider .flex-control-nav,
.woocommerce-product-gallery.wcpgv-no-slider .flex-control-thumbs,
.woocommerce-product-gallery.wcpgv-no-slider .flex-direction-nav {
  display: none !important;
}

/* ==============================================================
 * FALLBACK: FLEXSLIDER ACTIVE BUT SLIDE STILL SMALL
 * ==============================================================
 * Ensures the video slide always fills the main preview area
 * even when the theme's CSS is restrictive.
 * ============================================================== */

.woocommerce-product-gallery.wcpgv-flex-active .wcpgv-video-slide {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
}





