/**
 * 商品列表页样式（分类列表页含左侧类目折叠栏，样式参考 Banggood 分类页）
 * 参考: https://www.banggood.com/Wholesale-Smart-Module-ca-2286.html
 */

/* 列表页主体：左侧类目栏 + 右侧内容，顶部留白不顶面包屑 */
.list_with_sidebar {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	margin-top: 20px;
	margin-bottom: 30px;
}

/* 左侧类目折叠栏（吸顶 + 内部滚动） */
.list_sidebar {
	flex-shrink: 0;
	width: 220px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	padding: 16px 0;
	position: sticky;
	top: 20px;
	max-height: calc(100vh - 100px);
	display: flex;
	flex-direction: column;
}

/* Banggood 风格：侧栏容器 - 白底、轻阴影、略宽，上下留白不顶边 */
.list_sidebar_banggood {
	width: 248px;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 4px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	padding: 20px 0 24px 0;
}

.sidebar_title {
	flex-shrink: 0;
	font-size: 15px;
	font-weight: 600;
	color: #333;
	padding: 0 16px 12px;
	border-bottom: 1px solid #e5e5e5;
	margin-bottom: 8px;
}

/* 网站主题橙色（与 user/order/cart 等一致） */
:root {
	--sidebar-accent: #f69034;
}

/* Banggood 风格：Related Categories 标题 */
.list_sidebar_banggood .sidebar_title {
	font-size: 16px;
	font-weight: 700;
	color: #333;
	padding: 14px 16px 12px;
	border-bottom: 2px solid var(--sidebar-accent);
	margin-bottom: 0;
}

/* 侧栏内路径：父类一行一个，带 < 前缀、橙色、下划线，按层级缩进 */
.sidebar_path {
	flex-shrink: 0;
	font-size: 13px;
	padding: 10px 16px 12px;
	border-bottom: 1px solid #eee;
}
.sidebar_path_item {
	display: block;
	line-height: 1.8;
	color: #333;
	text-decoration: none;
}
/* 路径层级缩进：第1项0，第2项12px，第3项24px…；第1项为 Home 不可点、不响应悬停 */
.sidebar_path_item:nth-child(1) {
	padding-left: 0;
	cursor: default;
	pointer-events: auto;
}
.sidebar_path_item:nth-child(2) { padding-left: 12px; }
.sidebar_path_item:nth-child(3) { padding-left: 24px; }
.sidebar_path_item:nth-child(4) { padding-left: 36px; }
.sidebar_path_item:nth-child(5) { padding-left: 48px; }
.sidebar_path_item:nth-child(n+6) { padding-left: 60px; }
.sidebar_path a.sidebar_path_item:hover {
	color: var(--sidebar-accent);
}
.sidebar_path a.sidebar_path_item {
	text-decoration: none;
	cursor: pointer;
}
.sidebar_back_link {
	display: block;
	line-height: 1.8;
	color: #555;
	text-decoration: none;
	cursor: pointer;
}
.sidebar_back_link:hover {
	color: var(--sidebar-accent);
}
.sidebar_path_prefix {
	display: inline-block;
	margin-right: 4px;
	color: #666;
}
.sidebar_path_current {
	color: var(--sidebar-accent);
	font-weight: 700;
	cursor: default;
}
.sidebar_path_current .sidebar_path_prefix {
	color: var(--sidebar-accent);
}

.sidebar_empty {
	padding: 12px 16px 16px;
	color: #999;
	font-size: 13px;
}

