/**
 * HF Product Videos - Frontend Styles
 */

/* ========== Custom Gallery Container ========== */
.hf-pv-custom-gallery {
	position: relative;
	width: 100%;
	max-width: 600px;
	margin: 0 auto;
}

/* ========== Main Gallery Area ========== */
.hf-pv-gallery-main {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #000;
	overflow: hidden;
	border-radius: 8px;
}

.hf-pv-gallery-item {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hf-pv-gallery-item.active {
	opacity: 1;
	pointer-events: auto;
}

.hf-pv-gallery-item img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* ========== Video Items ========== */
.hf-pv-video-click-overlay {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.hf-pv-video-click-overlay img,
.hf-pv-video-click-overlay .hf-pv-inline-video {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.hf-pv-video-click-overlay .hf-pv-inline-video {
	pointer-events: none;
}

.hf-pv-video-click-overlay .hf-pv-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.hf-pv-video-click-overlay:hover .hf-pv-play-icon {
	transform: translate(-50%, -50%) scale(1.1);
}

/* ========== Gallery Navigation Arrows ========== */
.hf-pv-gallery-nav {
	position: absolute;
	top: 40%;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	pointer-events: none;
	z-index: 10;
	padding: 0 10px;
}

.hf-pv-gallery-nav button {
	pointer-events: auto;
	background: rgba(0, 0, 0, 0.5);
	border: none;
	color: white;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.hf-pv-gallery-nav button:hover {
	background: rgba(0, 0, 0, 0.8);
	transform: scale(1.1);
}

.hf-pv-gallery-nav button svg {
	width: 24px;
	height: 24px;
}

/* ========== Thumbnail Strip ========== */
.hf-pv-gallery-thumbnails {
	display: flex;
	gap: 10px;
	margin-top: 15px;
	overflow-x: auto;
	padding: 5px 0;
	scrollbar-width: thin;
}

.hf-pv-gallery-thumbnails::-webkit-scrollbar {
	height: 6px;
}

.hf-pv-gallery-thumbnails::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 3px;
}

.hf-pv-thumbnail {
	position: relative;
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border: 2px solid transparent;
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	transition: border-color 0.2s ease, transform 0.2s ease;
	/* background: #f5f5f5; */
}

.hf-pv-thumbnail:hover {
	transform: scale(1.05);
}

.hf-pv-thumbnail.active {
	border-color: #2ecc71;
}

.hf-pv-thumbnail img,
.hf-pv-thumbnail .hf-pv-thumb-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hf-pv-thumbnail .hf-pv-thumb-video {
	pointer-events: none;
}

/* ========== Video Thumbnail Play Icon ========== */
.hf-pv-video-thumbnail .hf-pv-play-icon-small {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.hf-pv-video-thumbnail:hover .hf-pv-play-icon-small {
	transform: translate(-50%, -50%) scale(1.1);
	transition: transform 0.2s ease;
}

/* ========== Fullscreen Video Modal ========== */
.hf-pv-video-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.95);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.hf-pv-modal-close {
	position: absolute;
	top: 20px;
	right: 20px;
	background: transparent;
	border: none;
	color: white;
	cursor: pointer;
	padding: 10px;
	z-index: 1000000;
	transition: transform 0.2s ease;
}

.hf-pv-modal-close:hover {
	transform: scale(1.1);
}

#hf-pv-video-player {
	width: 100%;
	max-width: 1200px;
	aspect-ratio: 16 / 9;
	background: #000;
}

#hf-pv-video-player iframe,
#hf-pv-video-player video {
	width: 100%;
	height: 100%;
	border: none;
}

/* Prevent body scroll when modal is open */
body.hf-pv-modal-open {
	overflow: hidden;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
	.hf-pv-gallery-nav button {
		width: 35px;
		height: 35px;
	}

	.hf-pv-gallery-nav button svg {
		width: 20px;
		height: 20px;
	}

	.hf-pv-thumbnail {
		width: 60px;
		height: 60px;
	}

	.hf-pv-video-modal {
		padding: 10px;
	}

	.hf-pv-modal-close {
		top: 10px;
		right: 10px;
	}
}

/* ========== Compatibility Fixes ========== */
/* Ensure our gallery doesn't get overridden by theme styles */
.woocommerce div.product .hf-pv-custom-gallery {
	width: 100%;
	float: none;
}

/* Reset any conflicting flexslider styles */
.hf-pv-custom-gallery .flex-viewport,
.hf-pv-custom-gallery .flex-control-nav,
.hf-pv-custom-gallery .flex-direction-nav {
	display: none !important;
}
