/**
 * Angry Ajax Search Pro — search box extras.
 * Scoped under .aas-search like the widget's own styles.
 */

/* Popular and recent searches */
.aas-search .aasp-suggest {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 2147483646;
	width: 100%;
	min-width: 280px;
	max-width: calc(100vw - 24px);
	padding: 12px 14px 4px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	box-sizing: border-box;
}

.aas-search .aasp-suggest[hidden] {
	display: none;
}

.aas-search .aasp-suggest__group {
	margin-bottom: 10px;
}

.aas-search .aasp-suggest__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
	color: #777;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.aas-search .aasp-suggest__clear {
	padding: 0;
	border: 0;
	background: none;
	color: #777;
	font: inherit;
	text-decoration: underline;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}

.aas-search .aasp-suggest__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.aas-search .aasp-chip {
	padding: 5px 12px;
	border: 1px solid #e3e3e3;
	border-radius: 999px;
	background: #f7f7f7;
	color: #333;
	font: inherit;
	font-size: 13px;
	line-height: 1.4;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.aas-search .aasp-chip:hover,
.aas-search .aasp-chip:focus-visible {
	border-color: #bbb;
	background: #eee;
}

/* Redirect row */
.aas-search .aasp-redirect {
	display: flex;
	gap: 10px;
	align-items: center;
	margin: 6px;
	padding: 10px 12px;
	border-radius: 6px;
	background: #f3f4f6;
	color: inherit;
	font-weight: 600;
	text-decoration: none;
}

.aas-search .aasp-redirect:hover {
	background: #e9eaee;
}

.aas-search .aasp-redirect__icon {
	font-size: 16px;
	line-height: 1;
}

/* Did you mean */
.aas-search .aasp-dym {
	padding: 14px 14px 0;
	color: #333;
	font-size: 14px;
}

.aas-search .aasp-dym__term {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

.aas-search .aasp-dym__count {
	margin-left: 6px;
	color: #777;
	font-size: 12.5px;
}

/* Full-screen search on phones */
.aas-search .aasp-close {
	display: none;
}

@media (max-width: 600px) {
	.aas-search.aasp-full {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 2147483647;
		max-width: none;
		padding: 12px 56px 12px 12px;
		background: #fff;
		overflow-y: auto;
	}

	.aas-search.aasp-full .aasp-close {
		position: absolute;
		top: 12px;
		right: 8px;
		display: grid;
		place-items: center;
		width: 42px;
		height: 42px;
		padding: 0;
		border: 0;
		background: none;
		color: #333;
		font-size: 30px;
		line-height: 1;
		cursor: pointer;
	}

	.aas-search.aasp-full .aas-search__panel {
		left: 0 !important;
		right: 0;
		bottom: 0;
		width: 100% !important;
		max-width: 100% !important;
		max-height: none;
		transform: none !important;
		border: 0;
		border-top: 1px solid #eee;
		border-radius: 0;
		box-shadow: none;
	}

	.aas-search.aasp-full .aasp-suggest {
		position: static;
		margin-top: 12px;
		border: 0;
		box-shadow: none;
		padding: 0;
		min-width: 0;
		max-width: none;
	}

	html.aasp-lock,
	html.aasp-lock body {
		overflow: hidden;
	}
}

/* Search words in titles */
.aas-search .aasp-hl {
	padding: 0;
	background: none;
	color: inherit;
	font-weight: 700;
}

/* Sale / featured badges */
.aas-search .aasp-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.aas-search__detail .aasp-badges {
	margin-bottom: 6px;
}

.aas-search .aasp-badge {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 3px;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: nowrap;
}

.aas-search .aasp-badge--sale {
	background: #d63638;
	color: #fff;
}

.aas-search .aasp-badge--featured {
	background: #fcf0d0;
	color: #7a5600;
}

/* Short description under the title */
.aas-search .aasp-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	color: #777;
	font-size: 12px;
	line-height: 1.35;
}

/* Search box as a menu item */
.angry-as-menu-item {
	display: flex;
	align-items: center;
	list-style: none;
}

.angry-as-menu-item > .aas-search {
	width: 260px;
	max-width: 100%;
}

/* Icon-only search box (design setting) */
.aas-search.aasp-icon {
	display: inline-block;
	width: auto;
	vertical-align: middle;
}

.aas-search .aasp-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 1px solid #ccc;
	border-radius: 50%;
	background: #fff;
	color: #333;
	cursor: pointer;
}

.aas-search .aasp-toggle:hover,
.aas-search .aasp-toggle:focus-visible {
	border-color: #888;
}

.aas-search.aasp-icon > .aas-search__input {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	display: none;
	width: 360px;
	max-width: calc(100vw - 24px);
	height: 40px;
}

.aas-search.aasp-icon.aasp-open > .aas-search__input {
	display: block;
}

.aas-search.aasp-icon .aas-search__panel,
.aas-search.aasp-icon .aasp-suggest {
	right: 0;
	left: auto;
	transform: none;
}

/* Icon on the left half of the screen: open to the right. */
.aas-search.aasp-icon.aasp-from-left > .aas-search__input {
	right: auto;
	left: 0;
}

.aas-search.aasp-icon.aasp-from-left .aas-search__panel,
.aas-search.aasp-icon.aasp-from-left .aasp-suggest {
	right: auto;
	left: 0;
}

@media (max-width: 600px) {
	.aas-search.aasp-icon.aasp-full > .aas-search__input {
		position: static;
		display: block;
		width: 100%;
		max-width: none;
	}

	.aas-search.aasp-icon.aasp-full .aasp-toggle {
		display: none;
	}
}

/* Darkened page behind open results (design setting) */
.aas-search.aasp-shaded {
	z-index: 2147483640;
}

.aas-search .aasp-backdrop {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: -1;
	background: rgba(15, 18, 24, 0.45);
}

.aas-search .aasp-backdrop[hidden] {
	display: none;
}