.sidebar_category_list {
	padding: 0 8px;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

/* Banggood 风格：类目列表内边距 + 子级相对路径多一层缩进 */
.list_sidebar_banggood .sidebar_category_list {
	padding: 12px 16px 16px 28px;
}

/* 侧栏子类目列表：选中仅加粗深色，悬停显示主题色 */
.sidebar_child_link {
	display: block;
	font-size: 13px;
	color: #555;
	text-decoration: none;
	padding: 6px 0;
	line-height: 1.4;
}
.sidebar_child_link:hover {
	color: var(--sidebar-accent);
}
.sidebar_child_link.active {
	color: var(--sidebar-accent);
	font-weight: 700;
}
.category_anchor_link {
	cursor: pointer;
}
.category_anchor_link:focus {
	color: var(--sidebar-accent);
	outline: none;
}
.list_sidebar_banggood .sidebar_child_link.active::before {
	color: var(--sidebar-accent);
}
.list_sidebar_banggood .sidebar_child_link::before {
	content: "• ";
	color: #ccc;
	margin-right: 4px;
}
.list_sidebar_banggood .sidebar_child_link:hover::before {
	color: var(--sidebar-accent);
}

/* 右侧主内容区 */
.sidebar_grandchild_list {
	margin: 2px 0 6px 14px;
	padding-left: 10px;
	border-left: 2px solid #f2f2f2;
}
.sidebar_grandchild_link {
	display: block;
	font-size: 12px;
	line-height: 1.45;
	color: #666;
	text-decoration: none;
	padding: 5px 0;
}
.sidebar_grandchild_link:hover {
	color: var(--sidebar-accent);
}
.sidebar_grandchild_link::before {
	content: "- ";
	color: #bbb;
}
.sidebar_grandchild_link:hover::before {
	color: var(--sidebar-accent);
}

.list_main {
	flex: 1;
	min-width: 0;
}
.category_index_page {
	padding-bottom: 36px;
}

/* 分类列表页空状态：居中、留白，无商品时更易读 */
.product_empty_wrap {
	width: 100%;
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 60px 20px;
	text-align: center;
}
.product_empty_wrap .product_empty {
	margin: 0;
	font-size: 16px;
	color: #666;
	padding: 0;
	text-align: center;
}

/* 搜索/类目无结果页：参考 Banggood 的图标 + 明确引导布局。 */
.product-empty-state {
	width: 100%;
	min-height: 270px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 28px;
	padding: 50px 24px;
	box-sizing: border-box;
	background: #fff;
}
.product-empty-state__icon {
	width: 96px;
	flex: 0 0 96px;
	color: #aeb4bc;
}
.product-empty-state__icon svg { display: block; width: 100%; height: auto; }
.product-empty-state__icon--category {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	flex-basis: 72px;
	height: 72px;
	border-radius: 50%;
	background: #fff4e8;
	color: #f69034;
	font-size: 34px;
}
.product-empty-state__content { max-width: 530px; }
.product-empty-state__content h2 {
	margin: 0 0 10px;
	color: #282832;
	font-size: 22px;
	line-height: 1.35;
	font-weight: 700;
}
.product-empty-state__content h2 strong { color: #f05b36; overflow-wrap: anywhere; }
.product-empty-state__content p,
.product-empty-state__content ul { margin: 0; color: #69707a; font-size: 14px; line-height: 1.7; }
.product-empty-state__content ul { padding-left: 20px; margin-top: 2px; }
.product-empty-state__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.product-empty-state__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 94px;
	height: 38px;
	padding: 0 18px;
	border: 1px solid #dfe3e8;
	border-radius: 4px;
	background: #fff;
	color: #39414a;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: .2s ease;
}
.product-empty-state__button:hover { border-color: #f69034; color: #f69034; }
.product-empty-state__button--primary { background: #f69034; border-color: #f69034; color: #fff; }
.product-empty-state__button--primary:hover { background: #e78228; color: #fff; }
.empty-state-recommendations {
	margin-bottom: 40px;
}
@media (max-width: 768px) {
	.product-empty-state { min-height: 0; flex-direction: column; gap: 12px; padding: 42px 20px; text-align: center; }
	.product-empty-state__content ul { display: inline-block; text-align: left; }
	.product-empty-state__actions { justify-content: center; }
	.product-empty-state__content h2 { font-size: 19px; }
	.empty-state-recommendations { margin-bottom: 28px; }
}

/* 类目首页（一级类目展示）主区域 */
.category_index_header {
	padding: 22px 0 18px;
	margin-bottom: 0;
	border-bottom: 0;
}
.category_index_header .list_title {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
}
.category_index_header .list_title h1 {
	font-size: 28px;
	font-weight: 700;
	letter-spacing: 0;
	color: #282832;
}
.category_index_main {
	position: relative;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}
.category_directory {
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.category_directory_group {
	background: #fff;
	border: 1px solid #ececf0;
	border-radius: 6px;
	box-shadow: 0 6px 18px rgba(40, 40, 50, 0.04);
	overflow: hidden;
	scroll-margin-top: 70px;
}
.category_group_head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 20px 14px;
	border-bottom: 1px solid #f0f0f2;
}
.category_group_title {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	padding-left: 14px;
	font-size: 18px;
	font-weight: 700;
	color: #282832;
	text-decoration: none;
	line-height: 1.25;
}
.category_group_title::before {
	content: "";
	position: absolute;
	left: 0;
	top: 3px;
	bottom: 3px;
	width: 4px;
	border-radius: 2px;
	background: var(--sidebar-accent);
}
.category_group_title:hover {
	color: var(--sidebar-accent);
}
.category_leaf_grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	column-gap: 22px;
	row-gap: 0;
	padding: 14px 20px 18px;
}
.category_leaf_link {
	display: block;
	min-width: 0;
	padding: 7px 0;
	color: #555;
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none;
	overflow-wrap: anywhere;
	border-bottom: 1px solid transparent;
	transition: color 0.2s, padding-left 0.2s;
}
.category_leaf_link:hover {
	color: var(--sidebar-accent);
	padding-left: 4px;
}

/* 面包屑导航 - 参考购物车页面样式 */
.breadcrumb {
	font-size: 14px;
	color: #666;
	margin: 20px 0;
}

.breadcrumb ul {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	padding: 0;
	margin: 0;
}

/* 面包屑项 */
.breadcrumb-item {
	position: relative;
}

.breadcrumb-item a {
	color: #666;
	text-decoration: none;
	transition: color 0.2s;
}

.breadcrumb-item a:hover {
	color: #0066cc;
}

/* 分隔符 */
.breadcrumb-item:not(:last-child)::after {
	content: "/";
	margin: 0 8px;
	color: #999;
}

/* 当前页样式 */
.breadcrumb-item:last-child {
	color: #333;
	font-weight: bold;
}

.breadcrumb-item:last-child a {
	color: #333;
	cursor: default;
}

.breadcrumb-item:last-child a:hover {
	color: #333;
}

/* 列表头部（标题和排序） */
.list_header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	padding: 20px 0;
	border-bottom: 1px solid #e5e5e5;
	margin-bottom: 20px;
}

.list_title {
	flex: 1 1 auto;
	min-width: 0;
}

.list_title h1 {
	margin: 0;
	font-size: 24px;
	font-weight: 500;
	color: #333;
	display: inline-block;
}

.product_count {
	margin-left: 10px;
	font-size: 16px;
	color: #999;
	font-weight: normal;
}

/* 排序选项 */
.list_sort {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 15px;
	margin-left: auto;
}

.sort_label {
	font-size: 14px;
	color: #666;
}

.sort_options {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
}

.sort_option {
	padding: 8px 16px;
	font-size: 14px;
	color: #666;
	cursor: pointer;
	user-select: none;
	text-decoration: none;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	transition: all 0.3s;
	background-color: #fff;
}

.sort_option:hover {
	border-color: #1180e9;
	color: #1180e9;
	background-color: #f5f9ff;
}

.sort_option.active {
	border-color: #1180e9;
	color: #1180e9;
	background-color: #f5f9ff;
	font-weight: 500;
}

/* Search results pagination */
.search-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 34px 0 20px;
}

.search-pagination-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 66px;
	height: 44px;
	border: 1px solid #dfe4ea;
	border-radius: 4px;
	background: #fff;
	color: #303840;
	font-size: 14px;
	line-height: 1;
	text-decoration: none;
	transition: border-color .2s, background-color .2s, color .2s;
}

.search-pagination-link:hover {
	border-color: #f69034;
	background: #fff7ef;
	color: #f69034;
}

.search-pagination-link.current {
	border-color: #f69034;
	background: #f69034;
	color: #fff;
	pointer-events: none;
}

.search-pagination-arrow span {
	font-family: Arial, sans-serif;
	font-size: 22px;
	font-weight: 400;
	line-height: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
	.list_with_sidebar {
		flex-direction: column;
	}
	
	.list_sidebar,
	.list_sidebar_banggood {
		width: 100%;
		order: 1;
		position: static;
		max-height: none;
	}
	
	.sidebar_category_list {
		max-height: 280px;
		overflow-y: auto;
	}
	
	.sidebar_path {
		word-break: break-word;
	}
	
	.list_main {
		order: 0;
	}
	
	.list_header {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}
	
	.sort_options {
		flex-wrap: wrap;
	}
	
	.sort_option {
		padding: 6px 12px;
		font-size: 13px;
	}

	.search-pagination {
		gap: 6px;
		margin-top: 26px;
	}

	.search-pagination-link {
		width: 42px;
		height: 38px;
	}

	.category_index_header {
		padding-top: 10px;
	}

	.category_index_header .list_title h1 {
		font-size: 24px;
	}

	.category_index_main {
		padding: 0;
	}

	.category_directory {
		gap: 12px;
	}

	.category_group_head {
		padding: 14px 16px 12px;
	}

	.category_group_title {
		font-size: 16px;
	}

	.category_leaf_grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
		column-gap: 16px;
		padding: 12px 16px 14px;
	}

	.category_leaf_link {
		font-size: 13px;
		padding: 6px 0;
	}
}
