/**
 * Frontend CSS for BIV Product Video Gallery for Woocommerce (Swiper Carousel Edition)
 */

:root {
	--biv-arrow-color: #ffffff;
	--biv-arrow-bg: rgba(0, 0, 0, 0.45);
	--biv-badge-color: #e50914;
	--biv-active-border-color: #2563eb;
}

/* Main Container Wrapper */
.biv-gallery-slider-wrapper {
	position: relative;
	width: 100%;
	margin-bottom: 25px;
	box-sizing: border-box;
}

.biv-gallery-slider-wrapper * {
	box-sizing: border-box;
}

.biv-gallery-inner {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
}

/* =========================================================
   Layout Variants: Horizontal / Vertical Left / Right / Grid
   ========================================================= */

/* Vertical Left: Thumbs on left, Main on right */
.biv-gallery-slider-wrapper.biv-layout-vertical_left .biv-gallery-inner {
	flex-direction: row-reverse;
	align-items: stretch;
}

.biv-gallery-slider-wrapper.biv-layout-vertical_left .biv-main-slider {
	flex: 1 1 80%;
	width: 80%;
}

.biv-gallery-slider-wrapper.biv-layout-vertical_left .biv-thumbs-slider {
	flex: 0 0 18%;
	width: 18%;
	max-height: 520px;
}

/* Vertical Right: Main on left, Thumbs on right */
.biv-gallery-slider-wrapper.biv-layout-vertical_right .biv-gallery-inner {
	flex-direction: row;
	align-items: stretch;
}

.biv-gallery-slider-wrapper.biv-layout-vertical_right .biv-main-slider {
	flex: 1 1 80%;
	width: 80%;
}

.biv-gallery-slider-wrapper.biv-layout-vertical_right .biv-thumbs-slider {
	flex: 0 0 18%;
	width: 18%;
	max-height: 520px;
}

/* =========================================================
   Main Swiper Slider
   ========================================================= */
.biv-main-slider {
	position: relative;
	width: 100%;
	background: #0b0f19;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.biv-main-slider .swiper-slide {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000000;
	min-height: 320px;
	overflow: hidden;
}

/* Image Wrap & Hover Zoom */
.biv-image-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	overflow: hidden;
}

.biv-main-image {
	width: 100%;
	height: auto;
	max-height: 600px;
	object-fit: contain;
	display: block;
	transition: transform 0.35s cubic-bezier(0.2, 0, 0.2, 1);
}

.biv-zoom-enabled .biv-image-wrap:hover .biv-main-image {
	transform: scale(1.06);
	cursor: zoom-in;
}

/* Zoom Trigger Button */
.biv-zoom-trigger {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: #1e293b;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	transition: all 0.2s ease;
	z-index: 10;
}

.biv-zoom-trigger:hover {
	transform: scale(1.1);
	background: #ffffff;
	color: #000000;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

/* Swiper Arrows */
.biv-swiper-prev,
.biv-swiper-next {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--biv-arrow-bg) !important;
	color: var(--biv-arrow-color) !important;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	transition: all 0.25s ease;
	z-index: 15;
}

.biv-swiper-prev:after,
.biv-swiper-next:after {
	display: none;
}

.biv-swiper-prev:hover,
.biv-swiper-next:hover {
	transform: scale(1.12);
	background: rgba(0, 0, 0, 0.75) !important;
}

.biv-swiper-prev {
	left: 14px;
}

.biv-swiper-next {
	right: 14px;
}

/* Swiper Pagination Dots */
.biv-swiper-pagination .swiper-pagination-bullet {
	background: rgba(255, 255, 255, 0.7);
	opacity: 0.6;
	width: 8px;
	height: 8px;
	transition: all 0.2s ease;
}

.biv-swiper-pagination .swiper-pagination-bullet-active {
	background: #ffffff;
	opacity: 1;
	transform: scale(1.3);
}

/* =========================================================
   Thumbs Slider
   ========================================================= */
.biv-thumbs-slider {
	position: relative;
	width: 100%;
	padding: 4px 0;
	box-sizing: border-box;
}

.biv-thumb-slide {
	cursor: pointer;
	border-radius: 8px;
	overflow: hidden;
	opacity: 0.55;
	transition: all 0.25s ease;
	border: 2px solid transparent;
}

.biv-thumb-slide.swiper-slide-thumb-active {
	opacity: 1;
	border-color: var(--biv-active-border-color);
	transform: scale(1.02);
}

.biv-thumb-inner {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 6px;
}

.biv-thumb-inner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Grid Layout for Thumbs */
.biv-thumbs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
	gap: 8px;
	margin-top: 8px;
}

.biv-grid-thumb-item {
	position: relative;
	aspect-ratio: 1 / 1;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	border: 2px solid transparent;
	opacity: 0.6;
	transition: all 0.2s ease;
}

.biv-grid-thumb-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.biv-grid-thumb-item.active {
	opacity: 1;
	border-color: var(--biv-active-border-color);
	transform: scale(1.03);
}

