/* 代烧四档对比表 — 产品页 description 与分类页底部描述共用 */

/* ============================================================
   代烧四档对比表  [ab_tiers]
   单产品描述区里 4 列卡片，顶部黑金价签 + 下方勾选清单。
   选择器全部挂 .ab-tiers 前缀，覆盖主题对 description li 的默认排版。
   ============================================================ */

:is(.single-product .woocommerce-Tabs-panel--description, .rjb-category-bottom, .ab-tiers-archive) .ab-tiers {
	margin: 46px 0 10px;
}

.ab-tiers__head {
	max-width: 640px;
	margin: 0 0 26px;
}

:is(.single-product .woocommerce-Tabs-panel--description, .rjb-category-bottom, .ab-tiers-archive) .ab-tiers__title {
	border: 0 none;
	border-top: 0 none;
	padding: 0;
	background: none;
	font-size: 24px;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: #14120E;
	margin: 0 0 10px;
	line-height: 1.3;
}

.ab-tiers__lede {
	font-size: 14px;
	line-height: 1.7;
	color: #6B6459;
	margin: 0;
}

.ab-tiers__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	align-items: stretch;
}

.ab-tier {
	display: flex;
	flex-direction: column;
	background: #FBFAF7;
	border: 1px solid #DED7C6;
	position: relative;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ab-tier:hover {
	border-color: #C9A227;
}

.ab-tier--current {
	border-color: #C9A227;
	box-shadow: inset 0 0 0 1px #C9A227;
}

.ab-tier__badge {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 3;
	background: #A93226;
	color: #F5EFE3;
	font-size: 9px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	padding: 4px 9px 4px 10px;
}

.ab-tier__head {
	background: #14120E;
	color: #F5EFE3;
	padding: 24px 14px 20px;
	text-align: center;
}

.ab-tier__label {
	font-size: 9px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: #8E846F;
	margin-bottom: 10px;
}

.ab-tier__name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: #F5EFE3;
	letter-spacing: 0.01em;
}

.ab-tier__sub {
	font-size: 11.5px;
	line-height: 1.55;
	color: #A9A08C;
	margin-top: 9px;
	min-height: 36px;
}

.ab-tier__price {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 36px;
	line-height: 1;
	color: #FFFFFF;
	margin-top: 16px;
	letter-spacing: -0.01em;
}

.ab-tier--current .ab-tier__price {
	color: #E3C766;
}

.ab-tier__unit {
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #8E846F;
	margin-top: 9px;
}

:is(.single-product .woocommerce-Tabs-panel--description, .rjb-category-bottom, .ab-tiers-archive) .ab-tier__list {
	list-style: none;
	margin: 0;
	padding: 6px 13px 4px;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	/* 四列等高，条目少的那列把多余空间均分到行间，而不是在底部堆一块空白 */
	justify-content: space-between;
}

:is(.single-product .woocommerce-Tabs-panel--description, .rjb-category-bottom, .ab-tiers-archive) .ab-tier__list li {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	font-size: 12px;
	line-height: 1.5;
	color: #35302A;
	padding: 8px 0;
	margin: 0;
	border-bottom: 1px dashed #E9E4D8;
}

:is(.single-product .woocommerce-Tabs-panel--description, .rjb-category-bottom, .ab-tiers-archive) .ab-tier__list li + li {
	margin-top: 0;
}

:is(.single-product .woocommerce-Tabs-panel--description, .rjb-category-bottom, .ab-tiers-archive) .ab-tier__list li:last-child {
	border-bottom: 0;
}

.ab-ck {
	flex: 0 0 13px;
	color: #B9962E;
	font-size: 10px;
	line-height: 1.65;
	font-weight: 700;
}

:is(.single-product .woocommerce-Tabs-panel--description, .rjb-category-bottom, .ab-tiers-archive) .ab-tier__list li.ab-no {
	color: #A09889;
}

.ab-tier__list li.ab-no .ab-ck {
	color: #C6BEAE;
}

:is(.single-product .woocommerce-Tabs-panel--description, .rjb-category-bottom, .ab-tiers-archive) .ab-tier__list li.ab-grp {
	display: block;
	font-size: 9px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #9A8244;
	background: #F2EEE2;
	margin: 10px -13px 2px;
	padding: 5px 13px;
	border-bottom: 0;
	font-weight: 600;
}

:is(.single-product .woocommerce-Tabs-panel--description, .rjb-category-bottom, .ab-tiers-archive) .ab-tier__list li.ab-grp:first-child {
	margin-top: 2px;
}

.ab-tier__cta {
	display: block;
	text-align: center;
	margin: 10px 13px 15px;
	padding: 11px 8px;
	font-size: 10px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	border: 1px solid #14120E;
	color: #14120E;
	text-decoration: none;
	background: transparent;
	transition: background 0.18s ease, color 0.18s ease;
}

.ab-tier__cta:hover {
	background: #14120E;
	color: #F5EFE3;
	text-decoration: none;
}

