/* === Floating video thumbnail (fallback if injection fails) === */
.artiq-pv-floating-thumb-wrap {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9998;
	width: 96px;
	height: 96px;
	pointer-events: none;
}

.artiq-pv-floating-thumb {
	position: relative;
	width: 100%;
	height: 100%;
	cursor: pointer;
	border-radius: 8px;
	overflow: hidden;
	background: #1a1a1a;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	pointer-events: auto;
}

/* === When injected into Flexslider/Flickity thumbnail row === */
.artiq-pv-inline-thumb {
	position: relative;
	cursor: pointer;
	overflow: hidden;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Inside Flexslider thumb list — match sibling li sizing exactly */
.flex-control-thumbs .artiq-pv-inline-thumb {
	position: relative !important;
	display: inline-block !important;
	float: none !important;
	vertical-align: top;
	cursor: pointer;
	overflow: hidden;
	padding: 0;
	list-style: none;
}

/* Reset the inner floating-thumb wrapper inside gallery context */
.flex-control-thumbs .artiq-pv-inline-thumb .artiq-pv-floating-thumb {
	position: relative !important;
	display: block !important;
	width: 100% !important;
	height: auto !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	overflow: visible !important;
	transition: opacity 0.2s ease !important;
	transform: none !important;
}

.flex-control-thumbs .artiq-pv-inline-thumb .artiq-pv-floating-thumb:hover {
	transform: none !important;
	box-shadow: none !important;
	opacity: 0.8;
}

/* Picture/img fills the li like Flexslider's native img */
.flex-control-thumbs .artiq-pv-inline-thumb picture,
.flex-control-thumbs .artiq-pv-inline-thumb .artiq-pv-thumb-img {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	position: static !important;
	margin: 0 !important;
}

.flex-control-thumbs .artiq-pv-inline-thumb img {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	opacity: 1 !important;
	margin: 0 !important;
}

/* Dark tint overlay — makes the yellow play button pop */
.flex-control-thumbs .artiq-pv-inline-thumb .artiq-pv-floating-thumb::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.65);
	pointer-events: none;
	z-index: 1;
}

/* Play icon overlay */
.flex-control-thumbs .artiq-pv-inline-thumb .artiq-pv-thumb-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 5;
	width: 28px;
	height: 28px;
	line-height: 28px;
	text-align: center;
	color: #1a1a1a;
	font-size: 12px;
	background: #fcba26;
	border-radius: 50%;
	padding-left: 2px;
	box-sizing: border-box;
	pointer-events: none;
}

/* === Fallback thumbnail strip built by JS when the gallery script renders none
   (product with only a main image, or none). Scoped to .artiq-pv-built so the
   normal multi-image strips stay untouched. The layout itself is left to the
   theme/WooCommerce rules for the strip's own class (.flex-control-thumbs or
   .product-thumbnail-images-container) — we only fix the video tile's sizing. === */
.artiq-pv-built .thumbnail-item img {
	display: block;
	width: 100%;
	height: auto;
}

/* Neutralise the floating-thumb's fixed sizing so it behaves like a thumbnail. */
.artiq-pv-built .artiq-pv-inline-thumb.artiq-pv-floating-thumb {
	height: auto;
	border-radius: 0;
	background: #1a1a1a;
	box-shadow: none;
	overflow: hidden;
}

.artiq-pv-built .artiq-pv-inline-thumb .artiq-pv-thumb-img {
	position: relative;
	width: 100%;
	height: auto;
}

/* Keep a built tile visible even with no sibling/poster (product with no images). */
.flex-control-thumbs.artiq-pv-built .artiq-pv-inline-thumb {
	display: inline-block;
	width: 100px;
	min-height: 100px;
}

.artiq-pv-floating-thumb:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.artiq-pv-floating-thumb:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.artiq-pv-floating-thumb .artiq-pv-thumb-img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
}

.artiq-pv-floating-thumb::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.65);
	pointer-events: none;
	z-index: 1;
}

.artiq-pv-floating-thumb .artiq-pv-thumb-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	width: 38px;
	height: 38px;
	line-height: 38px;
	text-align: center;
	color: #1a1a1a;
	font-size: 16px;
	background: #fcba26;
	border-radius: 50%;
	padding-left: 3px;
	box-sizing: border-box;
	pointer-events: none;
}

@media (max-width: 600px) {
	.artiq-pv-floating-thumb-wrap {
		width: 72px;
		height: 72px;
		right: 12px;
		bottom: 12px;
	}
	.artiq-pv-floating-thumb .artiq-pv-thumb-play {
		width: 30px;
		height: 30px;
		line-height: 30px;
		font-size: 14px;
	}
}

/* === Modal === */
.artiq-pv-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
}

.artiq-pv-modal.is-open {
	display: flex;
}

.artiq-pv-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
	cursor: pointer;
}

.artiq-pv-modal-dialog {
	position: relative;
	width: 90%;
	max-width: 960px;
	background: #000;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.artiq-pv-modal-content {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
}

.artiq-pv-modal-content iframe,
.artiq-pv-modal-content video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: #000;
}

.artiq-pv-modal-close {
	position: absolute;
	top: -38px;
	right: 0;
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 10px;
}

.artiq-pv-modal-close:hover { opacity: 0.7; }

@media (max-width: 600px) {
	.artiq-pv-modal-dialog { width: 96%; }
	.artiq-pv-modal-close { top: -34px; font-size: 28px; }
}
