/* Vehicle archive filter toolbar (template-parts/archive/vehicle-archive.php). */

.os-filter {
	--of-accent: #ef4444;
	--of-ink: #0f172a;
	--of-muted: #64748b;
	--of-line: #e2e8f0;
	--of-soft: #f1f5f9;
	--of-bg: #fff;
	margin: 0 0 1.5rem;
	padding: 10px;
	border: 1px solid var(--of-line);
	border-radius: 16px;
	background: var(--of-bg);
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
[data-theme="dark"] .os-filter {
	--of-ink: #f8fafc;
	--of-muted: #94a3b8;
	--of-line: #334155;
	--of-soft: #0f172a;
	--of-bg: #1e293b;
}

.os-filter__form { display: flex; align-items: center; gap: 8px; margin: 0; }

/* Search */
.os-filter__search { position: relative; flex: 1; min-width: 0; }
.os-filter__search-icon { position: absolute; top: 50%; left: 13px; color: #94a3b8; transform: translateY(-50%); pointer-events: none; transition: color .2s ease; }
.os-filter__search:focus-within .os-filter__search-icon { color: var(--of-accent); }
.os-filter__input {
	width: 100%;
	min-height: 42px;
	padding: 0 12px 0 40px;
	border: 1px solid var(--of-line);
	border-radius: 10px;
	background: var(--of-soft);
	color: var(--of-ink);
	font: inherit;
	font-size: .92rem;
	font-weight: 500;
	transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.os-filter__input::placeholder { color: #94a3b8; }
.os-filter__input:focus { outline: 0; border-color: var(--of-accent); background: var(--of-bg); box-shadow: 0 0 0 3px rgba(239, 68, 68, .15); }

/* Selects */
.os-filter__select {
	flex: none;
	min-height: 42px;
	max-width: 200px;
	padding: 0 34px 0 12px;
	border: 1px solid var(--of-line);
	border-radius: 10px;
	background: var(--of-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
	color: var(--of-ink);
	font: inherit;
	font-size: .9rem;
	font-weight: 600;
	text-overflow: ellipsis;
	cursor: pointer;
	appearance: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.os-filter__select--brand { min-width: 160px; }
.os-filter__select:hover { border-color: #cbd5e1; }
.os-filter__select:focus-visible { outline: 0; border-color: var(--of-accent); box-shadow: 0 0 0 3px rgba(239, 68, 68, .15); }

.os-filter__apply { flex: none; min-height: 42px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--of-accent); color: #fff; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; transition: background-color .2s ease; }
.os-filter__apply:hover { background: #dc2626; }
.os-filter__apply:focus-visible { outline: 2px solid var(--of-accent); outline-offset: 2px; }

/* Grid / list segmented toggle */
.os-filter__view { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 11px; background: var(--of-soft); }
.os-filter .view-toggle-btn {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--of-muted);
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.os-filter .view-toggle-btn:hover { color: var(--of-ink); }
.os-filter .view-toggle-btn.active { background: var(--of-bg); color: var(--of-accent); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .06); }
.os-filter .view-toggle-btn:focus-visible { outline: 2px solid var(--of-accent); outline-offset: 1px; }

/* Active filter line */
.os-filter__active { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 8px 4px 0; color: var(--of-muted); font-size: .85rem; }
.os-filter__active strong { color: var(--of-ink); }
.os-filter__reset { margin-left: auto; color: var(--of-accent); font-weight: 700; text-decoration: none; }
.os-filter__reset:hover { text-decoration: underline; }

@media (max-width: 760px) {
	.os-filter__form { flex-wrap: wrap; }
	.os-filter__search { flex-basis: 100%; }
	.os-filter__input { font-size: 16px; } /* keeps iOS from zooming in */
	.os-filter__select { flex: 1; max-width: none; min-width: 0; }
	.os-filter__select--brand { min-width: 0; }
	.os-filter__apply { display: none; } /* Enter / the selects submit */
	.os-filter__view { display: none; } /* one column on phones; grid/list makes no difference */
}
