/* WooCommerce YouTube Gallery Video - frontend style (เบา ไม่พึ่งพา framework ใดๆ) */

.ytg-video-slide {
	background: #000;
}

.ytg-facade {
	position: relative;
	width: 100%;
	padding-top: 56.25%; /* สัดส่วน 16:9 ให้เข้ากับสไลด์ภาพสินค้าทั่วไป */
	cursor: pointer;
	overflow: hidden;
	display: block;
}

.ytg-facade-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none; /* คลิกทะลุไปโดน .ytg-facade เสมอ */
}

.ytg-facade::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.12);
	transition: background 0.2s ease;
}

.ytg-facade:hover::before {
	background: rgba(0, 0, 0, 0.22);
}

.ytg-facade .ytg-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 68px;
	height: 68px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: var(--ytg-play-color, #ff0000);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s ease;
	z-index: 1;
}

.ytg-facade .ytg-play-btn::after {
	content: "";
	display: block;
	margin-left: 5px;
	border-style: solid;
	border-width: 12px 0 12px 20px;
	border-color: transparent transparent transparent #fff;
}

.ytg-facade:hover .ytg-play-btn {
	transform: translate(-50%, -50%) scale(1.08);
}

.ytg-facade.is-playing::before,
.ytg-facade.is-playing .ytg-play-btn {
	display: none;
}

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

@media (max-width: 480px) {
	.ytg-facade .ytg-play-btn {
		width: 50px;
		height: 50px;
	}

	.ytg-facade .ytg-play-btn::after {
		border-width: 9px 0 9px 15px;
		margin-left: 4px;
	}
}
