/* BT Quote Mode. Màu lấy từ biến --bt-qm-* (theme ghi đè được), có giá trị mặc định. */
:where(:root) { /* độ ưu tiên 0: theme khai báo --bt-qm-* trong :root là thắng, bất kể thứ tự tải CSS */
	--bt-qm-primary: #002c5f;
	--bt-qm-primary-hover: #004780;
	--bt-qm-cta: #007a99;          /* nút chuyển đổi: đạt tương phản 4.95:1 với chữ trắng */
	--bt-qm-cta-hover: #006580;
	--bt-qm-focus: #00aad2;
	--bt-qm-border: #d1d5db;
	--bt-qm-line: #e5e8ec;
	--bt-qm-text: #1c1b1b;
	--bt-qm-label: #4b5563;
	--bt-qm-muted: #6b7280;
	--bt-qm-soft: #edf3f8;
	--bt-qm-ok: #0b6b3a;
	--bt-qm-error: #b42318;
	--bt-qm-radius: 8px;
}

/* Bảng giá phiên bản (trang xe) */
.bt-qm-price-table { margin: 16px 0; }
.bt-qm-price-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.bt-qm-price-table caption { text-align: left; font-weight: 700; padding-bottom: 8px; color: var(--bt-qm-primary); }
.bt-qm-price-table th,
.bt-qm-price-table td { padding: 12px 14px; border-bottom: 1px solid var(--bt-qm-line); text-align: left; }
.bt-qm-price-table thead th { background: var(--bt-qm-primary); color: #fff; font-weight: 600; }
.bt-qm-price-table td:last-child { font-weight: 700; color: var(--bt-qm-primary); white-space: nowrap; }
.bt-qm-price-note { margin: 8px 0 0; font-size: 13px; color: var(--bt-qm-muted); }
.bt-qm-price-contact { font-weight: 700; color: var(--bt-qm-primary); }

/* Nút ở trang xe */
.bt-qm-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.bt-qm-cta .bt-qm-btn--primary { grid-column: 1 / -1; }
.bt-qm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px;
	border: 1px solid rgba(0, 44, 95, .25); border-radius: var(--bt-qm-radius); background: #fff;
	color: var(--bt-qm-primary); font-size: 15px; font-weight: 600; line-height: 1.2; text-align: center;
	text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, transform .1s;
}
.bt-qm-btn:hover { background: var(--bt-qm-soft); }
.bt-qm-btn--primary { background: var(--bt-qm-cta); border-color: var(--bt-qm-cta); color: #fff; }
.bt-qm-btn--primary:hover { background: var(--bt-qm-cta-hover); color: #fff; }
.bt-qm-btn--call { background: var(--bt-qm-primary); border-color: var(--bt-qm-primary); color: #fff; }
.bt-qm-btn--call:hover { background: var(--bt-qm-primary-hover); color: #fff; }

/* Form ------------------------------------------------------------------ */
.bt-qm-form { display: grid; gap: 16px; color: var(--bt-qm-text); }
.bt-qm-form--default { grid-template-columns: 1fr; }
@media (min-width: 640px) {
	.bt-qm-form--default { grid-template-columns: 1fr 1fr; }
	.bt-qm-form--default .bt-qm-switch,
	.bt-qm-form--default .bt-qm-submit,
	.bt-qm-form--default .bt-qm-msg,
	.bt-qm-form--default .bt-qm-privacy { grid-column: 1 / -1; }
}
.bt-qm-form--compact { grid-template-columns: 1fr; gap: 12px; align-items: end; }
@media (min-width: 640px) { .bt-qm-form--compact { grid-template-columns: 1fr 1fr; } .bt-qm-form--compact .bt-qm-submit, .bt-qm-form--compact .bt-qm-msg { grid-column: 1 / -1; } }
@media (min-width: 1024px) { .bt-qm-form--compact { grid-template-columns: repeat(4, 1fr) auto; } .bt-qm-form--compact .bt-qm-submit { grid-column: auto; } }

.bt-qm-field { display: grid; gap: 8px; margin: 0; min-width: 0; }
.bt-qm-field[hidden] { display: none; }
.bt-qm-field label { margin: 0; font-size: 14px; font-weight: 500; color: var(--bt-qm-label); }
.bt-qm-form input,
.bt-qm-form select,
.bt-qm-form textarea {
	width: 100%; min-width: 0; height: 48px; margin: 0; padding: 0 14px; border: 1px solid var(--bt-qm-border);
	border-radius: var(--bt-qm-radius); background: #fff; color: var(--bt-qm-text); font: inherit; font-size: 16px;
	box-shadow: none; outline: none; transition: border-color .15s, box-shadow .15s;
}
.bt-qm-form select { padding-right: 36px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.bt-qm-form input::placeholder { color: var(--bt-qm-muted); }
.bt-qm-form input:focus,
.bt-qm-form select:focus { border-color: var(--bt-qm-focus); box-shadow: 0 0 0 4px rgba(0, 170, 210, .15); }
.bt-qm-form .is-invalid { border-color: var(--bt-qm-error); }
.bt-qm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.bt-qm-submit {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin: 0; padding: 12px 22px;
	border: 0; border-radius: var(--bt-qm-radius); background: var(--bt-qm-cta); color: #fff;
	font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
	box-shadow: 0 6px 16px -6px var(--bt-qm-cta-shadow, rgba(0, 122, 153, .6)); transition: background-color .15s, transform .1s;
}
.bt-qm-submit:hover { background: var(--bt-qm-cta-hover); }
.bt-qm-submit:active { transform: scale(.98); }
.bt-qm-submit.is-loading { opacity: .6; pointer-events: none; }

.bt-qm-msg { margin: 0; font-size: 15px; font-weight: 600; }
.bt-qm-msg:empty { display: none; }
.bt-qm-msg.is-error { color: var(--bt-qm-error); }
.bt-qm-msg.is-ok { padding: 24px; border-radius: 12px; background: #edf7f9; color: var(--bt-qm-primary); font-weight: 500; line-height: 1.6; }
.bt-qm-msg.is-ok svg { display: block; margin-bottom: 12px; color: var(--bt-qm-cta); }
.bt-qm-msg.is-ok p { margin: 0; font-size: 16px; font-weight: 600; }
.bt-qm-again { margin-top: 12px; padding: 8px 0; border: 0; background: none; color: var(--bt-qm-primary); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.bt-qm-form.is-done > :not(.bt-qm-msg) { display: none; }
.bt-qm-form.is-done { grid-template-columns: 1fr; }

.bt-qm-privacy { margin: 0; font-size: 13px; line-height: 1.6; color: var(--bt-qm-muted); }
.bt-qm-privacy a { color: var(--bt-qm-primary); font-weight: 600; }

/* Popup: desktop ở giữa, mobile trượt từ đáy -------------------------------- */
.bt-qm-modal {
	position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; max-height: 92dvh; margin: 0; padding: 20px 20px 32px;
	border: 0; border-radius: 24px 24px 0 0; background: #fff; color: var(--bt-qm-text);
	box-shadow: 0 -20px 60px rgba(0, 20, 50, .35); overflow-y: auto;
}
.bt-qm-modal[open] { animation: bt-qm-sheet .28s ease-out both; }
.bt-qm-modal::backdrop { background: rgba(0, 44, 95, .7); backdrop-filter: blur(4px); }
@media (min-width: 640px) {
	.bt-qm-modal { inset: 0; width: calc(100% - 32px); max-width: 576px; margin: auto; padding: 36px; border-radius: 16px; }
}
@keyframes bt-qm-sheet { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bt-qm-modal[open] { animation: none; } }
.bt-qm-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.bt-qm-modal__eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--bt-qm-cta); }
.bt-qm-modal-title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.3; color: var(--bt-qm-primary); }
@media (min-width: 640px) { .bt-qm-modal-title { font-size: 24px; } }
.bt-qm-close {
	display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0;
	border: 0; border-radius: 50%; background: #f6f3f2; color: var(--bt-qm-text); cursor: pointer; transition: background-color .15s;
}
.bt-qm-close:hover { background: #e5e7eb; }
html.bt-qm-lock { overflow: hidden; }

/* Thanh liên hệ cố định (mobile) – theme có thể tắt bằng sticky_bar => false */
.bt-qm-bar { display: none; }
@media (max-width: 767px) {
	body { padding-bottom: 76px; }
	.bt-qm-bar {
		position: fixed; inset: auto 0 0 0; z-index: 40; display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 8px;
		padding: 12px 12px max(12px, env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); box-shadow: 0 -8px 24px -12px rgba(0, 44, 95, .2);
	}
	.bt-qm-bar a { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: var(--bt-qm-radius); font-size: 15px; font-weight: 600; text-decoration: none; }
	.bt-qm-bar__call { border: 1px solid rgba(0, 44, 95, .2); color: var(--bt-qm-primary); }
	.bt-qm-bar__zalo { border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8; font-weight: 700; }
	.bt-qm-bar__quote { background: var(--bt-qm-cta); color: #fff; }
}

/* Popup: chọn Nhận báo giá / Đặt lịch lái thử */
.bt-qm-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: calc(var(--bt-qm-radius) + 4px); background: var(--bt-qm-soft); }
.bt-qm-switch[hidden] { display: none; }
.bt-qm-switch button {
	min-height: 44px; padding: 8px 10px; border: 0; border-radius: var(--bt-qm-radius); background: transparent;
	color: var(--bt-qm-label); font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; cursor: pointer; transition: background-color .15s, color .15s;
}
.bt-qm-switch button:hover { color: var(--bt-qm-primary); }
.bt-qm-switch button[aria-checked="true"] { background: #fff; color: var(--bt-qm-primary); box-shadow: 0 1px 3px rgba(0, 44, 95, .15); }
.bt-qm-switch button:focus-visible { outline: 2px solid var(--bt-qm-focus); outline-offset: 2px; }

/* Câu đồng ý dưới nút gửi ở form gọn (1 hàng) */
.bt-qm-form--compact .bt-qm-privacy--compact { grid-column: 1 / -1; margin: 0; }
