/**
 * Car Category & Brand Search - filter UI
 * Category pills + dark filters bar.
 */

.cbs-filters-form {
	margin-bottom: 20px;
	width: 100%;
}

/* Light gray background on the Elementor column/section wrapping the
   filters (overrides the theme's gold `lte-background-main` + pattern). */
.lte-background-main:has(.cbs-filters-form),
.elementor-element:has(> .elementor-widget-wrap .cbs-filters-form) {
	background-color: #f5f5f5 !important;
	background-image: none !important;
}

/* Category pills */
.cbs-cat-pills {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	padding: 0;
	width: 100%;
}

.cbs-pill {
	align-items: center;
	background: #ffffff;
	border: 1px solid #d9d9d9;
	border-radius: 20px;
	color: #444;
	cursor: pointer;
	display: inline-flex;
	font-size: 13px !important;
	font-weight: 500;
	justify-content: center;
	letter-spacing: 0.3px;
	line-height: 1;
	margin: 0;
	min-width: 0 !important;
	padding: 9px 20px !important;
	text-transform: capitalize;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
	white-space: nowrap;
	width: auto !important;
}

.cbs-filters-form .cbs-cat-pills {
	align-items: center;
	display: flex;
}

/* Theme JS wraps every button in <span class="lte-btn-wrap">, and the theme
   gives each wrapper after the first a 20px top margin. Reset it. */
.cbs-filters-form .cbs-cat-pills .lte-btn-wrap,
.cbs-filters-form .cbs-cat-pills .lte-btn-wrap + .lte-btn-wrap {
	display: flex !important;
	margin: 0 !important;
	padding: 0 !important;
}

.cbs-filters-form .cbs-cat-pills .cbs-pill {
	inset: auto !important;
	margin-block: 0 !important;
	margin-inline: 0 !important;
	translate: none !important;
	background-color: #ffffff;
	border: 1px solid #d9d9d9 !important;
	border-radius: 20px !important;
	box-shadow: none !important;
	color: #444 !important;
	float: none !important;
	font-family: inherit !important;
	font-size: 13px !important;
	height: auto !important;
	left: auto !important;
	margin: 0 !important;
	position: static !important;
	top: auto !important;
	transform: none !important;
	vertical-align: middle;
}

.cbs-filters-form .cbs-cat-pills .cbs-pill.active {
	background-color: #e8a020 !important;
	border-color: #e8a020 !important;
	color: #141414 !important;
}

.cbs-filters-form .cbs-cat-pills .cbs-pill:before,
.cbs-filters-form .cbs-cat-pills .cbs-pill:after {
	display: none !important;
}

.cbs-pill:hover {
	border-color: #e8a020;
	color: #c78a12;
}

.cbs-pill.active,
.cbs-pill.active:hover {
	background: #e8a020;
	border-color: #e8a020;
	color: #141414;
	font-weight: 600;
}

/* Filters bar */
.cbs-filters-bar {
	align-items: center;
	background: #141414;
	border: 1px solid #262626;
	border-radius: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 10px 14px;
}

.cbs-filters-label {
	align-items: center;
	color: #ffffff;
	display: flex;
	font-size: 13px;
	font-weight: 600;
	gap: 6px;
	white-space: nowrap;
}

/* The theme's JS (scripts.js initStyles) wraps every `form select` in a
   `<div class="select-wrap">` that is `width:100%; display:block`, which
   would force our selects onto their own rows. Neutralise the wrapper and
   let it behave as a plain flex item. */
.cbs-filters-bar .select-wrap {
	background: none !important;
	border: 0 !important;
	border-radius: 0;
	display: block;
	flex: 1 1 130px;
	min-width: 0;
	padding: 0;
	width: auto;
}

.cbs-filters-bar .select-wrap:after {
	display: none !important;
}

/* `!important` is required: the theme sets `width:100%`, `font-size:16px`
   and `padding:24px 25px` on `form input:not(...)`, `form select` and
   `.select-wrap select` with higher specificity than these rules. */
.cbs-filters-bar input[type="search"],
.cbs-filters-bar select,
.cbs-filters-bar .select-wrap select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background: #1e1e1e !important;
	border: 1px solid #2e2e2e !important;
	border-radius: 5px !important;
	box-sizing: border-box;
	color: #e8e8e8 !important;
	display: block;
	flex: 1 1 130px;
	font-size: 13px !important;
	height: auto;
	line-height: 1.4;
	margin: 0;
	min-width: 0;
	padding: 8px 10px !important;
	width: 100%;
}

/* Selects sit inside .select-wrap, so the flex sizing belongs to the
   wrapper instead. */
.cbs-filters-bar .select-wrap select {
	flex: none;
}

.cbs-filters-bar select,
.cbs-filters-bar .select-wrap select {
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
	background-position: right 8px center !important;
	background-repeat: no-repeat !important;
	background-size: 12px !important;
	padding-right: 28px !important;
}

.cbs-filters-bar input[type="search"]:focus,
.cbs-filters-bar select:focus,
.cbs-filters-bar .select-wrap select:focus {
	border-color: #e8a020 !important;
	outline: none;
}

.cbs-filters-bar input[type="search"]::placeholder {
	color: #777;
}

/* Results count (rendered by archive template) */
.cbs-results-count {
	color: #9a9a9a;
	font-size: 13px;
	margin: 4px 0 12px;
}

@media (max-width: 768px) {
	.cbs-cat-pills {
		justify-content: flex-start;
	}

	.cbs-filters-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.cbs-filters-label {
		justify-content: center;
	}
}
