/**
 * 首页样式（home.css）
 * ---------------------------------------------------------------
 * 对应 woodmart-child/inc/home.php 的三个短代码：
 *   [bt_hero_wall]       -> .bt-wall / .bt-wall__cell / .bt-wall__name
 *   [bt_category_tiles]  -> .bt-tiles / .bt-tile / .bt-tile__media ...
 *
 * 2026-11-03 补建：enqueue.php 一直以 <link> 引用本文件，但文件从未存在，
 * 首页返回 404（日志可查）。此文件按 home.php 实际输出的类名逐一对应编写，
 * 不引入任何模板里不存在的类。
 *
 * 设计边界：只用 CSS 变量与自身类名，不改 WoodMart 全局样式，不给 .bt- 以外
 * 的选择器加样式，避免影响父主题与其它页面。
 */

/* ---------- 首页 hero 深色块底色 ----------
 * 页面正文用的是 Gutenberg 调色板 slug：has-dark-blue-background-color + has-white-color。
 * 但主题里没有给 dark-blue 定义色值，实测 computed background 是 rgba(0,0,0,0)
 * —— 白字落在白底上，整段 18px 介绍文案在页面上完全看不见（首屏"什么都没有"
 * 的真正原因，不是没内容，是内容隐形了）。此处只补色值，不改正文。
 * 本文件只在首页加载，不影响其它页面的同名 class。
 */
.has-dark-blue-background-color {
	background-color: #10243d !important;
}

/* 深色块内的标题必须转白：实测 H1 是 rgb(36,36,36) 深灰，落在 #10243d 上
   对比度只有 1.3:1，等于看不见（WCAG AA 要求 4.5:1）。段落本身是白色，
   只有标题被主题的 heading 规则压回深色，这里统一纠正。 */
.has-dark-blue-background-color h1,
.has-dark-blue-background-color h2,
.has-dark-blue-background-color h3,
.has-dark-blue-background-color h4,
.has-dark-blue-background-color strong {
	color: #fff !important;
}

/* ---------- 首屏图墙：4 格排一行（count 可调，最多 8） ---------- */
/* 4 格排一行：首屏要「一眼看到 4 款货」，铺成 2×2 会把 hero 和分类全顶下去 */
.bt-wall {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 10px;
	margin: 0 0 28px;
}

.bt-wall__cell {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 10px;
	background: #fff;
	border: 1px solid #e7e9ee;
	aspect-ratio: 1 / 1;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
	transition: box-shadow .2s ease, transform .2s ease;
}

.bt-wall__cell:hover,
.bt-wall__cell:focus-visible {
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
	transform: translateY(-2px);
}

/* 产品图用 contain 完整显示：cover 会把角磨机、振动器的机身裁掉一半，
   工业品买家看图就是要看整机形态与接口，裁切等于让图失去意义 */
.bt-wall__cell img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 14px 14px 34px;
	box-sizing: border-box;
	transition: transform .35s ease;
}

.bt-wall__cell:hover img {
	transform: scale(1.04);
}

/* 商品名压在图底部：B2B 买家需要知道这张图是哪款货 */
.bt-wall__name {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 22px 12px 10px;
	font-size: 12.5px;
	line-height: 1.35;
	color: #fff;
	background: linear-gradient(to top, rgba(15, 23, 42, .88), rgba(15, 23, 42, .55) 55%, rgba(15, 23, 42, 0));
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- 品类瓷砖 ---------- */
.bt-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 14px;
	margin: 0 0 32px;
}

.bt-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #e7e9ee;
	border-radius: 10px;
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.bt-tile:hover,
.bt-tile:focus-visible {
	border-color: #c9ced8;
	box-shadow: 0 8px 20px rgba(15, 23, 42, .09);
	transform: translateY(-2px);
}

.bt-tile__media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background: #f5f6f8;
	overflow: hidden;
}

.bt-tile__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 10px;
	box-sizing: border-box;
	transition: transform .35s ease;
}

.bt-tile:hover .bt-tile__media img {
	transform: scale(1.05);
}

.bt-tile__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 11px 12px 13px;
}

.bt-tile__name {
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.35;
	color: #111827;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bt-tile__count {
	font-size: 11.5px;
	color: #6b7280;
}

/* 品类无合规图时的中性占位块（不塞第三方品牌图） */
.bt-tile__ph {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 14px;
	text-align: center;
	background:
		linear-gradient(135deg, #f7f8fa 0%, #eef0f4 100%);
}

.bt-tile__ph-name {
	font-size: 12.5px;
	font-weight: 600;
	color: #374151;
	line-height: 1.3;
}

.bt-tile__ph-note {
	font-size: 10.5px;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #9aa1ac;
}

/* ---------- 响应式 ---------- */
@media (max-width: 767px) {
	.bt-wall {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.bt-wall__cell img {
		padding: 8px 8px 26px;
	}

	.bt-wall__name {
		font-size: 11.5px;
		padding: 16px 8px 7px;
	}

	.bt-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.bt-tile__body {
		padding: 9px 9px 11px;
	}

	.bt-tile__name {
		font-size: 12.5px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bt-wall__cell,
	.bt-wall__cell img,
	.bt-tile,
	.bt-tile__media img {
		transition: none;
	}
}
