/* ==========================================================================
   Bakba Recently Viewed — 商品页底部条带
   排版对齐「You May Also Like」相关商品区：
   4 列网格 / 间距 18px / 图片正方形（左右 19.5px 内缩）/ 标题 15px 500 / 价格 18px 700
   折叠：桌面最多 2 行（8 张），移动端最多 3 行（6 张），View More 展开
   ========================================================================== */

.bakba-rv {
	margin: 48px 0 6px;
	padding-top: 34px;
	border-top: 1px solid #ece7df;
}

.bakba-rv.is-empty {
	display: none;
}

/* ---------- 区块头（与相关商品标题同款：Jost 20px 大写） ---------- */
.bakba-rv__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 14px;
}

.bakba-rv__title {
	margin: 0;
	font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #111;
}

.bakba-rv__clear {
	padding: 0;
	border: 0;
	background: none;
	font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
	font-size: 10px;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: #8a8378;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: #d9d2c7;
	transition: color 0.16s ease, text-decoration-color 0.16s ease;
}

.bakba-rv__clear:hover {
	color: #a9501a;
	text-decoration-color: currentColor;
}

/* 清空确认 */
.bakba-rv [hidden] {
	display: none !important;
}

.bakba-rv__confirm {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
	font-size: 10px;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: #8a8378;
}

.bakba-rv__confirm button {
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.bakba-rv__yes {
	color: #a9501a;
	font-weight: 600;
}

.bakba-rv__yes:disabled {
	opacity: 0.5;
	cursor: default;
}

.bakba-rv__no {
	color: #8a8378;
}

/* ---------- 网格：桌面 4 列（对齐相关商品） ---------- */
.bakba-rv__rail {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 28px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bakba-rv__item {
	min-width: 0;
}

.bakba-rv__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.bakba-rv__link:hover {
	text-decoration: none;
}

/* 图片：正方形，左右内缩对齐相关商品（img margin 0 19.5px 10px） */
.bakba-rv__media {
	display: block;
	margin: 0 19.5px 10px;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f7f2ea;
}

.bakba-rv__media img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.bakba-rv__link:hover .bakba-rv__media img {
	transform: scale(1.035);
}

/* 标题：15px / 500，同相关商品 */
.bakba-rv__name {
	display: -webkit-box;
	margin: 0 19.5px;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.25;
	color: #111;
}

.bakba-rv__link:hover .bakba-rv__name {
	color: #a9501a;
}

/* 价格：18px / 700，同相关商品；"From" 小字 */
.bakba-rv__price {
	display: block;
	margin: 5px 19.5px 0;
	font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: #111;
}

.bakba-rv__price .acmp-from-label {
	font-size: 13px;
	font-weight: 400;
	margin-right: 4px;
	color: #111;
}

.bakba-rv__price ins {
	text-decoration: none;
	color: #a9501a;
}

.bakba-rv__price del {
	color: #a49b8f;
	font-weight: 400;
	font-size: 14px;
}

/* ---------- View More / Show Less ---------- */
.bakba-rv__more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 34px;
}

.bakba-rv__more {
	padding: 12px 38px;
	border: 1px solid #1b1a18;
	background: none;
	font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #1b1a18;
	cursor: pointer;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.bakba-rv__more:hover {
	background: #1b1a18;
	color: #fbf9f6;
}

/* 折叠态：桌面隐藏第 9 张起（4 列 × 2 行 = 8） */
.bakba-rv.is-collapsed .bakba-rv__item:nth-child(n + 9) {
	display: none;
}

/* toast */
.bakba-rv-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	z-index: 99999;
	max-width: min(88vw, 420px);
	padding: 13px 22px;
	border-radius: 3px;
	background: #1b1a18;
	color: #fbf9f6;
	font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
	font-size: 12.5px;
	line-height: 1.45;
	text-align: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
	opacity: 0;
	transform: translate(-50%, 12px);
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.bakba-rv-toast.is-show {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------- 平板：3 列 × 2 行（6 张） ---------- */
@media (max-width: 1023px) {
	.bakba-rv__rail {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px 14px;
	}

	.bakba-rv.is-collapsed .bakba-rv__item:nth-child(n + 7) {
		display: none;
	}
}

/* ---------- 手机：2 列 × 3 行（6 张） ---------- */
@media (max-width: 760px) {
	.bakba-rv {
		margin-top: 38px;
		padding-top: 26px;
	}

	.bakba-rv__head {
		margin-bottom: 12px;
	}

	.bakba-rv__title {
		font-size: 17px;
	}

	.bakba-rv__rail {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px 12px;
	}

	.bakba-rv__media {
		margin: 0 10px 8px;
	}

	.bakba-rv__name {
		margin: 0 10px;
		font-size: 13px;
	}

	.bakba-rv__price {
		margin: 4px 10px 0;
		font-size: 15px;
	}

	.bakba-rv__price .acmp-from-label {
		font-size: 11px;
	}

	.bakba-rv__price del {
		font-size: 12px;
	}

	.bakba-rv__more-wrap {
		margin-top: 26px;
	}

	.bakba-rv__more {
		padding: 10px 30px;
		font-size: 10px;
	}
}
