/**
 * sm1 首页：热销 + 分类网格卡片
 */

body.home,
body.front-page {
	background: var(--sm1-bg);
}

.sm1-home--shop {
	--home-bg: var(--sm1-bg);
	--home-surface: var(--sm1-surface);
	--home-ink: var(--sm1-ink);
	--home-muted: var(--sm1-muted);
	--home-line: var(--sm1-line);
	--home-accent: var(--sm1-accent);
	--home-price: var(--sm1-price);
	padding-bottom: 56px;
	min-height: 60vh;
	background:
		radial-gradient(ellipse 55% 35% at 100% 0%, rgba(14, 154, 167, 0.08), transparent 55%),
		var(--home-bg);
}

.sm1-section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px 16px;
	margin-bottom: 16px;
}

.sm1-section-head__title {
	margin: 0;
	font-size: 22px;
	font-weight: 750;
	letter-spacing: -0.02em;
	color: var(--home-ink);
}

.sm1-section-head__desc {
	margin: 0;
	font-size: 13px;
	color: var(--home-muted);
}

/* ===== 热销 ===== */
.sm1-hot {
	padding: 24px 0 8px;
}

.sm1-hot__track {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 12px;
}

.sm1-hot__item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 14px;
	background: var(--home-surface);
	border: 1px solid var(--home-line);
	box-shadow: 0 1px 2px rgba(21, 32, 51, 0.04);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sm1-hot__item:hover {
	transform: translateY(-2px);
	border-color: rgba(14, 154, 167, 0.3);
	box-shadow: 0 10px 24px rgba(21, 32, 51, 0.08);
}

.sm1-hot__badge {
	position: absolute;
	top: -7px;
	right: 8px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--home-ink);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
}

.sm1-hot__icon {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	overflow: hidden;
	background: linear-gradient(145deg, var(--sm1-bg-soft), var(--sm1-line));
}

.sm1-hot__icon img,
.sm1-hot__icon svg {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sm1-hot__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 15px;
	font-weight: 700;
	color: #7c93a8;
}

.sm1-hot__meta {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.sm1-hot__name {
	font-size: 13px;
	font-weight: 650;
	color: var(--home-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sm1-hot__price {
	font-size: 12px;
	font-weight: 700;
	color: var(--home-price);
}

/* ===== 分类粘性导航 ===== */
.sm1-catnav {
	position: sticky;
	top: var(--sm1-header-h, 64px);
	z-index: 40;
	background: rgba(242, 247, 251, 0.92);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--home-line);
}

.sm1-catnav__list {
	display: flex;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 10px 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.sm1-catnav__list::-webkit-scrollbar {
	display: none;
}

.sm1-catnav__list li {
	flex: 0 0 auto;
}

.sm1-catnav__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 0 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	color: var(--home-muted);
	background: transparent;
	white-space: nowrap;
}

.sm1-catnav__link:hover {
	color: var(--home-ink);
	background: var(--home-surface);
}

.sm1-catnav__link.is-active {
	color: #fff;
	background: var(--home-ink);
}

.sm1-catnav__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	background: rgba(0, 0, 0, 0.08);
	color: inherit;
}

.sm1-catnav__link.is-active .sm1-catnav__count {
	background: rgba(255, 255, 255, 0.2);
}

/* ===== 分类目录 ===== */
.sm1-catalog {
	padding: 20px 0 0;
}

.sm1-catalog__block {
	margin-bottom: 32px;
	scroll-margin-top: calc(var(--sm1-header-h, 64px) + 56px);
}

.sm1-catalog__block-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.sm1-catalog__block-title {
	margin: 0;
	font-size: 18px;
	font-weight: 750;
	color: var(--home-ink);
}

.sm1-catalog__block-more {
	font-size: 12px;
	font-weight: 600;
	color: var(--home-muted);
}

.sm1-catalog__block-more:hover {
	color: var(--home-accent);
}

/* ===== 分类紧凑商品网格（图标样式） ===== */
.sm1-goods-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 12px;
}

.sm1-goods {
	min-width: 0;
}

.sm1-goods__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 16px 10px 14px;
	border-radius: 14px;
	background: var(--home-surface);
	border: 1px solid transparent;
	text-align: center;
	box-shadow: 0 1px 2px rgba(21, 32, 51, 0.04);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sm1-goods__link:hover {
	transform: translateY(-3px);
	border-color: rgba(14, 154, 167, 0.28);
	box-shadow: 0 12px 28px rgba(21, 32, 51, 0.08);
}

.sm1-goods__thumb {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 18px;
	overflow: hidden;
	background: linear-gradient(145deg, var(--sm1-surface), var(--sm1-line));
}

.sm1-goods__thumb img,
.sm1-goods__thumb svg {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sm1-goods__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 22px;
	font-weight: 750;
	color: #7c93a8;
}

