/* Bravo Garage — step 1
   Sengaja tidak bawa font/palet sendiri. Ini nempel di toko yang sudah punya
   identitas; satu-satunya warna yang dipakai #AF0505 (hijau WA) karena sudah
   jadi warna aksi di bravomotor.id. Semua tipografi diwarisi dari tema. */

.bg-bar,
.bg-modal,
.bg-toast {
	font-family: inherit;
	box-sizing: border-box;
}

.bg-bar *,
.bg-modal * {
	box-sizing: border-box;
}

/* ---------- bar ---------- */

.bg-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9000; /* cek: harus DI BAWAH bubble Chatwoot */
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 84px 10px 16px; /* kanan dilebihkan supaya tidak ketiban chat bubble */
	padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	background: #101418;
	color: #fff;
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.18);
}

.bg-bar__txt {
	flex: 1;
	font-size: 13px;
	line-height: 1.35;
}

.bg-bar__btn {
	flex: none;
	border: 0;
	border-radius: 6px;
	padding: 9px 16px;
	background: #AF0505;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
}

.bg-bar__btn:hover {
	background: #8d0404;
}

/* sudah ada mobil → menyusut jadi pil kecil, tidak lagi menghalangi */
.bg-bar--set {
	/* Kanan bawah, di bawah tombol WhatsApp.
	   right DISAMAKAN dengan .whatsapp-widget (right: 20px) — dua-duanya
	   CSS right pada elemen fixed, jadi acuannya identik. Jangan dihitung
	   via innerWidth: itu ikut menghitung scrollbar, CSS right tidak.
	   Hanya 'bottom' yang dihitung runtime oleh alignChip(). */
	left: auto !important;
	right: 20px !important;
	bottom: 12px;
	padding: 0 !important;
	background: none;
	box-shadow: none;
}

.bg-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 0;
	border-radius: 999px;
	padding: 7px 12px;
	background: #101418;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.bg-chip__car::before {
	content: '🚗 ';
}

.bg-chip__x {
	opacity: 0.55;
	font-size: 15px;
	line-height: 1;
}

.bg-chip:hover .bg-chip__x {
	opacity: 1;
}

/* ---------- modal ---------- */

.bg-modal[hidden] {
	display: none;
}

.bg-modal {
	position: fixed;
	inset: 0;
	z-index: 9500;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.bg-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 10, 14, 0.6);
}

