/**
 * BOYUE Variation Table — 前台样式
 * 作用域限定在 .bvt-wrap 内，避免与主题的 table / button 样式冲突。
 * 全部颜色给出兜底值，主题未定义 CSS 变量时也能正常显示。
 */

.bvt-wrap {
	--bvt-ink: #1f2328;
	--bvt-ink-2: #5b6470;
	--bvt-ink-3: #8b939c;
	--bvt-line: #e3e6ea;
	--bvt-line-soft: #f0f2f4;
	--bvt-bg-soft: #fbfcfc;
	--bvt-accent: #1f2328;
	--bvt-ok: #1a7f4b;
	--bvt-warn: #b26a00;
	--bvt-radius: 10px;

	margin: 0 0 22px;
	border: 1px solid var(--bvt-line);
	border-radius: var(--bvt-radius);
	background: #fff;
	overflow: hidden;
}

/* ---------- 头部 ---------- */
.bvt-wrap .bvt-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 14px 18px;
	border-bottom: 1px solid var(--bvt-line-soft);
	background: var(--bvt-bg-soft);
}

.bvt-wrap .bvt-head-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--bvt-ink);
	letter-spacing: .01em;
}

.bvt-wrap .bvt-head-hint {
	font-size: 11.5px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--bvt-ink-3);
	font-weight: 600;
}

/* ---------- 表格 ---------- */
.bvt-wrap .bvt-table-scroll {
	max-height: 620px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.bvt-wrap table.bvt-table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	table-layout: auto;
}

.bvt-wrap table.bvt-table thead th {
	position: sticky;
	top: 0;
	z-index: 2;
	padding: 9px 16px;
	background: #fff;
	border-bottom: 1px solid var(--bvt-line);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--bvt-ink-3);
	text-align: left;
	white-space: nowrap;
}

.bvt-wrap table.bvt-table tbody td {
	padding: 11px 16px;
	border-bottom: 1px solid var(--bvt-line-soft);
	vertical-align: middle;
	background: #fff;
}

.bvt-wrap table.bvt-table tbody tr:last-child td {
	border-bottom: 0;
}

.bvt-wrap table.bvt-table tbody tr.bvt-row:hover td {
	background: #fafbfb;
}

/* 列宽
 * 不能用固定像素宽：本主题在中等视口会把内容区压到 ~356px，
 * 固定宽度会把型号列挤到几十像素（文字一字一行）。改为按内容自适应，
 * 让型号列自动占满剩余空间。 */
.bvt-wrap .bvt-col-price {
	width: 1%;
	min-width: 68px;
	text-align: right;
	white-space: nowrap;
}

.bvt-wrap .bvt-col-qty {
	width: 1%;
	text-align: center;
	white-space: nowrap;
}

/* ---------- 型号单元 ---------- */
.bvt-wrap .bvt-model {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
}

.bvt-wrap .bvt-thumb {
	width: 44px;
	height: 44px;
	border-radius: 7px;
	object-fit: cover;
	border: 1px solid var(--bvt-line);
	background: #f2f3f4;
	flex: 0 0 auto;
}

.bvt-wrap .bvt-model-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.bvt-wrap .bvt-model-name {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--bvt-ink);
	line-height: 1.45;
	word-break: break-word;
}

.bvt-wrap .bvt-model-sku {
	font-size: 11.5px;
	color: var(--bvt-ink-3);
	letter-spacing: .02em;
}

/* ---------- 价格 ---------- */
.bvt-wrap .bvt-price {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--bvt-ink);
	font-variant-numeric: tabular-nums;
}

.bvt-wrap .bvt-price del {
	color: var(--bvt-ink-3);
	font-weight: 400;
	font-size: 12px;
	margin-right: 3px;
	text-decoration: line-through;
}

.bvt-wrap .bvt-price ins {
	text-decoration: none;
	color: var(--bvt-ok);
}

.bvt-wrap .bvt-price-na {
	font-size: 12.5px;
	font-weight: 500;
	color: var(--bvt-warn);
}

/* ---------- 数量步进器 ---------- */
.bvt-wrap .bvt-stepper {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid #cfd4da;
	border-radius: 7px;
	overflow: hidden;
	background: #fff;
	height: 34px;
}

.bvt-wrap .bvt-stepper button {
	width: 30px;
	min-width: 30px;
	border: 0;
	background: #f7f8f9;
	color: var(--bvt-ink-2);
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	transition: background .12s ease;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
}

.bvt-wrap .bvt-stepper button:hover {
	background: #eef0f2;
	color: var(--bvt-ink);
}

.bvt-wrap .bvt-stepper button:active {
	background: #e4e7ea;
}

.bvt-wrap .bvt-stepper button:disabled {
	opacity: .35;
	cursor: not-allowed;
}

