/**
 * 饰面图库小部件 - 样式
 *
 * 布局：左（Tab 导航）+ 右（说明文字 + 图片网格）
 * 交互：悬停放大 / 点击灯箱
 */

/* 主容器 -------------------------------------------------------------- */
.hbc-fg {
	display: flex;
	gap: 40px;
	align-items: flex-start;
	width: 100%;
}

/* ── 左：标签导航 ── */
.hbc-fg__nav {
	flex-grow: 0;
	flex-shrink: 0;
	width: 200px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.hbc-fg__tab-btn {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	width: 100%;
	margin: 0;
	padding: 14px 20px;
	text-align: left;
	border: 0;
	cursor: pointer;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	height: auto;
	min-height: 0;
	box-sizing: border-box;
	transition: background-color 0.2s ease, color 0.2s ease;
	background-color: #f5f5f5;
	color: #555555;
}

.hbc-fg__tab-btn.is-active {
	background-color: #222222;
	color: #ffffff;
}

.hbc-fg__tab-btn:not(.is-active):hover {
	background-color: #e8e8e8;
}

/* ── 右：内容区 ── */
.hbc-fg__body {
	flex: 1 1 0%;
	min-width: 0;
}

/* 面板显隐 */
.hbc-fg__panel {
	display: none;
}

.hbc-fg__panel.is-active {
	display: block;
}

/* 说明文字 */
.hbc-fg__desc {
	margin-bottom: 24px;
	color: #333333;
	font-size: 14px;
	line-height: 1.7;
}

.hbc-fg__desc p {
	margin: 0 0 0.75em;
}

.hbc-fg__desc p:last-child {
	margin-bottom: 0;
}

/* ── 图片网格 ── */
.hbc-fg__grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 20px;
}

/* 图片项 */
.hbc-fg__item {
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* 图片容器 */
.hbc-fg__thumb {
	width: 100%;
	height: 120px;
	overflow: hidden;
	border-radius: 50%;
	cursor: pointer;
	position: relative;
}

.hbc-fg__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.hbc-fg__thumb:hover img {
	transform: scale(1.1);
}

/* 图片标签 */
.hbc-fg__label {
	margin: 8px 0 0;
	padding: 0;
	text-align: center;
	font-size: 11px;
	line-height: 1.4;
	color: #333333;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	word-break: break-word;
}

/* ── 灯箱 ── */
.hbc-fg-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hbc-fg-lb.is-open {
	opacity: 1;
	visibility: visible;
}

.hbc-fg-lb__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
}

.hbc-fg-lb__box {
	position: relative;
	z-index: 1;
	background: #ffffff;
	border-radius: 6px;
	padding: 20px;
	max-width: min(90vw, 560px);
	max-height: 90vh;
	overflow: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	transform: scale(0.9);
	transition: transform 0.3s ease;
}

.hbc-fg-lb.is-open .hbc-fg-lb__box {
	transform: scale(1);
}

.hbc-fg-lb__img {
	display: block;
	max-width: 100%;
	max-height: calc(90vh - 80px);
	object-fit: contain;
	border-radius: 4px;
}

.hbc-fg-lb__close {
	position: absolute;
	top: 6px;
	right: 10px;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #444444;
	padding: 0;
	transition: color 0.2s ease;
}

.hbc-fg-lb__close:hover {
	color: #cc0000;
}

/* ── 响应式：平板 (≤1024px) ── */
@media (max-width: 1024px) {
	.hbc-fg {
		gap: 28px;
	}

	.hbc-fg__nav {
		flex: 0 0 160px;
		width: 160px;
	}

	.hbc-fg__grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* ── 响应式：手机 (≤768px) ── */
@media (max-width: 768px) {
	.hbc-fg {
		flex-direction: column;
		gap: 16px;
	}

	.hbc-fg__nav {
		width: 100% !important;
		height: auto !important;
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		grid-auto-rows: min-content;
		align-items: start;
		gap: 8px;
	}

	.hbc-fg__tab-btn {
		width: 100%;
		height: auto;
		min-height: 0;
		align-self: start;
		text-align: center;
		padding: 10px 14px;
		font-size: 13px;
		line-height: 1.4;
	}

	.hbc-fg__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
	}
}
