.apex-search-form {
	display: flex;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 10px;
}

.apex-search-fields {
	display: flex;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 10px;
	flex: 1 1 auto;
}

.apex-search-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 160px;
	min-width: 140px;
}

.apex-search-field-label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: inherit;
}

.apex-search-select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #d5d8dd;
	border-radius: 4px;
	background: #fff;
	color: #1a1a1a;
	font-size: 14px;
	appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3e%3cpath fill='%23555' d='M0 0l6 8 6-8z'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 14px center;
}

.apex-search-select:focus {
	outline: none;
	border-color: #2f6fed;
	box-shadow: 0 0 0 1px #2f6fed;
}

.apex-search-select:disabled {
	background-color: #e9ebee;
	color: #9a9fa8;
	cursor: not-allowed;
}

.apex-search-submit {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border: 0;
	border-radius: 4px;
	background: #e5302a;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	cursor: pointer;
	white-space: nowrap;
}

.apex-search-submit:hover,
.apex-search-submit:focus {
	background: #c8251f;
}

.apex-search-submit-icon {
	display: inline-block;
	width: 0;
	height: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 7px solid #fff;
}

.apex-search-reset {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #4a4f57;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.apex-search-reset:hover {
	color: #1a1a1a;
}

.apex-search-reset-icon::before {
	content: "\21bb";
	display: inline-block;
	font-size: 14px;
}

.apex-search-form--horizontal .apex-search-fields {
	flex-direction: row;
}

.apex-search-form--horizontal .apex-search-field {
	width: auto !important;
}

.apex-search-form--vertical {
	flex-direction: column;
	align-items: stretch;
}

.apex-search-form--vertical .apex-search-fields {
	flex-direction: column;
	align-items: stretch;
	width: 100%;
}

.apex-search-form--vertical .apex-search-field {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
}

/* Tablet: two fields per row regardless of the horizontal/vertical setting. */
@media (max-width: 1023px) {
	.apex-search-form--horizontal .apex-search-field {
		width: calc(50% - 5px) !important;
		flex: 1 1 calc(50% - 5px);
	}
}

/* Mobile: everything stacks full-width, submit/reset become a full-width row. */
@media (max-width: 599px) {
	.apex-search-form {
		flex-direction: column;
		align-items: stretch;
	}

	.apex-search-fields,
	.apex-search-form--horizontal .apex-search-fields {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
	}

	.apex-search-field,
	.apex-search-form--horizontal .apex-search-field {
		width: 100% !important;
		min-width: 0;
	}

	.apex-search-select {
		padding: 14px;
		font-size: 16px; /* keeps iOS Safari from auto-zooming on focus */
	}

	.apex-search-submit {
		width: 100%;
		justify-content: center;
	}

	.apex-search-reset {
		width: 100%;
		justify-content: center;
	}
}
