/* Video slide styling */
.product-gallery .image-item.video-item {
  position: relative;
  overflow: hidden;
}

.product-gallery .image-item.video-item .product-video-link {
  display: block;
  position: relative;
  transition: transform 0.3s ease;
}

.product-gallery .image-item.video-item:hover .product-video-link {
  transform: scale(1.02);
}

.product-gallery .image-item.video-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.3s ease;
}

.product-gallery .image-item.video-item:hover img {
  filter: brightness(0.8);
}

/* Enhanced play button */
.product-gallery .image-item.video-item .woostify-video-play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
  backdrop-filter: blur(4px);
  border: 3px solid rgba(255, 255, 255, 0.3);
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.product-gallery .image-item.video-item:hover .woostify-video-play-icon {
  transform: translate(-50%, -50%) scale(1.1);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.9) 0%, rgba(124, 58, 237, 0.8) 100%);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.product-gallery .image-item.video-item .woostify-video-play-icon::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 22px;
  border-style: solid;
  border-width: 14px 0 14px 20px;
  border-color: transparent transparent transparent #ffffff;
  transition: all 0.3s ease;
}

.product-gallery .image-item.video-item:hover .woostify-video-play-icon::before {
  border-width: 16px 0 16px 22px;
  left: 29px;
  top: 20px;
}

/* Video badge overlay */
.product-gallery .image-item.video-item::after {
  content: "VIDEO";
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
  z-index: 2;
}

/* Thumbnail video indicator */
.product-gallery .thumbnail-item.video-thumb {
  position: relative;
}

.product-gallery .thumbnail-item.video-thumb::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.product-gallery .thumbnail-item.video-thumb::before {
  content: "";
  position: absolute;
  right: 11px;
  bottom: 10px;
  border-style: solid;
  border-width: 3px 0 3px 4px;
  border-color: transparent transparent transparent #ffffff;
  z-index: 3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .product-gallery .image-item.video-item .woostify-video-play-icon {
    width: 60px;
    height: 60px;
  }
  
  .product-gallery .image-item.video-item .woostify-video-play-icon::before {
    left: 23px;
    top: 18px;
    border-width: 12px 0 12px 16px;
  }
  
  .product-gallery .image-item.video-item:hover .woostify-video-play-icon::before {
    border-width: 12px 0 12px 16px;
    left: 23px;
    top: 18px;
  }
}

/* Animation for loading states */
@keyframes videoSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-gallery .image-item.video-item {
  animation: videoSlideIn 0.5s ease-out;
}

/* Inline video styles */
.product-gallery .image-item.video-item video,
.product-gallery .image-item.video-item iframe {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: block !important; /* Force display */
  visibility: visible !important; /* Force visibility */
}

.product-gallery .image-item.video-item iframe {
  aspect-ratio: 16/9;
  min-height: 250px;
}

/* Ensure inline video items are visible */
.product-gallery .image-item.video-item.inline-video {
  display: block !important;
  visibility: visible !important;
}

.product-gallery .image-item.video-item.inline-video img {
  display: none !important; /* Hide poster image for inline videos */
}

/* Hide video badge when video is inline */
.product-gallery .image-item.video-item:has(video)::after,
.product-gallery .image-item.video-item:has(iframe)::after {
  display: none;
}

/* Fallback for browsers that don't support :has() */
.product-gallery .image-item.video-item.inline-video::after {
  display: none;
}


