/**
 * Product gallery media — inline video / embed + fullscreen lightbox.
 *
 * @package Plastpro
 */

.product-gallery-main__image,
.product-gallery-main__video {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}

.product-gallery-main__video-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
}

.product-gallery-main__video-wrap .product-gallery-main__video {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.product-gallery-main__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.28);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	z-index: 2;
}

.product-gallery-main__video-wrap.is-paused .product-gallery-main__play {
	opacity: 1;
	visibility: visible;
}

.product-gallery-main__video-wrap.is-playing .product-gallery-main__play {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.product-gallery-main__play-icon {
	display: block;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
	position: relative;
}

.product-gallery-main__play-icon::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-35%, -50%);
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 14px 0 14px 22px;
	border-color: transparent transparent transparent #1a1a1a;
}

.product-gallery-main__play:hover .product-gallery-main__play-icon,
.product-gallery-main__play:focus-visible .product-gallery-main__play-icon {
	background: #fff;
	transform: scale(1.04);
}

.product-gallery-main__play:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

@media (max-width: 767px) {
	.product-gallery-main__play-icon {
		width: 56px;
		height: 56px;
	}

	.product-gallery-main__play-icon::after {
		border-width: 11px 0 11px 17px;
	}
}

/* Flexible embed box: works for landscape; vertical embeds letterbox within max height */
.product-gallery-main__embed {
	position: relative;
	width: 100%;
	max-height: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
}

.product-gallery-main__embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.product-gallery-thumb--video {
	position: relative;
}

.product-gallery-thumb--video::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 0;
	height: 0;
	margin: -8px 0 0 -5px;
	border-style: solid;
	border-width: 8px 0 8px 14px;
	border-color: transparent transparent transparent rgba(255, 255, 255, 0.95);
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
	pointer-events: none;
	z-index: 1;
}

.product-gallery-thumb--video::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.2);
	pointer-events: none;
	z-index: 0;
}

.product-gallery-thumb__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 64px;
	aspect-ratio: 1;
	background: #2a2a2a;
	color: #fff;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Expandable main media: pointer hand (Amazon-style), no zoom cursor */
.product-gallery-main--expandable {
	cursor: pointer;
}

.product-gallery-main--expandable img {
	cursor: pointer;
}

.product-gallery-main-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

.product-gallery-fullview-hint {
	display: block;
	margin: 0.5rem 0 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #555;
	font-family: var(--plastpro-font-family, 'Montserrat', sans-serif);
	font-size: 13px;
	line-height: 1.4;
	text-align: center;
	cursor: pointer;
	text-decoration: none;
}

.product-gallery-fullview-hint:hover,
.product-gallery-fullview-hint:focus-visible {
	color: #1a1a1a;
	text-decoration: underline;
}

.product-gallery-fullview-hint:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 2px;
}

/* Door style main slot: keep video within fixed gallery height */
.door-style-main-image .product-gallery-main__video-wrap,
.door-style-main-image .product-gallery-main__embed {
	max-height: 100%;
}

.door-style-main-image .product-gallery-main__embed {
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
}

/* ---------- Fullscreen lightbox ---------- */

body.product-gallery-lightbox-open {
	overflow: hidden;
}

.product-gallery-lightbox[hidden] {
	display: none !important;
}

.product-gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: stretch;
	justify-content: center;
}

.product-gallery-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
}

.product-gallery-lightbox__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(1100px, 100%);
	height: 100%;
	padding: 56px 16px 20px;
	box-sizing: border-box;
}

.product-gallery-lightbox__close {
	position: absolute;
	top: 12px;
	right: 16px;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: #fff;
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}

.product-gallery-lightbox__close:hover,
.product-gallery-lightbox__close:focus-visible {
	background: rgba(255, 255, 255, 0.12);
}

.product-gallery-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
}

.product-gallery-lightbox__nav:hover,
.product-gallery-lightbox__nav:focus-visible {
	background: rgba(255, 255, 255, 0.22);
}

.product-gallery-lightbox__nav--prev {
	left: 8px;
}

.product-gallery-lightbox__nav--next {
	right: 8px;
}

.product-gallery-lightbox__stage {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 56px;
}

.product-gallery-lightbox__image,
.product-gallery-lightbox__video {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.product-gallery-lightbox__video-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	max-height: 100%;
	background: #000;
}

.product-gallery-lightbox__video-wrap .product-gallery-lightbox__video {
	max-height: calc(100vh - 180px);
}

.product-gallery-lightbox__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.28);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	z-index: 2;
}

.product-gallery-lightbox__video-wrap.is-paused .product-gallery-lightbox__play {
	opacity: 1;
	visibility: visible;
}

.product-gallery-lightbox__video-wrap.is-playing .product-gallery-lightbox__play {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.product-gallery-lightbox__play-icon {
	display: block;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	position: relative;
}

.product-gallery-lightbox__play-icon::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-35%, -50%);
	border-style: solid;
	border-width: 14px 0 14px 22px;
	border-color: transparent transparent transparent #1a1a1a;
}

.product-gallery-lightbox__embed {
	position: relative;
	width: min(100%, 960px);
	aspect-ratio: 16 / 9;
	max-height: calc(100vh - 180px);
	background: #000;
}

.product-gallery-lightbox__embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.product-gallery-lightbox__thumbs {
	flex: 0 0 auto;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 16px 8px 4px;
}

.product-gallery-lightbox__thumb {
	width: 64px;
	height: 64px;
	padding: 0;
	margin: 0;
	border: 2px solid transparent;
	border-radius: 4px;
	background: #1a1a1a;
	cursor: pointer;
	overflow: hidden;
	position: relative;
}

.product-gallery-lightbox__thumb.is-active {
	border-color: #fff;
}

.product-gallery-lightbox__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.product-gallery-lightbox__thumb--video::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 0;
	height: 0;
	margin: -6px 0 0 -4px;
	border-style: solid;
	border-width: 6px 0 6px 10px;
	border-color: transparent transparent transparent rgba(255, 255, 255, 0.95);
	pointer-events: none;
}

.product-gallery-lightbox__thumb-label {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #fff;
	font-size: 10px;
	text-transform: uppercase;
}

@media (max-width: 767px) {
	.product-gallery-lightbox__dialog {
		padding: 52px 8px 12px;
	}

	.product-gallery-lightbox__stage {
		padding: 0 8px;
	}

	.product-gallery-lightbox__nav {
		width: 40px;
		height: 40px;
		font-size: 28px;
	}

	.product-gallery-lightbox__nav--prev {
		left: 4px;
	}

	.product-gallery-lightbox__nav--next {
		right: 4px;
	}
}