.bvt-wrap .bvt-stepper input.bvt-qty {
	width: 46px;
	min-width: 46px;
	height: 100%;
	border: 0;
	border-left: 1px solid #e7eaed;
	border-right: 1px solid #e7eaed;
	text-align: center;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--bvt-ink);
	background: #fff;
	padding: 0;
	-moz-appearance: textfield;
	appearance: textfield;
	box-shadow: none;
	border-radius: 0;
}

.bvt-wrap .bvt-stepper input.bvt-qty::-webkit-outer-spin-button,
.bvt-wrap .bvt-stepper input.bvt-qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.bvt-wrap .bvt-stepper input.bvt-qty:focus {
	outline: 2px solid #cfe0f5;
	outline-offset: -2px;
}

/* ---------- 不可售状态 ---------- */
.bvt-wrap .bvt-status {
	display: inline-block;
	font-size: 12px;
	font-weight: 500;
	color: var(--bvt-ink-3);
	padding: 4px 10px;
	border-radius: 999px;
	background: #f4f5f6;
	white-space: nowrap;
}

.bvt-wrap .bvt-status-oos {
	color: #8c2f24;
	background: #fdf1f0;
}

.bvt-wrap tr.bvt-row-noprice td,
.bvt-wrap tr.bvt-row-oos td {
	background: #fcfcfd;
}

.bvt-wrap tr.bvt-row-noprice .bvt-model-name,
.bvt-wrap tr.bvt-row-oos .bvt-model-name {
	color: #6d7681;
	font-weight: 500;
}

/* ---------- 底部 ---------- */
.bvt-wrap .bvt-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 18px;
	border-top: 1px solid var(--bvt-line);
	background: var(--bvt-bg-soft);
	flex-wrap: wrap;
}

.bvt-wrap .bvt-summary {
	font-size: 13px;
	color: var(--bvt-ink-2);
}

.bvt-wrap .bvt-summary-value {
	font-size: 17px;
	font-weight: 700;
	color: var(--bvt-ink);
	margin: 0 3px 0 6px;
	font-variant-numeric: tabular-nums;
}

.bvt-wrap .bvt-summary-unit {
	color: var(--bvt-ink-3);
}

.bvt-wrap button.bvt-submit {
	background: var(--bvt-accent);
	border: 1px solid var(--bvt-accent);
	color: #fff;
	border-radius: 8px;
	padding: 11px 30px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: opacity .12s ease, background .12s ease;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
	text-transform: none;
}

.bvt-wrap button.bvt-submit:hover:not(:disabled) {
	background: #000;
	border-color: #000;
	color: #fff;
}

.bvt-wrap button.bvt-submit:disabled {
	opacity: .4;
	cursor: not-allowed;
}

.bvt-wrap button.bvt-submit.bvt-loading {
	opacity: .65;
	cursor: progress;
}

/* ---------- 提示信息 ---------- */
.bvt-wrap .bvt-msg {
	display: none;
	padding: 12px 18px;
	font-size: 13px;
	line-height: 1.6;
	border-top: 1px solid var(--bvt-line-soft);
}

.bvt-wrap .bvt-msg.is-show {
	display: block;
}

.bvt-wrap .bvt-msg.is-ok {
	background: #f0f8f3;
	color: #14603a;
}

.bvt-wrap .bvt-msg.is-warn {
	background: #fff8ec;
	color: #7d5000;
}

.bvt-wrap .bvt-msg.is-err {
	background: #fdf1f0;
	color: #8c2f24;
}

.bvt-wrap .bvt-msg a {
	color: inherit;
	text-decoration: underline;
	font-weight: 600;
}

.bvt-wrap .bvt-notice {
	padding: 12px 18px;
	font-size: 13px;
	border-bottom: 1px solid var(--bvt-line-soft);
}

.bvt-wrap .bvt-notice-warn {
	background: #fff8ec;
	color: #7d5000;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
	.bvt-wrap .bvt-head,
	.bvt-wrap .bvt-footer {
		padding-left: 13px;
		padding-right: 13px;
	}

	.bvt-wrap table.bvt-table thead th,
	.bvt-wrap table.bvt-table tbody td {
		padding-left: 11px;
		padding-right: 11px;
	}

	.bvt-wrap .bvt-col-price {
		min-width: 58px;
	}

	.bvt-wrap .bvt-thumb {
		width: 38px;
		height: 38px;
	}

	.bvt-wrap .bvt-model-name {
		font-size: 12.5px;
	}

	.bvt-wrap .bvt-stepper {
		height: 31px;
	}

	.bvt-wrap .bvt-stepper button {
		width: 26px;
		min-width: 26px;
	}

	.bvt-wrap .bvt-stepper input.bvt-qty {
		width: 40px;
		min-width: 40px;
	}

	.bvt-wrap button.bvt-submit {
		width: 100%;
	}
}

/* 内容区极窄时（主题在某些视口把摘要列压到 ~350px）：隐藏缩略图，保住型号文字的可读宽度 */
@media (max-width: 782px) {
	.bvt-wrap .bvt-thumb {
		display: none;
	}
}
