/* TTS product page - product video */
@media (min-width: 922px) {
	body.single-product.tts-has-video div.product > .woocommerce-product-gallery,
	body.single-product.tts-has-video div.product > div.images {
		grid-row: 1;
	}

	body.single-product.tts-has-video div.product > .tts-video {
		grid-column: 1;
		grid-row: 2;
	}

	body.single-product.tts-has-video div.product > .summary {
		grid-row: 1 / span 2;
	}
}

body.single-product div.product > .tts-video {
	margin-top: 16px;
}

/* Elementor product template: video sits under the Product Images widget */
.elementor-widget-woocommerce-product-images .tts-video {
	width: 100%;
	margin-top: 20px;
}

.tts-video {
	position: relative;
	overflow: hidden;
	border-radius: 16px;
	background: #111;
	aspect-ratio: 16 / 9;
	max-height: 72vh;
	box-shadow: 0 18px 40px -20px rgba(17, 17, 17, .45);
	clip-path: inset(0 0 0 0 round 16px);
	animation: ttsVidIn .8s cubic-bezier(.2, .8, .2, 1) both;
}

.tts-video--file {
	aspect-ratio: auto;
	display: flex;
	justify-content: center;
}

.tts-video.is-vertical {
	aspect-ratio: 9 / 16;
	max-width: 420px;
	margin-left: auto;
	margin-right: auto;
}

.tts-video__media {
	display: block;
	width: 100%;
	height: auto;
	max-height: 72vh;
	object-fit: contain;
	background: #111;
}

.tts-video__tag {
	position: absolute;
	z-index: 3;
	top: 14px;
	left: 14px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px;
	border-radius: 999px;
	background: rgba(17, 17, 17, .55);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #fff;
	font: 600 12.5px/1 "Inter", system-ui, sans-serif;
	pointer-events: none;
}

.tts-video__dot {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #E10600;
	box-shadow: 0 0 0 0 rgba(17,17,17,.7);
	animation: ttsVidDot 1.6s ease-out infinite;
}

/* YouTube poster */
.tts-video__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: #111 center / cover no-repeat;
	cursor: pointer;
}

.tts-video__poster::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at center, rgba(0, 0, 0, .05), rgba(0, 0, 0, .45));
	transition: opacity .3s ease;
}

.tts-video__poster:hover::after {
	opacity: .6;
}

.tts-video__play {
	position: absolute;
	z-index: 2;
	left: 50%;
	top: 50%;
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	margin: -38px 0 0 -38px;
	border-radius: 999px;
	background: #E10600;
	color: #fff;
	box-shadow: 0 6px 0 #B00500, 0 18px 30px -10px rgba(17,17,17,.8);
	transition: transform .2s ease;
}

.tts-video__play::before {
	content: "";
	position: absolute;
	inset: -8px;
	border-radius: inherit;
	border: 2px solid rgba(255, 255, 255, .8);
	animation: ttsVidPing 2s cubic-bezier(0, 0, .2, 1) infinite;
}

.tts-video__poster:hover .tts-video__play {
	transform: scale(1.08);
}

.tts-video__poster:focus-visible {
	outline: 3px solid #E10600;
	outline-offset: -3px;
}

.tts-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* File controls */
.tts-video__bar {
	position: absolute;
	z-index: 3;
	left: 12px;
	right: 12px;
	bottom: 12px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.tts-video__btn {
	display: grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(17, 17, 17, .55);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #fff;
	cursor: pointer;
	transition: background-color .2s ease, transform .15s ease;
}

.tts-video__btn:hover {
	background: #E10600;
}

.tts-video__btn:active {
	transform: scale(.92);
}

.tts-video__btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.tts-video__btn .i-play,
.tts-video__btn .i-sound,
.tts-video.is-paused .tts-video__btn .i-pause,
.tts-video.has-sound .tts-video__btn .i-muted {
	display: none;
}

.tts-video.is-paused .tts-video__btn .i-play,
.tts-video.has-sound .tts-video__btn .i-sound {
	display: block;
}

.tts-video__progress {
	flex: 1;
	height: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .3);
	overflow: hidden;
}

.tts-video__progress span {
	display: block;
	width: 100%;
	height: 100%;
	background: #E10600;
	transform-origin: 0 50%;
	transform: scaleX(var(--p, 0));
}

@keyframes ttsVidIn {
	from { opacity: 0; transform: translateY(16px) scale(.98); }
	to { opacity: 1; transform: none; }
}

@keyframes ttsVidDot {
	to { box-shadow: 0 0 0 8px rgba(17,17,17,0); }
}

@keyframes ttsVidPing {
	from { transform: scale(.9); opacity: .9; }
	to { transform: scale(1.35); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.tts-video,
	.tts-video *,
	.tts-video *::before {
		animation: none !important;
		transition: none !important;
	}
}
