.rles-widget {
	position: relative;
	width: 100%;
	z-index: 20;
}

.rles-search-form {
	display: flex;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 24px;
	width: 100%;
}

.rles-search-field {
	min-width: 0;
}

.rles-search-field--keyword {
	flex: 1 1 55%;
}

.rles-search-field--taxonomy {
	flex: 1 1 220px;
}

.rles-search-field--button {
	flex: 0 0 auto;
}

.rles-field-label {
	display: block;
	margin: 0 0 7px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

.rles-search-input-wrap {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 0 14px;
	background: #fff;
	border: 1px solid #d5d8dc;
	border-radius: 4px;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.rles-search-input-wrap:focus-within {
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, .15);
}

.rles-search-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	margin-right: 10px;
	font-size: 18px;
	line-height: 1;
}

.rles-search-icon svg {
	width: 1em;
	height: 1em;
}

.rles-search-input {
	width: 100%;
	min-width: 0;
	padding: 0;
	margin: 0;
	background: transparent;
	border: 0 !important;
	box-shadow: none !important;
	outline: 0;
	font: inherit;
	line-height: 1.4;
}

.rles-search-input::-webkit-search-cancel-button {
	cursor: pointer;
}

.rles-taxonomy-select {
	width: 100%;
	height: 48px;
	padding: 0 40px 0 14px;
	background-color: #fff;
	border: 1px solid #d5d8dc;
	border-radius: 4px;
	font: inherit;
	cursor: pointer;
}

.rles-taxonomy-select:focus {
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, .15);
	outline: 0;
}

.rles-search-button,
.rles-load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 24px;
	background: #0073aa;
	border: 1px solid transparent;
	border-radius: 4px;
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}

.rles-search-button:hover,
.rles-search-button:focus,
.rles-load-more:hover,
.rles-load-more:focus {
	background: #005f8d;
	color: #fff;
}

.rles-search-button:disabled,
.rles-load-more:disabled {
	opacity: .65;
	cursor: wait;
}

.rles-results-panel {
	width: 100%;
	margin-top: 14px;
	padding: 16px;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .16);
	color: #222;
}

.rles-results-position-overlay .rles-results-panel {
	position: absolute;
	left: 0;
	top: calc(100% + 6px);
	z-index: 9999;
	max-height: min(70vh, 680px);
	overflow-y: auto;
}

.rles-results-position-inline .rles-results-panel {
	position: relative;
}

.rles-results-panel[hidden] {
	display: none !important;
}

.rles-results__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 0 0 12px;
	margin: 0 0 4px;
	border-bottom: 1px solid #ececec;
	font-size: 15px;
}

.rles-results__items {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
}

.rles-result-item {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid #ececec;
}

.rles-result-item:last-child {
	border-bottom: 0;
}

.rles-result-item__link {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 10px;
	color: inherit;
	text-decoration: none;
	transition: background-color .18s ease;
}

.rles-result-item__link:hover,
.rles-result-item__link:focus {
	background: #f7f8fa;
	color: inherit;
	outline: 0;
}

.rles-result-item__thumb {
	flex: 0 0 104px;
	width: 104px;
	height: 70px;
	overflow: hidden;
	border-radius: 10px;
	background: #f0f0f0;
}

.rles-result-item__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rles-result-item__content {
	min-width: 0;
	flex: 1 1 auto;
}

.rles-result-item__title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
	color: #2f2f2f;
}

.rles-result-item__excerpt {
	font-size: 14px;
	line-height: 1.45;
	color: #4a4a4a;
}

.rles-results__loading,
.rles-results__empty,
.rles-results__error {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 90px;
	padding: 18px;
	text-align: center;
}

.rles-results__error {
	color: #b42318;
}

.rles-spinner {
	width: 20px;
	height: 20px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: rles-spin .7s linear infinite;
}

@keyframes rles-spin {
	to { transform: rotate(360deg); }
}

.rles-load-more {
	display: flex;
	margin: 16px auto 0;
	min-height: 42px;
}

.rles-infinite-sentinel {
	height: 1px;
	margin-top: 1px;
}

.rles-widget.is-loading .rles-search-button {
	opacity: .75;
}

@media (max-width: 767px) {
	.rles-search-form {
		align-items: stretch;
		gap: 12px;
	}

	.rles-search-field--keyword,
	.rles-search-field--taxonomy,
	.rles-search-field--button {
		flex: 1 1 100%;
		width: 100%;
	}

	.rles-search-button {
		width: 100%;
	}

	.rles-results-position-overlay .rles-results-panel {
		position: absolute;
		max-height: 72vh;
	}

	.rles-result-item__link {
		align-items: flex-start;
		gap: 12px;
		padding: 12px 4px;
	}

	.rles-result-item__thumb {
		flex-basis: 82px;
		width: 82px;
		height: 62px;
	}

	.rles-result-item__title {
		font-size: 15px;
	}

	.rles-result-item__excerpt {
		font-size: 13px;
	}
}
