/**
 * ACPRO — 產品圖白底/比例修正
 * - 圓形分類：section 改淺灰 + 圓形白底
 * - 其他灰框：只加正方形白底放圖（唔改 section 底色）
 * - 圖片：object-fit:contain（唔拉長、唔裁切）
 */

:root {
	--ac-img-frame-bg: #ffffff;
	--ac-section-mute: #F3F3F3;
}

/* ========== 圖1：分類圓形 — 改 section 淺灰 + 圓形白底 ========== */
.our-category {
	background: var(--ac-section-mute);
}

.category-item-image a {
	background: var(--ac-img-frame-bg) !important;
}

.category-item-image figure {
	display: flex !important;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	width: 100%;
	background: var(--ac-img-frame-bg);
	border-radius: 50%;
	overflow: hidden;
}

.category-item-image figure img {
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	object-position: center !important;
	border-radius: 0 !important;
}

.category-item:hover .category-item-image figure img {
	transform: none !important;
}

/* ========== 圖2/圖3：灰框內加正方形白底（唔改 section 底色） ========== */
.product-item-image a,
.product-item-image figure {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: var(--ac-img-frame-bg) !important;
	border-radius: 10px;
	overflow: hidden;
}

.product-item-image figure img {
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	object-position: center !important;
}

.best-selling-product-item-image {
	padding-bottom: 8px;
}

.best-selling-product-item-image figure {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 210px;
	aspect-ratio: 1 / 1;
	background: var(--ac-img-frame-bg) !important;
	border-radius: 10px !important;
	overflow: hidden;
	margin: 0 auto 0 !important; /* 取消原 template 負 margin，留灰框底層 */
}

.best-selling-product-item-image figure img {
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	object-position: center !important;
	border-radius: 0 !important;
}

.best-selling-product-item.highlighted-box .best-selling-product-item-image {
	margin-left: 0 !important;
	padding-bottom: 8px;
}

.best-selling-product-item.highlighted-box .best-selling-product-item-image figure {
	max-width: 210px !important;
	margin: 0 auto 0 !important;
	border-radius: 10px !important;
}

.best-selling-product-item.highlighted-box .best-selling-product-item-image figure img {
	aspect-ratio: auto !important;
	border-radius: 0 !important;
}

.upcoming-offer-image figure {
	display: flex !important;
	align-items: center;
	justify-content: center;
	background: var(--ac-img-frame-bg) !important;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 10px;
	margin: 0;
}

.upcoming-offer-image figure img {
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	object-position: center !important;
	border-radius: 0 !important;
}

.trending-deal-item-image figure {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: var(--ac-img-frame-bg) !important;
	border-radius: 10px;
	overflow: hidden;
}

.trending-deal-item-image figure img {
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	object-position: center !important;
	border-radius: 0 !important;
}

.trending-deal-item.highlighted-item .trending-deal-item-image figure {
	margin: 0;
	aspect-ratio: 1 / 1;
}

.trending-deal-item.highlighted-item .trending-deal-item-image img {
	aspect-ratio: auto !important;
}

/* 產品詳情：主圖大（上）+ 縮圖細（下橫排），可 click / swipe 切換 */
.product-single-image-box.ac-gallery-stack {
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	gap: 12px !important;
}

.product-single-image-box.ac-gallery-stack .product-single-image-item {
	width: 100% !important;
	max-width: 100% !important;
	order: 1;
	overflow: hidden !important;
	background: var(--ac-section-mute) !important;
	border-radius: 10px;
}

.product-single-image-box.ac-gallery-stack .product-single-image-item .swiper-wrapper {
	align-items: stretch;
}

.product-single-image-box.ac-gallery-stack .product-single-image-item .swiper-slide {
	height: auto !important;
	box-sizing: border-box;
}

.product-single-image-box.ac-gallery-stack .product-single-image-slider {
	width: 100% !important;
	max-width: 100% !important;
	order: 2;
	overflow: hidden !important;
	margin: 0 !important;
}

.product-single-image-box.ac-gallery-stack .product-single-image-slider .swiper-wrapper {
	flex-direction: row !important;
	height: auto !important;
	gap: 0 !important;
	transform-style: preserve-3d;
}

.product-single-image-box.ac-gallery-stack .product-single-image-slider .swiper-slide {
	width: calc((100% - 30px) / 4) !important;
	height: auto !important;
	margin: 0 !important;
	background: var(--ac-img-frame-bg) !important;
	border-radius: 8px;
	opacity: 0.7;
	cursor: pointer;
	border: 2px solid transparent;
	box-sizing: border-box;
}

.product-single-image-box.ac-gallery-stack .product-single-image-slider .swiper-slide-thumb-active {
	opacity: 1;
	border-color: #1a1a1b;
}

.product-single-image-box.ac-single-image-only .product-single-image-item {
	width: 100% !important;
}

.product-single-image-box.ac-gallery-stack .product-single-image-item .swiper-slide figure {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	height: auto !important;
	background: var(--ac-img-frame-bg) !important;
	border-radius: 10px;
	overflow: hidden;
	margin: 0;
}

.product-single-image-box.ac-gallery-stack .product-single-image-slider .swiper-slide figure {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	height: auto !important;
	max-height: 110px;
	background: var(--ac-img-frame-bg) !important;
	border-radius: 6px;
	overflow: hidden;
	margin: 0;
}

.product-single-image-box.ac-gallery-stack .product-single-image-item .swiper-slide figure img,
.product-single-image-box.ac-gallery-stack .product-single-image-slider .swiper-slide figure img {
	width: 100% !important;
	height: 100% !important;
	max-width: 100%;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	object-position: center !important;
}

@media (max-width: 991px) {
	.product-single-image-box.ac-gallery-stack {
		flex-direction: column !important;
	}

	.product-single-image-box.ac-gallery-stack .product-single-image-slider .swiper-slide {
		width: calc((100% - 20px) / 3) !important;
	}

	.product-single-image-box.ac-gallery-stack .product-single-image-slider .swiper-slide figure {
		max-height: 96px;
	}
}

/* 購物車/收藏縮圖 */
.cart-item-image,
.wishlist-item-image {
	background: var(--ac-img-frame-bg) !important;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.cart-item-image figure,
.wishlist-item-image figure {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	aspect-ratio: 1 / 1;
	background: var(--ac-img-frame-bg) !important;
	overflow: hidden;
}

.cart-item-image img,
.wishlist-item-image img {
	width: 100% !important;
	height: 100% !important;
	object-fit: contain !important;
	object-position: center !important;
}
