.filters-container {
	margin-top: 16px;
	margin-bottom: 24px;
}

.filters {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 20px 24px;
	align-items: end;
	background-color: rgba(255, 255, 255, 0.04);
	border-radius: 16px;
	padding: 24px;
}

.filter-wrapper {
	display: flex;
	flex-direction: column;
	gap: 8px;
	position: relative;
}

.filter-wrapper > label {
	font-size: 0.7rem;
	letter-spacing: 0.04em;
	font-weight: 700;
	text-transform: uppercase;
	opacity: 0.55;
}

.filter-dropdown-heading {
	margin: 0 0 16px 0;
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-weight: 700;
	opacity: 0.6;
}

.filter__input-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

.filter__input-group:last-of-type {
	margin-bottom: 8px;
}

.filter__input-group-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.filter__input-group-row > label {
	font-size: 0.85rem;
	opacity: 0.75;
}

.filter__input-group-row > span {
	font-weight: 700;
	font-size: 1rem;
	color: white;
}

.filter {
	position: relative;
}

.filter__toggle {
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 8px;
	background-color: rgba(255, 255, 255, 0.05);
	width: 100%;
	height: 42px;
	padding: 0 12px;
	cursor: pointer;
	color: white;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	text-transform: capitalize;
	font-size: 0.9rem;
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.filter__toggle::after {
	content: "";
	flex-shrink: 0;
	width: 7px;
	height: 7px;
	border-right: 1.5px solid rgba(255, 255, 255, 0.5);
	border-bottom: 1.5px solid rgba(255, 255, 255, 0.5);
	transform: rotate(45deg);
	transition: transform 0.15s ease;
	margin-top: -3px;
}

.filter__toggle:hover {
	border-color: rgba(255, 255, 255, 0.35);
	background-color: rgba(255, 255, 255, 0.08);
}

.filter__toggle:focus {
	outline: none;
	border-color: white;
}

.filter__toggle--active {
	border-color: var(--thirty);
	background-color: rgba(var(--thirty-rgb), 0.14);
	font-weight: 600;
}

.filter.open > .filter__toggle {
	border-color: var(--thirty);
}

.filter.open > .filter__toggle::after {
	transform: rotate(225deg);
	margin-top: 3px;
}

.filter__toggle--sort {
	width: 190px;
}

.sort {
	margin-bottom: 16px;
}

.filter.open .filter-dropdown {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.filter-dropdown {
	display: none;
	margin-top: 8px;
	position: absolute;
	background-color: var(--sixty);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 12px;
	padding: 8px;
	height: auto;
	max-height: 320px;
	overflow-y: auto;
	width: 220px;
	z-index: var(--z-dropdown);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.filter-dropdown-option {
	border: none;
	border-radius: 8px;
	color: white;
	background-color: transparent;
	cursor: pointer;
	min-height: 36px;
	text-overflow: ellipsis;
	overflow: hidden;
	text-transform: capitalize;
	text-decoration: none;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	padding: 0 10px;
	position: relative;
	transition: background-color 0.12s ease;
}

.filter-dropdown-option:hover {
	background-color: rgba(255, 255, 255, 0.08);
}

.filter-dropdown-option.selected {
	background-color: rgba(var(--thirty-rgb), 0.18);
	font-weight: 600;
}

.filter-dropdown-option.selected::after {
	content: "";
	position: absolute;
	right: 10px;
	width: 5px;
	height: 9px;
	border-right: 2px solid var(--thirty);
	border-bottom: 2px solid var(--thirty);
	transform: rotate(45deg);
}

.filter-dropdown--year,
.filter-dropdown--max-mileage {
	padding: 18px;
	width: 320px;
}

.apply-button {
	border: none;
	border-radius: 8px;
	color: white;
	background-color: var(--thirty);
	cursor: pointer;
	width: 100%;
	height: 38px;
	font-weight: 600;
	font-size: 0.9rem;
	transition: opacity 0.15s ease;
}

.apply-button:hover {
	opacity: 0.88;
}

.filter-wrapper--reset {
	justify-content: flex-end;
}

.reset-filters-btn {
	width: auto;
	height: 42px;
	padding: 0 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background-color: transparent;
	color: white;
	cursor: pointer;
	font-size: 0.9rem;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.reset-filters-btn:hover {
	border-color: var(--thirty);
	background-color: rgba(var(--thirty-rgb), 0.14);
}

.reset-filters-btn svg {
	flex-shrink: 0;
}

.filter__input-group > input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	outline: none;
	cursor: pointer;
	margin: 0;
}

/* Chrome, Safari, Edge */
.filter__input-group > input::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	background-color: var(--thirty);
	border: 3px solid white;
	border-radius: 50%;
	cursor: pointer;
	width: 16px;
	height: 16px;
	margin-top: -6px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* Firefox */
.filter__input-group > input::-moz-range-thumb {
	background-color: var(--thirty);
	border: 3px solid white;
	border-radius: 50%;
	cursor: pointer;
	width: 16px;
	height: 16px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.filter__input-group > input::-moz-range-track {
	height: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 560px) {
	.filters {
		grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
		padding: 16px;
		gap: 16px;
	}

	.filter-wrapper--reset {
		grid-column: 1 / -1;
		align-items: stretch;
	}

	.reset-filters-btn {
		width: 100%;
	}

	.filter-dropdown--year,
	.filter-dropdown--max-mileage {
		width: 260px;
		transform: translate(-50%, 0);
		left: 50%;
	}
}
