/**
 * Frontend Styles for WooCommerce Product Gallery Video
 * Colomer & Sons luxury design integration
 */

/* ── Video slide & thumbnail wrapper ─────────────────────────────────────── */
.pd-carousel-slide-video,
.pd-gallery-thumb-video {
	position: relative !important;
	cursor: pointer;
}

.pd-video-thumb-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	display: block;
	overflow: hidden;
	border-radius: inherit;
}

.pd-video-thumb-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.pd-carousel-slide-video:hover .pd-video-thumb-wrap img,
.pd-gallery-thumb-video:hover .pd-video-thumb-wrap img {
	transform: scale(1.04);
}

/* ── Luxury Circular Play Badge ─────────────────────────────────────────── */
.pd-video-play-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(18, 18, 18, 0.78);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	border: 1.5px solid rgba(255, 255, 255, 0.85);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
	transition: all 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
	pointer-events: none;
	z-index: 3;
}

.pd-video-play-badge svg {
	width: 18px;
	height: 18px;
	margin-left: 2px; /* Visual optical center for triangle */
	fill: currentColor;
	transition: transform 0.25s ease;
}

.pd-carousel-slide-video:hover .pd-video-play-badge,
.pd-gallery-thumb-video:hover .pd-video-play-badge {
	transform: translate(-50%, -50%) scale(1.14);
	background: #8b0000; /* Signature Colomer & Sons brand burgundy */
	border-color: #ffffff;
	box-shadow: 0 6px 22px rgba(139, 0, 0, 0.6);
}

.pd-carousel-slide-video:hover .pd-video-play-badge svg,
.pd-gallery-thumb-video:hover .pd-video-play-badge svg {
	transform: scale(1.08);
}

/* Small badge indicator on slide */
.pd-video-label-tag {
	position: absolute;
	bottom: 8px;
	left: 8px;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 2px 7px;
	border-radius: 4px;
	pointer-events: none;
	z-index: 2;
}

/* ── Lightbox Video Player ───────────────────────────────────────────────── */
.pd-lightbox-video-wrapper {
	position: relative;
	width: 82vw;
	max-width: 980px;
	aspect-ratio: 16 / 9;
	max-height: 80vh;
	background: #000000;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
	display: flex;
	align-items: center;
	justify-content: center;
}

.pd-lightbox-video-wrapper iframe,
.pd-lightbox-video-wrapper video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
	outline: none;
	object-fit: contain;
}

/* ── Main Gallery In-Place Video Container ───────────────────────────────── */
.pd-shop-image {
	position: relative; /* Ensure absolute video overlays cleanly */
}

.pd-main-video-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #000000;
	border-radius: 12px;
	overflow: hidden;
	z-index: 8;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	animation: pdFadeIn 0.25s ease-out;
}

@keyframes pdFadeIn {
	from { opacity: 0; transform: scale(0.98); }
	to   { opacity: 1; transform: scale(1); }
}

.pd-main-video-wrapper iframe,
.pd-main-video-wrapper video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
	outline: none;
	object-fit: contain;
}

/* Close video / back to product photo button */
.pd-main-video-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(18, 18, 18, 0.75);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	border: 1px solid rgba(255, 255, 255, 0.35);
	color: #ffffff;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
	transition: all 0.2s ease;
}

.pd-main-video-close:hover {
	background: #8b0000;
	border-color: #ffffff;
	transform: scale(1.08);
}

/* Expand to lightbox button on main video */
.pd-main-video-expand {
	position: absolute;
	top: 12px;
	left: 12px;
	height: 34px;
	padding: 0 12px;
	border-radius: 17px;
	background: rgba(18, 18, 18, 0.75);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	border: 1px solid rgba(255, 255, 255, 0.35);
	color: #ffffff;
	font-size: 12px;
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	z-index: 10;
	transition: all 0.2s ease;
}

.pd-main-video-expand:hover {
	background: #8b0000;
	border-color: #ffffff;
}

/* ── Standard WooCommerce Gallery Thumbs (Universal Fallback) ────────────── */
.woocommerce-product-gallery .pd-video-play-badge {
	width: 32px;
	height: 32px;
}
.woocommerce-product-gallery .pd-video-play-badge svg {
	width: 13px;
	height: 13px;
}

/* ── Responsive Mobile Rules ─────────────────────────────────────────────── */
@media (max-width: 768px) {
	.pd-video-play-badge {
		width: 40px;
		height: 40px;
	}
	.pd-video-play-badge svg {
		width: 15px;
		height: 15px;
	}
	.pd-lightbox-video-wrapper {
		width: 94vw;
		max-height: 60vh;
		border-radius: 6px;
	}
	.pd-main-video-close {
		top: 8px;
		right: 8px;
		width: 34px;
		height: 34px;
		font-size: 14px;
	}
	.pd-main-video-expand {
		display: none; /* Keep clean on small mobile */
	}
}

/* ── Product Card Video Thumbnail (Autoplay, Loop, Muted) ───────────────── */
.product-card-media-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	position: relative;
	text-decoration: none;
}

.product-card-video-wrap {
	position: relative;
	width: 100%;
	height: 295px;
	max-height: 295px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 6px;
	background: transparent;
}

.product-card-video-wrap video.product-card-video {
	width: 100%;
	height: 100%;
	max-height: 295px;
	object-fit: contain;
	pointer-events: none; /* Passes clicks directly to parent <a> */
	display: block;
	transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover .product-card-video-wrap video.product-card-video {
	transform: scale(1.04);
}

.product-card-iframe-container {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	pointer-events: none; /* Passes clicks directly to parent <a> */
	display: flex;
	align-items: center;
	justify-content: center;
}

.product-card-video-iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 160%;
	height: 160%;
	transform: translate(-50%, -50%);
	pointer-events: none;
	border: 0;
}

/* Luxury Video indicator pill in product card */
.product-card-video-pill {
	position: absolute;
	bottom: 8px;
	right: 8px;
	background: rgba(18, 18, 18, 0.82);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 20px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	pointer-events: none;
	z-index: 2;
	border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	transition: background 0.3s ease, border-color 0.3s ease;
}

.product-card-video-pill svg {
	fill: currentColor;
	width: 10px;
	height: 10px;
}

.product-card:hover .product-card-video-pill {
	background: #8b0000;
	border-color: #8b0000;
}

@media (max-width: 576px) {
	.product-card-video-wrap {
		height: 220px;
		max-height: 220px;
	}
	.product-card-video-wrap video.product-card-video {
		max-height: 220px;
	}
}
