.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;
	font-weight: 600;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	color: var( --aes-highlight-color, #d63638 );
	-webkit-appearance: none;
	appearance: none;
}

.aes-search-input::placeholder {
	color: #888;
	font-weight: 400;
}

.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: var( --aes-highlight-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;
	}
}


/* ---------------------------------------------------------------
   Classic look — used by the legacy [Algolia-Search] shortcode on the
   front page. Reproduces the old Search Busu layout: categories on the
   left, a 4-column grid of bordered cards, orange highlights, blue
   buttons. Everything is scoped to .aes-look-classic so the modern
   widgets are untouched.
   --------------------------------------------------------------- */

.aes-look-classic {
	color: #3a4570;
}

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

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

.aes-look-classic .aes-facets-heading {
	margin: .5rem 0 .75rem;
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1.2;
	color: inherit;
}

.aes-look-classic .aes-clear-refinements .ais-ClearRefinements-button {
	display: block;
	width: 100%;
	margin: 0 0 .75rem;
	padding: .4rem .5rem;
	font-size: .8rem;
	color: #fff;
	background: #0096db;
	border: 0;
	border-radius: 5px;
	cursor: pointer;
}

.aes-look-classic .aes-clear-refinements .ais-ClearRefinements-button--disabled {
	color: #a5abc4;
	background: #f5f6fa;
	cursor: default;
}

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

.aes-look-classic .aes-facet-list .ais-RefinementList-item {
	margin: 0 0 .35rem;
	font-size: 1rem;
	line-height: 1.5;
}

.aes-look-classic .aes-facet-list .ais-RefinementList-label {
	display: flex;
	align-items: center;
	gap: .5rem;
	font-weight: 400;
	color: #3a4570;
	cursor: pointer;
}

.aes-look-classic .aes-facet-list .ais-RefinementList-checkbox {
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	margin: 0;
	-webkit-appearance: checkbox;
	appearance: auto;
	box-shadow: none;
}

.aes-look-classic .aes-facet-list .ais-RefinementList-labelText {
	max-width: 165px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.aes-look-classic .aes-facet-list .ais-RefinementList-count {
	margin-left: 0;
	padding: .1rem .4rem;
	font-size: .8rem;
	line-height: 1.2;
	color: #3a4570;
	background: #dfe2ee;
	border: 0;
	border-radius: 8px;
}

.aes-look-classic .aes-facet-list .ais-RefinementList-showMore {
	margin-top: .5rem;
	padding: .3rem .5rem;
	font-size: .8rem;
	color: #fff;
	background: #0096db;
	border: 0;
	border-radius: 5px;
	cursor: pointer;
}

.aes-look-classic .aes-facet-list .ais-RefinementList-showMore:hover {
	background: #0073a8;
}

.aes-look-classic .aes-search-input {
	padding: .55rem 2.6rem .55rem .9rem;
	font-size: 1rem;
	font-weight: 400;
	color: #3a4570;
	background: #fff;
	border: 1px solid #c4c8d8;
	border-radius: 5px;
}

.aes-look-classic .aes-search-input::placeholder {
	color: #a5aed1;
}

.aes-look-classic .aes-hits .ais-Hits-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin: 0 0 0 -1rem;
	padding: 0;
	list-style: none;
}

.aes-look-classic .aes-hits .ais-Hits-item {
	display: block;
	width: calc(25% - 1rem);
	margin: 1rem 0 0 1rem;
	padding: 1rem;
	font-size: 1rem;
	line-height: 1.4;
	background: #fff;
	border: 1px solid #c4c8d8;
	border-radius: 0;
	box-shadow: 0 2px 5px 0 #e3e5ec;
}

.aes-look-classic .aes-hit {
	display: block;
	color: #3a4570;
	text-decoration: none;
}

.aes-look-classic .aes-hit-title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 1.25rem 0 .5rem;
	font-size: 1.25rem;
	font-weight: 400;
	line-height: 1.25;
	color: #3a4570;
}

.aes-look-classic .aes-hit:hover .aes-hit-title {
	text-decoration: none;
	color: #0073a8;
}

.aes-look-classic .aes-hit-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	font-size: .875rem;
	line-height: 1.35;
	color: #3a4570;
	text-transform: lowercase;
}

.aes-look-classic .aes-hit mark,
.aes-look-classic .aes-hit .ais-Highlight-highlighted {
	padding: 0;
	font-weight: inherit;
	color: inherit;
	background: #ffc168;
}

.aes-look-classic .aes-empty {
	padding: 1rem 0;
}

.aes-look-classic .aes-pagination {
	margin-top: 1.25rem;
}

.aes-look-classic .ais-Pagination-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .3rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.aes-look-classic .ais-Pagination-link {
	display: block;
	padding: .3rem .6rem;
	color: #0096db;
	text-decoration: none;
	background: #fff;
	border: 1px solid #c4c8d8;
	border-radius: 5px;
}

.aes-look-classic .ais-Pagination-item--selected .ais-Pagination-link {
	color: #fff;
	background: #0096db;
	border-color: #0096db;
}

.aes-look-classic .ais-Pagination-item--disabled .ais-Pagination-link {
	color: #a5abc4;
	opacity: .6;
	cursor: not-allowed;
}

/* Same breakpoints as the old layout: categories hide below 992px. */
@media (max-width: 991.98px) {
	.aes-widget-combined.aes-look-classic.aes-has-facets {
		display: block;
	}
	/* Old phone layout: space above the search box, less above each title. */
	.aes-look-classic .aes-searchbox {
		margin-top: 1em;
	}
	.aes-look-classic .aes-hit-title {
		margin-top: .6rem;
	}
	.aes-widget-combined.aes-look-classic.aes-has-facets .aes-facets-panel {
		display: none;
	}
	.aes-look-classic .aes-hits .ais-Hits-item {
		width: calc(50% - 1rem);
	}
}

@media (max-width: 575.98px) {
	.aes-look-classic .aes-hits .ais-Hits-item {
		width: calc(100% - 1rem);
	}
}
