/* WMJ Product Cards — 前台样式（响应式） */

.wmj-cards {
	--wmj-gap: 16px;
	--wmj-min: 170px;
	clear: both;
	margin: 24px 0 8px;
}
.wmj-cards--gap-sm { --wmj-gap: 10px; }
.wmj-cards--gap-lg { --wmj-gap: 24px; }

.wmj-cards__title {
	margin: 0 0 14px !important;
	font-size: 22px;
	line-height: 1.35;
	font-weight: 600;
}

/* 网格：手机 2 列 → 平板 3 列 → 桌面按设置列数 */
.wmj-cards__grid {
	display: grid;
	gap: var(--wmj-gap);
	grid-template-columns: repeat(var(--wmj-cols-m, 2), minmax(0, 1fr));
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}
@media (min-width: 768px) {
	.wmj-cards__grid { grid-template-columns: repeat(var(--wmj-cols-t, 3), minmax(0, 1fr)); }
}
@media (min-width: 1025px) {
	.wmj-cards__grid { grid-template-columns: repeat(var(--wmj-cols-d, 4), minmax(0, 1fr)); }
}

/* 自适应模式：按最小宽度自动排，移动端固定 2 列更好点 */
.wmj-cards--auto .wmj-cards__grid {
	grid-template-columns: repeat(auto-fit, minmax(var(--wmj-min), 1fr));
}
@media (max-width: 767px) {
	.wmj-cards--auto .wmj-cards__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.wmj-cards__grid > li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	background: none !important;
}

.wmj-cards__item {
	display: block;
	position: relative;
	text-decoration: none !important;
	color: inherit;
	-webkit-tap-highlight-color: transparent;
}

.wmj-cards__media {
	display: block;
	overflow: hidden;
	border-radius: 8px;
	background: #f4f5f7;
}

.wmj-cards__img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 !important;
	border: 0;
	object-fit: cover;
	transition: transform .35s ease;
}
.wmj-cards--ratio-4x3 .wmj-cards__img { aspect-ratio: 4 / 3; }
.wmj-cards--ratio-1x1 .wmj-cards__img { aspect-ratio: 1 / 1; }
.wmj-cards--ratio-16x9 .wmj-cards__img { aspect-ratio: 16 / 9; }
.wmj-cards--ratio-auto .wmj-cards__img { aspect-ratio: auto; }

.wmj-cards__name {
	display: block;
	margin-top: 8px;
	font-size: 15px;
	line-height: 1.45;
	text-align: center;
	color: #1f2328;
}
.wmj-cards__sub {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	line-height: 1.4;
	text-align: center;
	color: #6b7280;
}

.wmj-cards--notext .wmj-cards__name,
.wmj-cards--notext .wmj-cards__sub { display: none; }

.wmj-cards--style-card .wmj-cards__item {
	background: #fff;
	border: 1px solid #eceef1;
	border-radius: 10px;
	padding: 8px 8px 12px;
	height: 100%;
	box-sizing: border-box;
}

@media (hover: hover) {
	a.wmj-cards__item:hover .wmj-cards__img { transform: scale(1.04); }
	a.wmj-cards__item:hover .wmj-cards__name { color: #ff9805; }
}
a.wmj-cards__item:focus-visible {
	outline: 2px solid #ff9805;
	outline-offset: 3px;
}

/* 覆盖主题对分类描述内 ul/li/a 的默认样式 */
#wmj_product_category_description .wmj-cards a,
#wmj_product_category_description .wmj-cards a:hover {
	color: inherit;
	text-decoration: none;
}
#wmj_product_category_description .wmj-cards__grid > li::before,
#wmj_product_category_description .wmj-cards__grid > li::marker {
	content: none;
	display: none;
}

@media (max-width: 767px) {
	.wmj-cards__name { font-size: 14px; margin-top: 6px; }
	.wmj-cards__sub { font-size: 12px; }
	.wmj-cards--gap-lg { --wmj-gap: 16px; }
	.wmj-cards--ratio-16x9 .wmj-cards__img { aspect-ratio: 16 / 9; }
}

/* ---- 1.2 标题可用 H 标签 ---- */
.wmj-cards h2.wmj-cards__name,
.wmj-cards h3.wmj-cards__name,
.wmj-cards h4.wmj-cards__name {
	margin: 8px 0 0 !important;
	padding: 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.45;
	text-align: center;
	color: #1f2328;
}

/* ---- 1.2 副标题富文本 ---- */
.wmj-cards__sub { display: block; margin-top: 4px; color: #6b7280; }
.wmj-cards__sub p { margin: 0 0 6px; font-size: 13px; line-height: 1.5; }
.wmj-cards__sub p:last-child { margin-bottom: 0; }
.wmj-cards__sub ul,
.wmj-cards__sub ol { margin: 4px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.wmj-cards__sub ul { list-style: disc; }
.wmj-cards__sub ol { list-style: decimal; }
.wmj-cards__sub li { margin: 0 0 2px; }
.wmj-cards__sub a { color: #ff9805; text-decoration: underline; }
.wmj-cards__sub strong { font-weight: 600; }

@media (max-width: 767px) {
	.wmj-cards__sub p,
	.wmj-cards__sub ul,
	.wmj-cards__sub ol { font-size: 12px; }
	.wmj-cards h2.wmj-cards__name,
	.wmj-cards h3.wmj-cards__name,
	.wmj-cards h4.wmj-cards__name { font-size: 14px; margin-top: 6px !important; }
}
