/*
 * WooCommerce 产品分类归档、商店归档、产品标签归档：列表/子类目/工具条（与首页白底卡片体系统一）。
 * 画布：与 Porto #main 一致 #f4f4f4；顶栏与内容区偏白，避免此前灰蓝渐变与首页割裂。
 * 依赖 buildbarn-ai-visibility-site-ui.css 中的 --bb-* 变量。
 *
 * 作用域：body.tax-product_cat | body.tax-product_tag | body.post-type-archive-product（商店）
 */

html body.woocommerce.tax-product_cat #main,
html body.woocommerce.tax-product_tag #main,
html body.woocommerce.post-type-archive-product #main {
	background: var(--bb-bg-page, #f4f4f4) !important;
}

html body.woocommerce.tax-product_cat .page-top,
html body.woocommerce.tax-product_tag .page-top,
html body.woocommerce.post-type-archive-product .page-top {
	background: #ffffff !important;
	border-bottom: 1px solid rgba(69, 69, 69, 0.08) !important;
	box-shadow: none !important;
	padding-top: clamp(0.85rem, 2vw, 1.15rem) !important;
	padding-bottom: clamp(0.85rem, 2vw, 1.15rem) !important;
}

html body.woocommerce.tax-product_cat .page-top .page-title,
html body.woocommerce.tax-product_tag .page-top .page-title,
html body.woocommerce.post-type-archive-product .page-top .page-title {
	font-size: clamp(1.15rem, 2.2vw, 1.45rem) !important;
	font-weight: 600 !important;
	letter-spacing: -0.03em !important;
	color: var(--bb-text-primary, #141a1f) !important;
}

html body.woocommerce.tax-product_cat .page-top .breadcrumbs-wrap,
html body.woocommerce.tax-product_tag .page-top .breadcrumbs-wrap,
html body.woocommerce.post-type-archive-product .page-top .breadcrumbs-wrap {
	font-size: 0.8125rem !important;
}

/* 主栏 / 侧栏：白底，与首页卡片在同一「浅灰画布 + 白面」层次 */
html body.woocommerce.tax-product_cat #main .main-content,
html body.woocommerce.tax-product_tag #main .main-content,
html body.woocommerce.post-type-archive-product #main .main-content {
	background: #ffffff !important;
}

html body.woocommerce.tax-product_cat #main .sidebar,
html body.woocommerce.tax-product_tag #main .sidebar,
html body.woocommerce.post-type-archive-product #main .sidebar {
	background: #ffffff !important;
}

@media (min-width: 992px) {
	html body.woocommerce.tax-product_cat #main .main-content,
	html body.woocommerce.tax-product_tag #main .main-content,
	html body.woocommerce.post-type-archive-product #main .main-content {
		border-radius: 22px !important;
		border: 1px solid rgba(69, 69, 69, 0.08) !important;
		box-shadow:
			0 2px 4px rgba(42, 42, 42, 0.04),
			0 18px 48px rgba(42, 42, 42, 0.06) !important;
	}

	html body.woocommerce.tax-product_cat #main .sidebar,
	html body.woocommerce.tax-product_tag #main .sidebar,
	html body.woocommerce.post-type-archive-product #main .sidebar {
		border-radius: 22px !important;
		border: 1px solid rgba(69, 69, 69, 0.08) !important;
		box-shadow:
			0 2px 4px rgba(42, 42, 42, 0.04),
			0 18px 48px rgba(42, 42, 42, 0.06) !important;
	}
}

