.aes-widget {
	max-width: 100%;
}

/* Fully custom search box — no dependency on any external theme's markup
   or CSS, so there's nothing left that can inject an unwanted icon. */
.aes-search-input-wrap {
	position: relative;
}

.aes-search-input {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 40px 10px 14px;
	font-size: 16px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	-webkit-appearance: none;
	appearance: none;
}

.aes-search-input::-webkit-search-decoration,
.aes-search-input::-webkit-search-cancel-button,
.aes-search-input::-webkit-search-results-button,
.aes-search-input::-webkit-search-results-decoration {
	-webkit-appearance: none;
}

.aes-search-reset {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	width: 26px;
	height: 26px;
	border: none;
	background: #eee;
	padding: 0;
	margin: 0;
	cursor: pointer;
	color: #444;
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
	display: none;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}

.aes-search-reset:hover {
	color: #fff;
	background: #555;
}

.aes-hits .ais-Hits-list {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	display: grid;
	gap: 20px;
}

.aes-hit {
	display: block;
	text-decoration: none;
	color: inherit;
}

.aes-hit-title {
	font-weight: 700;
	color: #1e73be;
	margin-bottom: 2px;
	line-height: 1.3;
}

.aes-hit:hover .aes-hit-title {
	text-decoration: underline;
}

.aes-hit-excerpt {
	font-size: 14px;
	color: #444;
	line-height: 1.3;
}

.aes-hit-title mark,
.aes-hit-excerpt mark,
.aes-hit .ais-Highlight-highlighted {
	color: #d63638;
	background: transparent;
	font-weight: 700;
}

.aes-pagination {
	margin-top: 8px;
}


/* ---------------------------------------------------------------
   Facet (filter) panel — used when [algolia_search facets="yes"]
   or the standalone [algolia_facets] shortcode is present.
   --------------------------------------------------------------- */

.aes-widget-combined.aes-has-facets {
	display: flex;
	gap: 24px;
	align-items: flex-start;
}

.aes-widget-combined.aes-has-facets .aes-facets-panel {
	flex: 0 0 220px;
	min-width: 0;
}

.aes-widget-combined.aes-has-facets .aes-results-panel {
	flex: 1 1 auto;
	min-width: 0;
}

.aes-facets-heading {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 700;
}

.aes-facet-list .ais-RefinementList-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aes-facet-list .ais-RefinementList-item {
	margin-bottom: 6px;
	font-size: 14px;
	line-height: 1.35;
}

.aes-facet-list .ais-RefinementList-label {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	cursor: pointer;
}

.aes-facet-list .ais-RefinementList-checkbox {
	margin-top: 3px;
	flex: 0 0 auto;
}

.aes-facet-list .ais-RefinementList-count {
	margin-left: auto;
	background: #eee;
	border-radius: 10px;
	padding: 0 7px;
	font-size: 12px;
	color: #444;
	flex: 0 0 auto;
}

.aes-facet-list .ais-RefinementList-showMore {
	margin-top: 8px;
	background: none;
	border: 0;
	padding: 0;
	color: #3858e9;
	cursor: pointer;
	font-size: 13px;
}

.aes-clear-refinements .ais-ClearRefinements-button {
	background: none;
	border: 0;
	padding: 0 0 8px;
	color: #3858e9;
	cursor: pointer;
	font-size: 13px;
}

.aes-clear-refinements .ais-ClearRefinements-button--disabled {
	color: #999;
	cursor: default;
}

/* Stack the columns on narrow screens. */
@media (max-width: 782px) {
	.aes-widget-combined.aes-has-facets {
		display: block;
	}
	.aes-widget-combined.aes-has-facets .aes-facets-panel {
		margin-bottom: 18px;
	}
}
