/* ==========================================================================
 * HBC Product Grid — WooCommerce 产品网格
 *
 * 卡片结构:
 *   .heading-wrap / .heading      (可选分类标题)
 *   <ul.hbc-product-grid>
 *     <li.item>
 *       <div.card>                (带阴影/圆角的卡片包裹层)
 *         <div.image-wrap>
 *           <span.badge>          (可选,SALE 角标)
 *           <a.image-link><img></a>
 *           <a.quick-view>        (悬停在图片上时显现)
 *         </div>
 *         <div.info>
 *           <h3.title><a /></h3>
 *           <div.categories>
 *             <span.category-tag>
 *               <span.category-dot></span>
 *               <a>分类名</a>
 *             </span>
 *           </div>
 *           <div.price />
 *         </div>
 *       </div>
 *     </li>
 *   </ul>
 *
 * 通过 CSS 变量 --hbc-pg-cols 控制列数,Elementor 响应式控件直接注入。
 * ========================================================================== */

.hbc-product-grid {
	--hbc-pg-cols: 4;

	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(var(--hbc-pg-cols), minmax(0, 1fr));
	column-gap: 24px;
	row-gap: 36px;
}

.hbc-product-grid * {
	box-sizing: border-box;
}

/* ==========================================================================
 *  分类标题
 * ========================================================================== */
.hbc-product-grid__heading-wrap {
	text-align: center;
	margin-bottom: 32px;
}

.hbc-product-grid__heading {
	margin: 0;
	padding: 0;
	color: #1D0F36;
	font-size: 40px;
	font-weight: 700;
	line-height: 1.2;
}

/* ==========================================================================
 *  单卡片
 * ========================================================================== */
.hbc-product-grid__item {
	margin: 0;
	padding: 0;
	min-width: 0;
	display: block;
}

/* ==========================================================================
 *  卡片包裹层（阴影/圆角/背景）
 * ========================================================================== */
.hbc-product-grid__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background-color: #FFFFFF;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.hbc-product-grid__card:hover {
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
 *  卡片文字信息区
 * ========================================================================== */
.hbc-product-grid__info {
	padding: 12px 14px 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

/* ==========================================================================
 *  分类标签行
 * ========================================================================== */
.hbc-product-grid__categories {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
}

.hbc-product-grid__category-tag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.3;
	color: #555555;
}

.hbc-product-grid__category-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background-color: #EE6B2D;
	flex-shrink: 0;
}

.hbc-product-grid__category-tag a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.hbc-product-grid__category-tag a:hover {
	color: #EE6B2D;
}

/* ==========================================================================
 *  图片容器
 * ========================================================================== */
.hbc-product-grid__image-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	background-color: #F2F2F2;
	padding: 18px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hbc-product-grid__image-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	text-decoration: none;
	overflow: hidden;
}

.hbc-product-grid__image {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	transition: transform 0.4s ease;
}

/* 图片悬停放大(由 prefix_class hbc-product-grid--zoom-yes 启用) */
.hbc-product-grid--zoom-yes .hbc-product-grid__item:hover .hbc-product-grid__image {
	transform: scale(1.06);
}

/* ==========================================================================
 *  SALE 角标
 * ========================================================================== */
.hbc-product-grid__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	color: #FFFFFF;
	background-color: #E91A8C;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	border-radius: 2px;
	pointer-events: none;
}

/* ==========================================================================
 *  Quick View 按钮 — 默认隐藏,卡片 hover 时浮现
 * ========================================================================== */
.hbc-product-grid__quick-view {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(8px);
	z-index: 4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 32px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.02em;
	color: #FFFFFF;
	background-color: #1D2D5C;
	text-decoration: none;
	white-space: nowrap;
	border: 0;
	border-radius: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease, color 0.2s ease;
}

.hbc-product-grid__item:hover .hbc-product-grid__quick-view,
.hbc-product-grid__item:focus-within .hbc-product-grid__quick-view {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

.hbc-product-grid__quick-view:hover,
.hbc-product-grid__quick-view:focus {
	background-color: #142046;
	color: #FFFFFF;
}

.hbc-product-grid__quick-view:focus-visible {
	outline: 2px solid #FFFFFF;
	outline-offset: 2px;
}

/* ==========================================================================
 *  标题
 * ========================================================================== */
.hbc-product-grid__title {
	margin: 0;
	padding: 0;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	color: #1F1F1F;
}

.hbc-product-grid__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.hbc-product-grid__title a:hover,
.hbc-product-grid__title a:focus {
	color: #EE6B2D;
}

/* ==========================================================================
 *  价格
 * ========================================================================== */
.hbc-product-grid__price {
	margin: 2px 0 0;
	padding: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	color: #1F1F1F;
}

/* WooCommerce 输出的 .amount / del / ins */
.hbc-product-grid__price .amount {
	color: inherit;
	font-weight: inherit;
}

.hbc-product-grid__price del {
	opacity: 0.55;
	margin-right: 6px;
	font-weight: 400;
}

.hbc-product-grid__price ins {
	background: transparent;
	text-decoration: none;
}

/* ==========================================================================
 *  分页
 * ========================================================================== */
.hbc-product-grid__pagination {
	margin-top: 36px;
	display: flex;
	justify-content: center;
}

.hbc-product-grid__pagination ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.hbc-product-grid__pagination li {
	margin: 0;
	padding: 0;
}

.hbc-product-grid__pagination a,
.hbc-product-grid__pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: #1F1F1F;
	background-color: transparent;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 0;
	text-decoration: none;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.hbc-product-grid__pagination a:hover,
.hbc-product-grid__pagination a:focus {
	color: #FFFFFF;
	background-color: #1D2D5C;
	border-color: #1D2D5C;
}

.hbc-product-grid__pagination .current {
	color: #FFFFFF;
	background-color: #1D2D5C;
	border-color: #1D2D5C;
}

/* ==========================================================================
 *  减少动效偏好
 * ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.hbc-product-grid__image,
	.hbc-product-grid__quick-view,
	.hbc-product-grid__title a {
		transition: none;
	}
}
