/* Layout: /inventory/ SRP — facets sidebar + results grid.
 * The inventory CARD itself (.bms-card and its children) now lives in the
 * child theme's global style.css, since the homepage Featured Vehicles
 * carousel reuses the same bms_render_inventory_card() markup and needs
 * those styles outside the SRP too. */

.bms-srp-wrap {
	max-width: 1400px;
	margin: 0 auto;
	padding: 24px 16px;
}

.bms-srp {
	display: flex;
	gap: 32px;
	align-items: flex-start;
}

.bms-srp-facets {
	flex: 0 0 260px;
	position: sticky;
	top: 24px;
}

.bms-facets-heading {
	margin-top: 0;
	font-size: 18px;
}

.bms-facet {
	margin-bottom: 20px;
}

.bms-facet label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.bms-srp-results {
	flex: 1 1 auto;
	min-width: 0;
}

.bms-srp-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	font-size: 14px;
}

.bms-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
}

.bms-no-results {
	padding: 40px 0;
	text-align: center;
	color: #777777;
}

/* ---- Mobile filter drawer chrome ----
 * Hidden by default (desktop) — the 782px media query below is what turns
 * each of these on AND is what turns .bms-srp-facets itself into a drawer.
 * Desktop's .bms-srp-facets rule higher up this file (flex:0 0 260px;
 * position:sticky) is completely untouched — nothing here overrides it
 * above 782px.
 *
 * .bms-srp-filter-toggle / .bms-srp-facets-close / .bms-srp-facets-apply
 * all also carry .bms-btn (+ .bms-btn-primary/.bms-btn-secondary), which
 * sets `display: inline-block` in style.css at the same specificity
 * (one class). A bare `.bms-srp-filter-toggle { display: none; }` here was
 * losing that tie, so every "hide on desktop" rule below is scoped through
 * an ancestor (.bms-srp / .bms-srp-facets) to push it to two classes —
 * reliably higher specificity than .bms-btn* regardless of stylesheet
 * load order. */
.bms-srp .bms-srp-filter-toggle {
	display: none;
	width: 100%;
	margin-bottom: 16px;
}

.bms-srp-facets .bms-srp-facets-close {
	display: none;
}

.bms-srp-facets .bms-srp-facets-apply {
	display: none;
	width: 100%;
	margin-top: 20px;
}

.bms-srp-backdrop {
	display: none;
}

@media (max-width: 782px) {
	.bms-srp .bms-srp-filter-toggle {
		display: block;
	}

	/* Takes .bms-srp-facets out of normal flow entirely, which is what makes
	 * .bms-srp-results render first on mobile with zero DOM/markup changes —
	 * it's simply the only remaining flex child left in the normal flow. */
	.bms-srp-facets {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 85%;
		max-width: 320px;
		background: #ffffff;
		z-index: 1001;
		padding: 24px 20px;
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform 0.25s ease;
		box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
	}

	.bms-srp-facets.is-open {
		transform: translateX(0);
	}

	.bms-facets-heading {
		padding-right: 40px; /* room for the close (X) button */
	}

	.bms-srp-facets .bms-srp-facets-close {
		display: block;
		position: absolute;
		top: 16px;
		right: 16px;
		width: 32px;
		height: 32px;
		border: none;
		background: transparent;
		font-size: 24px;
		line-height: 1;
		cursor: pointer;
		color: #333333;
	}

	.bms-srp-facets .bms-srp-facets-apply {
		display: block;
	}

	.bms-srp-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.5);
		z-index: 1000;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.25s ease, visibility 0.25s ease;
	}

	.bms-srp-backdrop.is-open {
		opacity: 1;
		visibility: visible;
	}
}

/* Body scroll lock while the drawer is open. Only ever toggled by JS in
 * response to the mobile-only Filter button, so this has no effect on
 * desktop even though the rule itself isn't inside the media query. */
body.bms-drawer-open {
	overflow: hidden;
}
/* Logo fallback for units with no photo — contain (don't crop) and center
   on white, so the Broward Motorsports logo reads cleanly in the card. */
.bms-card-image img.bms-card-img-fallback {
	object-fit: contain;
	padding: 18%;
	background: #ffffff;
}