/* =========================================================
   Video Player Container & Ratios
   ========================================================= */
.biv-video-player-container {
	position: relative;
	width: 100%;
	height: 100%;
	background: #000000;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.biv-video-player-container.biv-ratio-16-9 {
	aspect-ratio: 16 / 9;
	min-height: 320px;
}

.biv-video-player-container.biv-ratio-1-1 {
	aspect-ratio: 1 / 1;
}

.biv-video-player-container.biv-ratio-4-3 {
	aspect-ratio: 4 / 3;
}

.biv-video-player-container.biv-ratio-9-16 {
	aspect-ratio: 9 / 16;
	max-height: 600px;
	margin: 0 auto;
}

.biv-video-element {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	outline: none;
	background: #000000;
}

.biv-iframe-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.biv-video-iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Poster Box / Popup Mode */
.biv-video-poster-box {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #0f172a;
	cursor: pointer;
}

.biv-video-poster-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.biv-video-poster-box:hover .biv-video-poster-img {
	transform: scale(1.03);
}

.biv-video-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 68px;
	height: 68px;
	background: var(--biv-badge-color, #e50914);
	color: #ffffff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 25px rgba(0, 0, 0, 0.45);
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	z-index: 2;
	padding: 0;
}

.biv-video-play-btn svg {
	width: 30px;
	height: 30px;
	margin-left: 3px;
	fill: currentColor;
}

.biv-video-poster-box:hover .biv-video-play-btn {
	transform: translate(-50%, -50%) scale(1.15);
	box-shadow: 0 8px 30px rgba(229, 9, 20, 0.6);
}

/* Play Badge on Thumbnails */
.biv-thumb-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 26px;
	height: 26px;
	background: var(--biv-badge-color, #e50914);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	pointer-events: none;
	transition: transform 0.2s ease;
	z-index: 5;
}

.biv-thumb-badge svg {
	width: 13px;
	height: 13px;
	margin-left: 2px;
	fill: currentColor;
}

.biv-thumb-slide:hover .biv-thumb-badge,
.biv-grid-thumb-item:hover .biv-thumb-badge {
	transform: translate(-50%, -50%) scale(1.18);
}

/* =========================================================
   Lightbox Modal
   ========================================================= */
.biv-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.88);
	backdrop-filter: blur(8px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	padding: 24px;
	box-sizing: border-box;
}

.biv-modal-backdrop.biv-active {
	opacity: 1;
	visibility: visible;
}

.biv-modal-content {
	position: relative;
	width: 100%;
	max-width: 950px;
	background: #000000;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
	transform: scale(0.92);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.biv-modal-backdrop.biv-active .biv-modal-content {
	transform: scale(1);
}

.biv-modal-close-btn {
	position: absolute;
	top: -45px;
	right: 0;
	width: 36px;
	height: 36px;
	background: rgba(255, 255, 255, 0.2);
	border: none;
	border-radius: 50%;
	color: #ffffff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.biv-modal-close-btn:hover {
	background: rgba(255, 255, 255, 0.4);
}

.biv-modal-body {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	display: flex;
	align-items: center;
	justify-content: center;
}

.biv-modal-body iframe,
.biv-modal-body video {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Shortcode Grid */
.biv-shortcode-video-gallery {
	display: grid;
	gap: 20px;
	margin: 20px 0;
}

.biv-shortcode-video-gallery.biv-columns-1 {
	grid-template-columns: 1fr;
}

.biv-shortcode-video-gallery.biv-columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.biv-shortcode-video-gallery.biv-columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.biv-shortcode-item {
	background: #ffffff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.biv-shortcode-item .biv-video-title {
	margin: 12px 16px;
	font-size: 16px;
	color: #1e293b;
}

/* =========================================================
   Responsive Breakpoints
   ========================================================= */
@media (max-width: 768px) {
	.biv-gallery-slider-wrapper.biv-layout-vertical_left .biv-gallery-inner,
	.biv-gallery-slider-wrapper.biv-layout-vertical_right .biv-gallery-inner {
		flex-direction: column !important;
	}

	.biv-gallery-slider-wrapper.biv-layout-vertical_left .biv-main-slider,
	.biv-gallery-slider-wrapper.biv-layout-vertical_right .biv-main-slider,
	.biv-gallery-slider-wrapper.biv-layout-vertical_left .biv-thumbs-slider,
	.biv-gallery-slider-wrapper.biv-layout-vertical_right .biv-thumbs-slider {
		width: 100% !important;
		flex: none !important;
		max-height: none !important;
	}

	.biv-modal-close-btn {
		top: 10px;
		right: 10px;
		background: rgba(0, 0, 0, 0.65);
		z-index: 10;
	}

	.biv-shortcode-video-gallery.biv-columns-2,
	.biv-shortcode-video-gallery.biv-columns-3 {
		grid-template-columns: 1fr;
	}
}
