/**
 * Video Gallery Pro - Frontend Styles
 *
 * Integrates video play icons and lightbox popup with Flatsome WooCommerce product gallery.
 *
 * @package VideoGalleryPro
 * @version 1.0.0
 */

/* ==========================================================================
   1. Play Icon Overlay on Video Slides (Flatsome Product Gallery Slider)
   ========================================================================== */

.product-gallery-slider .vgp-video-slide,
.vgp-video-slide {
	position: relative;
	cursor: pointer;
}

.vgp-video-slide img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	object-position: center;
	aspect-ratio: auto;
}

.vgp-video-slide .vgp-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 70px;
	height: 70px;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	pointer-events: none;
	transition: background 0.3s, transform 0.3s;
}

.vgp-video-slide .vgp-play-icon::after {
	content: '';
	display: block;
	width: 0;
	height: 0;
	border-left: 22px solid #ffffff;
	border-top: 14px solid transparent;
	border-bottom: 14px solid transparent;
	margin-left: 3px;
}

.vgp-video-slide:hover .vgp-play-icon {
	background: rgba(255, 0, 0, 0.8);
	transform: translate(-50%, -50%) scale(1.1);
}

/* Disable Flatsome image zoom on video slides */
.vgp-video-slide .zoomImg,
.vgp-video-slide .zoom-img {
	display: none !important;
}

.vgp-video-slide a {
	pointer-events: auto;
}


/* ==========================================================================
   2. Video Thumbnail in Strip (Flatsome Product Thumbnails)
   ========================================================================== */

.product-thumbnails .vgp-video-thumb,
.vgp-video-thumb {
	position: relative;
}

.vgp-video-thumb img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	object-position: center;
}

.vgp-video-thumb .vgp-thumb-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 28px;
	height: 28px;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	pointer-events: none;
}

.vgp-video-thumb .vgp-thumb-play::after {
	content: '';
	display: block;
	width: 0;
	height: 0;
	border-left: 10px solid #ffffff;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	margin-left: 2px;
}


/* ==========================================================================
   3. Video Lightbox / Popup Overlay
   ========================================================================== */

.vgp-video-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.85);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: vgpFadeIn 0.3s ease;
}

.vgp-overlay-inner {
	position: relative;
	width: 90%;
	max-width: 900px;
}

.vgp-overlay-close {
	position: absolute;
	top: -40px;
	right: 0;
	color: #ffffff;
	font-size: 32px;
	background: none;
	border: none;
	cursor: pointer;
	z-index: 10;
	transition: transform 0.2s;
	line-height: 1;
	padding: 0;
}

.vgp-overlay-close:hover {
	transform: scale(1.2);
}

.vgp-video-wrapper {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
	height: 0;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.vgp-video-wrapper iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
}


/* ==========================================================================
   4. Body Active State
   ========================================================================== */

body.vgp-overlay-active {
	overflow: hidden;
}


/* ==========================================================================
   5. Keyframe Animations
   ========================================================================== */

@keyframes vgpFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}


/* ==========================================================================
   6. Responsive Styles (Mobile Breakpoints)
   ========================================================================== */

@media (max-width: 768px) {
	.vgp-video-slide .vgp-play-icon {
		width: 50px;
		height: 50px;
	}

	.vgp-video-slide .vgp-play-icon::after {
		border-left: 16px solid #ffffff;
		border-top: 10px solid transparent;
		border-bottom: 10px solid transparent;
		margin-left: 2px;
	}

	.vgp-overlay-inner {
		width: 95%;
	}

	.vgp-overlay-close {
		top: -35px;
		font-size: 28px;
	}
}