.sm1-goods__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	min-width: 0;
}

.sm1-goods__title {
	font-size: 13px;
	font-weight: 650;
	color: var(--home-ink);
	line-height: 1.35;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sm1-goods__price {
	font-size: 12px;
	font-weight: 750;
	color: var(--home-price);
}

.sm1-empty {
	text-align: center;
	padding: 72px 20px;
	border-radius: 18px;
	background: var(--home-surface);
	color: var(--home-muted);
	border: 1px dashed var(--home-line);
}

.goods-section {
	padding: 28px 0 48px;
}

.goods-section .section-title {
	margin-bottom: 20px;
	text-align: left;
	font-size: 22px;
}

@media (hover: none) {
	.sm1-hot__item:hover,
	.sm1-goods__link:hover {
		transform: none;
		box-shadow: none;
	}

	.sm1-hot__item:active,
	.sm1-goods__link:active {
		background: var(--sm1-bg-soft);
	}
}

@media (max-width: 1100px) {
	.sm1-hot__track {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.sm1-goods-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	.sm1-home--shop {
		padding-bottom: 28px;
	}

	.sm1-home--shop .container {
		padding-left: 14px;
		padding-right: 14px;
	}

	.sm1-section-head {
		margin-bottom: 12px;
		gap: 4px 10px;
	}

	.sm1-section-head__title {
		font-size: 17px;
	}

	.sm1-section-head__desc {
		font-size: 12px;
		width: 100%;
	}

	/* 分类：贴顶横滑 */
	.sm1-catnav {
		border-bottom-color: var(--sm1-line);
	}

	.sm1-catnav .container {
		padding-left: 0;
		padding-right: 0;
	}

	.sm1-catnav__list {
		gap: 8px;
		padding: 8px 14px;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		scroll-padding-inline: 14px;
	}

	.sm1-catnav__link {
		min-height: 32px;
		padding: 0 12px;
		font-size: 12px;
		background: #fff;
		border: 1px solid var(--home-line);
		scroll-snap-align: start;
	}

	.sm1-catnav__link.is-active {
		border-color: var(--home-ink);
	}

	.sm1-catnav__count {
		min-width: 16px;
		height: 16px;
		font-size: 10px;
	}

	/* 热销：卡片横滑，可 snap */
	.sm1-hot {
		padding: 14px 0 6px;
	}

	.sm1-hot__track {
		display: flex;
		gap: 10px;
		overflow-x: auto;
		margin: 0 -14px;
		padding: 8px 14px 6px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: 14px;
	}

	.sm1-hot__track::-webkit-scrollbar {
		display: none;
	}

	.sm1-hot__item {
		flex: 0 0 156px;
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 8px;
		padding: 14px 10px 12px;
		scroll-snap-align: start;
	}

	.sm1-hot__badge {
		top: 6px;
		right: 6px;
		font-size: 10px;
		padding: 1px 6px;
	}

	.sm1-hot__icon {
		flex-basis: 52px;
		width: 52px;
		height: 52px;
	}

	.sm1-hot__meta {
		width: 100%;
		align-items: center;
	}

	.sm1-hot__name {
		font-size: 12px;
		max-width: 100%;
	}

	.sm1-hot__price {
		font-size: 11px;
	}

	/* 分类目录 */
	.sm1-catalog {
		padding-top: 12px;
	}

	.sm1-catalog__block {
		margin-bottom: 22px;
		scroll-margin-top: calc(var(--sm1-header-h, 56px) + 52px);
	}

	.sm1-catalog__block-head {
		margin-bottom: 10px;
	}

	.sm1-catalog__block-title {
		font-size: 15px;
	}

	.sm1-goods-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px;
	}

	.sm1-goods__link {
		gap: 8px;
		padding: 12px 6px 10px;
		border-radius: 12px;
		border: 1px solid var(--home-line);
		box-shadow: none;
	}

	.sm1-goods__thumb {
		width: 48px;
		height: 48px;
		border-radius: 12px;
	}

	.sm1-goods__placeholder {
		font-size: 16px;
	}

	.sm1-goods__title {
		font-size: 11px;
		white-space: normal;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		line-height: 1.3;
		min-height: 2.6em;
	}

	.sm1-goods__price {
		font-size: 11px;
	}

	.goods-section {
		padding: 16px 0 28px;
	}

	.goods-section .section-title {
		font-size: 17px;
		margin-bottom: 14px;
	}
}

@media (max-width: 380px) {
	.sm1-goods-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 6px;
	}

	.sm1-goods__thumb {
		width: 44px;
		height: 44px;
	}

	.sm1-hot__item {
		flex-basis: 140px;
	}

	.sm1-catnav__count {
		display: none;
	}
}
