/**
 * WooCommerce 产品详情页自定义样式
 * 修复缩略图换行问题，让所有缩略图在一行显示
 */

/* 产品图片轮播缩略图 - 强制单行显示，不换行 */
.woocommerce-product-gallery .flex-control-thumbs {
	display: flex !important;
	flex-wrap: nowrap !important;
	overflow-x: auto !important;
	overflow-y: hidden !important;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: #ccc transparent;
}

.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar {
	height: 6px;
}

.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar-track {
	background: transparent;
}

.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar-thumb {
	background-color: #ccc;
	border-radius: 3px;
}

.woocommerce-product-gallery .flex-control-thumbs li {
	flex: 0 0 auto !important;
	min-width: 0 !important;
	width: auto !important;
	max-width: none !important;
}

/* 确保缩略图图片大小合适 */
.woocommerce-product-gallery .flex-control-thumbs li img {
	width: auto;
	height: auto;
	max-width: 100px;
	max-height: 100px;
	object-fit: contain;
}

/* 移除列数限制 */
.woocommerce-product-gallery--columns-4 .flex-control-thumbs li,
.woocommerce-product-gallery--columns-5 .flex-control-thumbs li,
.woocommerce-product-gallery--columns-6 .flex-control-thumbs li {
	width: auto !important;
}

/* YITH视频插件样式优化 */
.woocommerce-product-gallery__wrapper .yith_featured_content {
	position: relative;
	width: 100%;
}

.woocommerce-product-gallery__wrapper .ywcfav-video-content {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 宽高比 */
	height: 0;
	overflow: hidden;
}

.woocommerce-product-gallery__wrapper .ywcfav-video-content iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* MP4视频样式 */
.woocommerce-product-gallery__wrapper .ywcfav-video-content.mp4 {
	padding-bottom: 56.25%; /* 16:9 宽高比 */
}

.woocommerce-product-gallery__wrapper .ywcfav-video-content video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
}

/* 确保视频控件可见 */
.woocommerce-product-gallery__wrapper .ywcfav-video-content video::-webkit-media-controls-panel {
	background-color: rgba(0, 0, 0, 0.8);
}

/* 确保视频在缩略图中也有正确的显示 */
.flex-control-thumbs .yith_featured_content {
	width: 100px;
	height: 100px;
	overflow: hidden;
}

.flex-control-thumbs .yith_featured_content img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 响应式设计 */
@media (max-width: 768px) {
	.woocommerce-product-gallery .flex-control-thumbs li img {
		max-width: 80px;
		max-height: 80px;
	}
	
	.flex-control-thumbs .yith_featured_content {
		width: 80px;
		height: 80px;
	}
}