.bg-modal__box {
	position: relative;
	width: 100%;
	max-width: 380px;
	background: #fff;
	border-radius: 12px;
	padding: 24px 20px 20px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.bg-modal__close {
	position: absolute;
	top: 8px;
	right: 10px;
	font-size: 22px;
	color: #8b949e;
	padding: 2px 6px;
}

.bg-modal__title {
	margin: 0 0 6px;
	font-size: 17px;
	line-height: 1.3;
}

.bg-modal__help {
	margin: 0 0 14px;
	font-size: 12.5px;
	line-height: 1.45;
	color: #5c6670;
}

.bg-modal__input {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid #ccd2d8;
	border-radius: 8px;
	font-size: 15px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.bg-modal__input:focus {
	outline: 2px solid #AF0505;
	outline-offset: 1px;
	border-color: #AF0505;
}

.bg-modal__msg {
	margin: 8px 0 0;
	min-height: 1em;
	font-size: 12.5px;
	line-height: 1.45;
}

.bg-modal__msg--err {
	color: #b3261e;
}

.bg-modal__submit {
	margin-top: 14px;
	width: 100%;
	border: 0;
	border-radius: 8px;
	padding: 12px;
	background: #AF0505;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.bg-modal__submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.bg-lock {
	overflow: hidden;
}

/* ---------- toast ---------- */

.bg-toast {
	position: fixed;
	left: 50%;
	bottom: 76px;
	z-index: 9600;
	transform: translate(-50%, 8px);
	opacity: 0;
	transition: opacity 0.22s ease, transform 0.22s ease;
	background: #101418;
	color: #fff;
	font-size: 13px;
	padding: 9px 16px;
	border-radius: 999px;
	pointer-events: none;
}

.bg-toast--in {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------- a11y ---------- */

.bg-bar__btn:focus-visible,
.bg-chip:focus-visible,
.bg-modal__submit:focus-visible,
.bg-modal__close:focus-visible {
	outline: 2px solid #AF0505;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.bg-toast {
		transition: none;
	}
}

@media (max-width: 480px) {
	.bg-bar__txt {
		font-size: 12px;
	}
}

/* ================= badge ================= */

/* kartu grid */
.bg-has-badge {
	position: relative;
}

.bg-fit {
	display: inline-block;
	background: #fff;
	color: #AF0505;
	border: 1px solid #AF0505;
	font-size: 9.5px;
	font-weight: 800;
	letter-spacing: 0.02em;
	padding: 3px 7px;
	border-radius: 4px;
	line-height: 1.4;
	white-space: nowrap;
}

.bg-has-badge > .bg-fit {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
}

/* dropdown FiboSearch — nempel di sebelah judul, jangan absolute */
.bg-fit--sm {
	position: static;
	margin-left: 6px;
	font-size: 8.5px;
	padding: 2px 5px;
	vertical-align: 1px;
}

/* halaman produk */
.bg-badge-slot:empty {
	display: none;
}

.bg-single {
	margin: 0 0 14px;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.45;
}

.bg-single--yes {
	background: #fdecec;
	border: 1px solid #f0b6b6;
	color: #7d0404;
}

.bg-single--no {
	background: #fff8e6;
	border: 1px solid #f0dca4;
	color: #6b5310;
}

/* tombol close di bar */
.bg-bar__x,
.bg-chip__x,
.bg-modal__close {
	flex: none;
	border: 0 !important;
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
	line-height: 1;
	cursor: pointer;
	min-height: 0;
}

.bg-bar__x {
	color: #fff !important;
	opacity: 0.5;
	font-size: 20px;
	padding: 4px 6px;
}

.bg-bar__x:hover { opacity: 1; }

/* badge di kartu grid saat nebeng .bravo-car-brand-badge (Blocksy):
   mengalir di bawah link HONDA, rata kanan mengikuti induknya */
.bravo-car-brand-badge > .bg-fit--card {
	display: block;
	width: -moz-fit-content;
	width: fit-content;
	margin: 5px 0 0 auto;
}

/* chip terbelah (badan + tombol hapus): padding pindah ke anaknya.
   Pil tunggal 'Input VIN' pakai --solo, padding tetap di tombolnya sendiri. */
.bg-chip { padding: 0; overflow: hidden; }
.bg-chip--solo { padding: 7px 14px; }
.bg-chip__main {
	border: 0 !important;
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: #fff !important;
	font: inherit;
	padding: 7px 4px 7px 12px;
	cursor: pointer;
	min-height: 0;
}
.bg-chip__x {
	color: #fff !important;
	padding: 7px 11px 7px 4px;
	opacity: 0.5;
	font-size: 15px;
}
.bg-chip__x:hover { opacity: 1; }

/* tabel detail */
.bg-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.bg-tbl th, .bg-tbl td {
	text-align: left; padding: 7px 0; vertical-align: top;
	border-bottom: 1px solid #eef0f2;
}
.bg-tbl th { font-weight: 500; color: #6b757e; width: 42%; }
.bg-tbl td { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.bg-tbl tr:last-child th, .bg-tbl tr:last-child td { border-bottom: 0; }

.bg-modal__submit--alt { background: #101418; color: #fff; }


/* ---------- riwayat VIN ---------- */
.bg-hist { margin-top: 16px; }
.bg-hist__t {
	font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
	text-transform: uppercase; color: #9aa3ab; margin-bottom: 7px;
}
.bg-hist__list { display: flex; flex-direction: column; gap: 5px; }
.bg-hist__i {
	display: flex; align-items: baseline; gap: 8px;
	width: 100%; text-align: left;
	border: 1px solid #e3e6e8 !important;
	background: #fbfcfc !important;
	border-radius: 7px; padding: 8px 10px; cursor: pointer;
	min-height: 0; box-shadow: none !important;
}
.bg-hist__i:hover { border-color: #AF0505 !important; }
.bg-hist__i b { font-size: 12.5px; color: #23282d; font-weight: 600; }
.bg-hist__i small {
	font-family: ui-monospace, Menlo, monospace;
	font-size: 10.5px; color: #9aa3ab; margin-left: auto;
}
.bg-hist__c {
	margin-top: 9px; border: 0 !important;
	background: none !important; box-shadow: none !important;
	color: #9aa3ab !important; font-size: 11.5px;
	padding: 2px 0; cursor: pointer; min-height: 0;
}
.bg-hist__c:hover { color: #AF0505 !important; }


/* ikuti media query widget WhatsApp: right 20px -> 15px di bawah 768px */
@media (max-width: 768px) {
	.bg-bar--set { right: 15px !important; }
}

/* tombol ke katalog tersaring */
.bg-modal__go {
	display: block; text-align: center; text-decoration: none;
	background: #AF0505; color: #fff !important;
	margin-top: 14px; border-radius: 8px; padding: 12px;
	font-size: 14px; font-weight: 700;
}
.bg-modal__go:hover { background: #8d0404; }
.bg-modal__submit--alt { margin-top: 8px; }

/* spanduk di /shop/?bravo_vin= */
.bg-notice {
	background: #fdecec; border: 1px solid #f0b6b6; color: #7d0404;
	border-radius: 8px; padding: 10px 14px; margin-bottom: 16px;
	font-size: 13.5px; line-height: 1.45;
}
.bg-notice a { color: #7d0404; text-decoration: underline; }

/* diagnostik admin — tidak pernah tampil ke customer */
.bg-notice--adm {
	background: #fffbe6; border-color: #f0e2a4; color: #6b5310;
	margin-top: -8px; font-size: 12.5px;
}
.bg-notice--adm code {
	background: none; padding: 0; font-size: 11.5px; color: #6b5310;
	word-break: break-all;
}

/* jumlah part di chip — ajakan "ada 344 nunggu, satu klik" */
.bg-chip__n {
	margin-left: 7px; padding-left: 8px;
	border-left: 1px solid rgba(255,255,255,0.25);
	font-size: 11.5px; color: #f0b6b6; font-weight: 600;
}

/* catatan ambiguitas VIN di panel detail */
.bg-ambi {
	margin-top: 12px; padding: 10px 12px;
	background: #fffbe6; border: 1px solid #f0e2a4; border-radius: 8px;
	font-size: 12.5px; line-height: 1.5; color: #6b5310;
}