.ab-tier__cta--here,
.ab-tier__cta--here:hover {
	background: #14120E;
	color: #E3C766;
	border-color: #14120E;
	cursor: default;
}

.ab-tiers__foot {
	font-size: 11.5px;
	color: #8A8275;
	margin: 16px 0 0;
	line-height: 1.6;
}

/* 平板：2 列 */
@media (max-width: 900px) {
	.ab-tiers__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
	.ab-tier__sub { min-height: 0; }
	.ab-tier__price { font-size: 30px; }
}

/* 手机：横向滑动，卡片固定宽 244px，scroll-snap 对齐 */
@media (max-width: 560px) {
	:is(.single-product .woocommerce-Tabs-panel--description, .rjb-category-bottom, .ab-tiers-archive) .ab-tiers {
		margin-left: -16px;
		margin-right: -16px;
	}
	.ab-tiers__head {
		padding: 0 16px;
	}
	.ab-tiers__grid {
		display: flex;
		align-items: flex-start;
		gap: 10px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		padding: 0 16px 8px;
		scrollbar-width: none;
	}
	.ab-tiers__grid::-webkit-scrollbar { display: none; }
	.ab-tier {
		flex: 0 0 246px;
		scroll-snap-align: start;
	}
	.ab-tier__price { font-size: 32px; }
	.ab-tiers__foot { padding: 0 16px; }
}

/* ============================================================
   分类页底部描述里的用法
   分类页正文栏宽 780px，4 列卡片放不下。
   这里只把 .ab-tiers 自身撑宽并水平居中，父容器和下面的正文段落宽度不动。
   用 50% + translateX(-50%) 而不是负 margin，父容器宽度变化时不用跟着改数值。
   ============================================================ */

.rjb-category-bottom .ab-tiers {
	width: min(1160px, calc(100vw - 32px));
	max-width: none;
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	margin: 0 0 46px;
}

/* 表在最前面，紧接产品网格的分隔线，不需要再叠一次上边距 */
.rjb-category-bottom .ab-tiers__head {
	margin-bottom: 24px;
}

/* 分类页没有"当前页"概念，四列等权，按钮统一描边 */
.rjb-category-bottom .ab-tier {
	background: #FFFFFF;
}

@media (max-width: 900px) {
	.rjb-category-bottom .ab-tiers {
		width: 100%;
		left: auto;
		transform: none;
		margin-bottom: 32px;
	}
}

/* ============================================================
   分类页顶部（产品网格之上）
   这个位置由 inc/tier-archive.php 输出，宽度跟随主内容区，
   不再需要底部那种撑宽居中。
   ============================================================ */

.ab-tiers-archive {
	max-width: 1200px;
	margin: 0 auto 44px;
	padding: 26px 15px 2px;
	border-bottom: 1px solid #E6E1D6;
	box-sizing: border-box;
}

.ab-tiers-archive .ab-tiers {
	width: 100%;
	max-width: none;
	left: auto;
	transform: none;
	position: static;
	margin: 0 0 24px;
}

.ab-tiers-archive .ab-tiers__head {
	max-width: 640px;
	margin-bottom: 22px;
}

@media (max-width: 900px) {
	.ab-tiers-archive {
		margin-bottom: 30px;
		padding-top: 18px;
	}
}

@media (max-width: 560px) {
	/* 手机端沿用横向滑动，容器两侧留白由 .ab-tiers 自己的负 margin 处理 */
	.ab-tiers-archive {
		padding-top: 14px;
	}
	.ab-tiers-archive .ab-tiers {
		margin-left: 0;
		margin-right: 0;
	}
}

/* ============================================================
   紧凑模式 [ab_tiers compact="1"]
   分类页顶部用：每列只留 5 条核心差异，整块压到一屏内。
   完整清单仍在各档产品页。
   ============================================================ */

.ab-tiers--compact .ab-tiers__title {
	font-size: 22px;
}

.ab-tiers--compact .ab-tiers__lede {
	font-size: 13.5px;
	max-width: 560px;
}

.ab-tiers--compact .ab-tier__head {
	padding: 20px 13px 17px;
}

.ab-tiers--compact .ab-tier__label {
	margin-bottom: 8px;
}

.ab-tiers--compact .ab-tier__sub {
	font-size: 11px;
	line-height: 1.5;
	min-height: 34px;
}

.ab-tiers--compact .ab-tier__price {
	font-size: 32px;
	margin-top: 12px;
}

.ab-tiers--compact .ab-tier__unit {
	margin-top: 7px;
}

/* 条目行距收紧：用同样的 :is() 前缀保证压过完整模式里的 li 规则 */
:is(.ab-tiers-archive) .ab-tiers--compact .ab-tier__list li {
	padding: 7px 0;
}

.ab-tiers--compact .ab-tiers__foot {
	margin-top: 14px;
	font-size: 11px;
}

.ab-tiers--compact .ab-tier__cta {
	margin: 8px 13px 13px;
	padding: 10px 8px;
}