/* 类目说明（若有） */
html body.woocommerce.tax-product_cat .term-description,
html body.woocommerce.tax-product_tag .term-description,
html body.woocommerce.post-type-archive-product .term-description {
	margin-bottom: 1.25rem !important;
	padding: 1rem 1.15rem !important;
	border-radius: 16px !important;
	border: 1px solid rgba(69, 69, 69, 0.08) !important;
	background: linear-gradient(180deg, #ffffff 0%, #fafaf9 100%) !important;
	box-shadow:
		0 2px 4px rgba(42, 42, 42, 0.04),
		0 12px 32px rgba(42, 42, 42, 0.06) !important;
	color: var(--bb-text-secondary, #4a4a4a) !important;
	font-size: 0.9375rem !important;
	line-height: 1.65 !important;
}

/* 排序/结果数工具条 */
html body.woocommerce.tax-product_cat .woocommerce-result-count,
html body.woocommerce.tax-product_tag .woocommerce-result-count,
html body.woocommerce.post-type-archive-product .woocommerce-result-count {
	font-size: 0.8125rem !important;
	font-weight: 500 !important;
	color: var(--bb-text-secondary, #6e6e6e) !important;
	letter-spacing: 0.02em !important;
}

html body.woocommerce.tax-product_cat form.woocommerce-ordering,
html body.woocommerce.tax-product_tag form.woocommerce-ordering,
html body.woocommerce.post-type-archive-product form.woocommerce-ordering {
	margin: 0 !important;
}

html body.woocommerce.tax-product_cat form.woocommerce-ordering select,
html body.woocommerce.tax-product_tag form.woocommerce-ordering select,
html body.woocommerce.post-type-archive-product form.woocommerce-ordering select {
	border-radius: 10px !important;
	border: 1px solid rgba(69, 69, 69, 0.12) !important;
	background: #ffffff !important;
	font-size: 0.8125rem !important;
	font-weight: 500 !important;
	padding: 0.45rem 2rem 0.45rem 0.75rem !important;
	color: var(--bb-text-primary, #2c3138) !important;
	box-shadow: 0 1px 2px rgba(42, 42, 42, 0.04) !important;
}

/*
 * 子类目磁贴（与产品同 ul.products 时）
 */
html body.woocommerce.tax-product_cat ul.products li.product-category .product-inner,
html body.woocommerce.tax-product_tag ul.products li.product-category .product-inner,
html body.woocommerce.post-type-archive-product ul.products li.product-category .product-inner {
	background: linear-gradient(180deg, #ffffff 0%, #fafaf9 100%) !important;
	border: 1px solid rgba(69, 69, 69, 0.08) !important;
	border-radius: 18px !important;
	box-shadow:
		0 2px 4px rgba(42, 42, 42, 0.04),
		0 14px 40px rgba(42, 42, 42, 0.07) !important;
	overflow: hidden !important;
	transition:
		transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.45s ease,
		border-color 0.3s ease !important;
}

html body.woocommerce.tax-product_cat ul.products li.product-category:hover .product-inner,
html body.woocommerce.tax-product_tag ul.products li.product-category:hover .product-inner,
html body.woocommerce.post-type-archive-product ul.products li.product-category:hover .product-inner {
	transform: translateY(-4px) !important;
	border-color: rgba(69, 69, 69, 0.14) !important;
	box-shadow:
		0 8px 16px rgba(42, 42, 42, 0.06),
		0 26px 52px rgba(42, 42, 42, 0.11) !important;
}

html body.woocommerce.tax-product_cat ul.products li.product-category .thumb-info,
html body.woocommerce.tax-product_tag ul.products li.product-category .thumb-info,
html body.woocommerce.post-type-archive-product ul.products li.product-category .thumb-info {
	border-radius: 18px !important;
	overflow: hidden !important;
}

html body.woocommerce.tax-product_cat ul.products li.product-category .woocommerce-loop-category__title,
html body.woocommerce.tax-product_tag ul.products li.product-category .woocommerce-loop-category__title,
html body.woocommerce.post-type-archive-product ul.products li.product-category .woocommerce-loop-category__title {
	font-size: clamp(0.95rem, 1.5vw, 1.05rem) !important;
	font-weight: 600 !important;
	letter-spacing: -0.02em !important;
	padding: 0.65rem 0.5rem 0.85rem !important;
}

html body.woocommerce.tax-product_cat ul.products li.product-category mark.count,
html body.woocommerce.tax-product_tag ul.products li.product-category mark.count,
html body.woocommerce.post-type-archive-product ul.products li.product-category mark.count {
	background: rgba(69, 69, 69, 0.06) !important;
	color: var(--bb-text-secondary, #6e6e6e) !important;
	font-size: 0.6875rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase !important;
	border-radius: 999px !important;
	padding: 0.2rem 0.55rem !important;
}

/*
 * 产品卡（覆盖 site-ui 里过大的 .post-title 字号）
 */
html body.woocommerce.tax-product_cat ul.products li.product:not(.product-category) .product-inner,
html body.woocommerce.tax-product_tag ul.products li.product:not(.product-category) .product-inner,
html body.woocommerce.post-type-archive-product ul.products li.product:not(.product-category) .product-inner {
	background: linear-gradient(180deg, #ffffff 0%, #fafaf9 100%) !important;
	border: 1px solid rgba(69, 69, 69, 0.08) !important;
	border-radius: 18px !important;
	box-shadow:
		0 2px 4px rgba(42, 42, 42, 0.04),
		0 14px 40px rgba(42, 42, 42, 0.07) !important;
	overflow: hidden !important;
	transition:
		transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.45s ease,
		border-color 0.3s ease !important;
}

html body.woocommerce.tax-product_cat ul.products li.product:not(.product-category):hover .product-inner,
html body.woocommerce.tax-product_tag ul.products li.product:not(.product-category):hover .product-inner,
html body.woocommerce.post-type-archive-product ul.products li.product:not(.product-category):hover .product-inner {
	transform: translateY(-5px) !important;
	border-color: rgba(69, 69, 69, 0.14) !important;
	box-shadow:
		0 8px 16px rgba(42, 42, 42, 0.06),
		0 26px 52px rgba(42, 42, 42, 0.11) !important;
}

html body.woocommerce.tax-product_cat ul.products li.product .woocommerce-loop-product__title,
html body.woocommerce.tax-product_tag ul.products li.product .woocommerce-loop-product__title,
html body.woocommerce.post-type-archive-product ul.products li.product .woocommerce-loop-product__title,
html body.woocommerce.tax-product_cat ul.products li.product .post-title,
html body.woocommerce.tax-product_tag ul.products li.product .post-title,
html body.woocommerce.post-type-archive-product ul.products li.product .post-title {
	font-size: clamp(0.95rem, 1.35vw, 1.05rem) !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	letter-spacing: -0.02em !important;
}

html body.woocommerce.tax-product_cat ul.products li.product .post-title a,
html body.woocommerce.tax-product_tag ul.products li.product .post-title a,
html body.woocommerce.post-type-archive-product ul.products li.product .post-title a {
	color: var(--bb-text-primary, #1a1f24) !important;
}

html body.woocommerce.tax-product_cat ul.products li.product .price,
html body.woocommerce.tax-product_tag ul.products li.product .price,
html body.woocommerce.post-type-archive-product ul.products li.product .price {
	font-weight: 600 !important;
	font-size: 0.9375rem !important;
}

html body.woocommerce.tax-product_cat ul.products li.product .product-image,
html body.woocommerce.tax-product_tag ul.products li.product .product-image,
html body.woocommerce.post-type-archive-product ul.products li.product .product-image {
	border-radius: 18px 18px 0 0 !important;
	overflow: hidden !important;
}

/* Porto 按钮 */
html body.woocommerce.tax-product_cat ul.products li.product a.button,
html body.woocommerce.tax-product_tag ul.products li.product a.button,
html body.woocommerce.post-type-archive-product ul.products li.product a.button,
html body.woocommerce.tax-product_cat ul.products li.product .add_to_cart_button,
html body.woocommerce.tax-product_tag ul.products li.product .add_to_cart_button,
html body.woocommerce.post-type-archive-product ul.products li.product .add_to_cart_button {
	border-radius: 10px !important;
	font-weight: 600 !important;
	font-size: 0.8125rem !important;
}

/* 分页 */
html body.woocommerce.tax-product_cat nav.woocommerce-pagination ul,
html body.woocommerce.tax-product_tag nav.woocommerce-pagination ul,
html body.woocommerce.post-type-archive-product nav.woocommerce-pagination ul {
	gap: 0.35rem !important;
}

html body.woocommerce.tax-product_cat nav.woocommerce-pagination ul li a,
html body.woocommerce.tax-product_cat nav.woocommerce-pagination ul li span,
html body.woocommerce.tax-product_tag nav.woocommerce-pagination ul li a,
html body.woocommerce.tax-product_tag nav.woocommerce-pagination ul li span,
html body.woocommerce.post-type-archive-product nav.woocommerce-pagination ul li a,
html body.woocommerce.post-type-archive-product nav.woocommerce-pagination ul li span {
	border-radius: 10px !important;
	border: 1px solid rgba(69, 69, 69, 0.1) !important;
	background: #ffffff !important;
	min-width: 2.5rem !important;
	text-align: center !important;
	font-weight: 600 !important;
	font-size: 0.8125rem !important;
}

html body.woocommerce.tax-product_cat nav.woocommerce-pagination ul li span.current,
html body.woocommerce.tax-product_tag nav.woocommerce-pagination ul li span.current,
html body.woocommerce.post-type-archive-product nav.woocommerce-pagination ul li span.current {
	background: var(--bb-brand-primary, #454545) !important;
	color: #ffffff !important;
	border-color: var(--bb-brand-primary, #454545) !important;
}

/* 列表栅格间距 */
html body.woocommerce.tax-product_cat ul.products.products-container,
html body.woocommerce.tax-product_tag ul.products.products-container,
html body.woocommerce.post-type-archive-product ul.products.products-container {
	gap: 1.1rem 1.25rem !important;
}

@media (max-width: 767px) {
	html body.woocommerce.tax-product_cat ul.products.products-container,
	html body.woocommerce.tax-product_tag ul.products.products-container,
	html body.woocommerce.post-type-archive-product ul.products.products-container {
		gap: 0.85rem !important;
	}
}

/* Porto Template Builder 归档列表（若主题为 archive-products + porto-tb-item） */
html body.woocommerce.tax-product_cat .archive-products .porto-tb-item.product,
html body.woocommerce.tax-product_tag .archive-products .porto-tb-item.product,
html body.woocommerce.post-type-archive-product .archive-products .porto-tb-item.product {
	border-radius: 18px !important;
	border: 1px solid rgba(69, 69, 69, 0.08) !important;
	box-shadow:
		0 2px 4px rgba(42, 42, 42, 0.04),
		0 14px 40px rgba(42, 42, 42, 0.07) !important;
}

html body.woocommerce.tax-product_cat .archive-products .porto-tb-item.product .post-title,
html body.woocommerce.tax-product_tag .archive-products .porto-tb-item.product .post-title,
html body.woocommerce.post-type-archive-product .archive-products .porto-tb-item.product .post-title {
	font-size: clamp(0.95rem, 1.35vw, 1.05rem) !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
}
