/* ========== 产品图库 custom-product-gallery ========== */
.custom-product-gallery {
	position: relative;
	display: flex;
	flex-direction: row;
	gap: 12px;
	align-items: flex-start;
	width: 100%;
	margin-bottom: 1rem;
}

.custom-product-gallery__thumbs {
	flex-shrink: 0;
	width: 88px;
	height: 380px;
	min-height: 320px;
	position: relative;
}

.custom-product-gallery__thumbs-swiper {
	height: 100%;
}

.custom-product-gallery__thumbs-swiper .swiper-wrapper {
	flex-direction: column;
}

.custom-product-gallery__thumbs-swiper .swiper-slide {
	height: 72px;
	width: 72px;
	flex-shrink: 0;
	margin: 0 auto;
}

.custom-product-gallery__thumb {
	display: block;
	width: 72px;
	height: 72px;
	padding: 0;
	border: 2px solid transparent;
	background: #fff;
	cursor: pointer;
	border-radius: 4px;
	overflow: hidden;
	transition: border-color 0.2s, opacity 0.2s;
}

.custom-product-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.custom-product-gallery__thumb:hover {
	opacity: 0.9;
}

.custom-product-gallery__thumbs-swiper .swiper-slide-thumb-active .custom-product-gallery__thumb {
	border-color: #333;
}

.custom-product-gallery__thumbs-prev,
.custom-product-gallery__thumbs-next {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 72px;
	height: 32px;
	z-index: 2;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 6px;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0,0,0,0.08);
	transition: background 0.2s, border-color 0.2s;
}

.custom-product-gallery__thumbs-prev {
	top: 0;
}

.custom-product-gallery__thumbs-next {
	bottom: 0;
}

.custom-product-gallery__thumbs-prev:hover,
.custom-product-gallery__thumbs-next:hover {
	background: #f0f0f0;
	border-color: #999;
}

.custom-product-gallery__thumbs-prev::after,
.custom-product-gallery__thumbs-next::after {
	content: '';
	display: block;
	width: 12px;
	height: 12px;
	border-right: 2px solid #333;
	border-bottom: 2px solid #333;
	margin: 0 auto;
}

.custom-product-gallery__thumbs-prev::after {
	transform: rotate(-135deg);
	margin-top: 10px;
}

.custom-product-gallery__thumbs-next::after {
	transform: rotate(45deg);
	margin-top: 6px;
}

.custom-product-gallery__thumbs-prev.swiper-button-disabled,
.custom-product-gallery__thumbs-next.swiper-button-disabled {
	opacity: 0.35;
	pointer-events: none;
}

.custom-product-gallery__main {
	flex: 1;
	min-width: 0;
	position: relative;
	overflow: hidden;
	background: #f5f5f5;
	border-radius: 4px;
}

.custom-product-gallery__main-swiper {
	width: 100%;
	overflow: hidden;
}

.custom-product-gallery__main-cell {
	width: 100%;
	line-height: 0;
}

.custom-product-gallery__main-cell img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	vertical-align: middle;
}

/* Swiper 未初始化时仅显示第一张主图，避免多图叠加 */
.custom-product-gallery__main-swiper:not(.swiper-initialized) .swiper-wrapper {
	display: block;
	height: auto !important;
}

.custom-product-gallery__main-swiper:not(.swiper-initialized) .swiper-slide {
	display: none !important;
	height: auto !important;
}

.custom-product-gallery__main-swiper:not(.swiper-initialized) .swiper-slide:first-child {
	display: block !important;
}

.custom-product-gallery__main-swiper:not(.swiper-initialized) .swiper-slide .custom-product-gallery__main-cell {
	width: 100%;
}

@media (max-width: 767px) {
	.custom-product-gallery {
		flex-direction: column;
		align-items: center;
	}

	.custom-product-gallery__thumbs {
		width: 100%;
		height: 260px;
		min-height: 200px;
	}

	.custom-product-gallery__thumbs-swiper {
		width: 100%;
	}

	.custom-product-gallery__thumbs-swiper .swiper-slide {
		height: 72px;
		width: 72px;
	}

	.custom-product-gallery__thumbs-prev,
	.custom-product-gallery__thumbs-next {
		width: 72px;
		height: 32px;
		left: 50%;
		transform: translateX(-50%);
	}

	.custom-product-gallery__thumbs-prev {
		top: 0;
	}

	.custom-product-gallery__thumbs-next {
		bottom: 0;
	}
}
