.am-search-page {
	background: var(--am-bg);
}

.am-search-layout {
	display: flex;
	flex-direction: column;
	min-height: calc(100dvh - 8rem);
}

.am-search-toolbar {
	position: sticky;
	top: 0;
	z-index: 30;
	padding: 1rem var(--am-gutter) 0.75rem;
	border-bottom: 1px solid color-mix(in srgb, var(--am-border) 70%, transparent);
	background: color-mix(in srgb, var(--am-bg) 95%, transparent);
	backdrop-filter: blur(12px);
}

.am-search-toolbar__row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.am-search-toolbar__row h1 {
	flex: 1;
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
}

.am-search-toolbar__back,
.am-search-toolbar__filters {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--am-surface);
	color: var(--am-ink);
	cursor: pointer;
}

.am-search-toolbar__back::before,
.am-search-toolbar__filters::before {
	content: "";
	width: 20px;
	height: 20px;
	background: currentColor;
	mask-position: center;
	mask-repeat: no-repeat;
	mask-size: contain;
	-webkit-mask-position: center;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-size: contain;
}

.am-search-toolbar__back::before {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M15 5 8 12l7 7'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M15 5 8 12l7 7'/%3E%3C/svg%3E");
}

.am-search-toolbar__filters::before {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h16M7 12h10M10 17h4'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h16M7 12h10M10 17h4'/%3E%3C/svg%3E");
}

.am-search-toolbar__news {
	color: var(--am-muted);
	font-size: 0.875rem;
	font-weight: 600;
}

.am-search--toolbar {
	margin-top: 0.75rem;
}

.am-search--toolbar input[type="search"] {
	width: 100%;
	min-height: 44px;
	padding: 0 1rem 0 2.6rem;
	border: 1px solid var(--am-border);
	border-radius: 12px;
	background: var(--am-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23686b70' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E") 12px center / 18px no-repeat;
	font: inherit;
	font-size: 0.875rem;
}

.am-search-filters {
	display: none;
}

.am-search-filters__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.am-search-filters__top h2 {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading), system-ui, sans-serif;
	font-size: 1.125rem;
	font-weight: 700;
}

.am-search-filters__reset {
	color: var(--am-primary);
	font-size: 0.875rem;
	font-weight: 500;
}

.am-search-filters__reset:hover {
	text-decoration: underline;
}

.am-search-filters__submit {
	width: 100%;
	margin-top: 0.25rem;
}

.am-field__currency {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 0.4rem;
}

.am-field__currency select {
	width: auto;
	min-height: 32px;
	padding-inline: 0.5rem;
	font-size: 0.75rem;
}

.am-search-results {
	padding: 0.75rem var(--am-gutter) 1.5rem;
}

.am-search-results__head h1 {
	display: none;
	margin: 0;
}

.am-search-results__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.am-search-results__meta p {
	margin: 0;
	color: var(--am-muted);
	font-size: 0.75rem;
}

.am-search-sort select {
	min-height: 36px;
	padding: 0 2rem 0 0.75rem;
	border: 1px solid var(--am-border);
	border-radius: 8px;
	background: var(--am-surface);
	color: var(--am-ink);
	font: inherit;
	font-size: 0.875rem;
}

.am-search-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.65rem;
}

.am-search-empty {
	margin: 0;
	padding: 2rem 1rem;
	border: 1px solid var(--am-border);
	border-radius: 12px;
	background: var(--am-surface);
	color: var(--am-muted);
	font-size: 0.875rem;
	text-align: center;
}

.am-search-page .navigation.pagination {
	margin-top: 2rem;
}

.am-search-page .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
}

.am-search-page .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 0.75rem;
	border-radius: 8px;
	background: var(--am-surface);
	box-shadow: 0 0 0 1px var(--am-border);
	color: var(--am-ink);
	font-size: 0.875rem;
	font-weight: 500;
}

.am-search-page .page-numbers.current {
	background-color: #f3362a;
	box-shadow: 0 0 0 1px #f3362a;
	color: #fff;
}

.am-search-page .page-numbers.dots {
	box-shadow: none;
	background: transparent;
	color: var(--am-muted);
}

.am-search-sheet {
	width: min(100%, 28rem);
	max-height: 92dvh;
	margin: auto 0 0 auto;
	padding: 0;
	border: 0;
	border-radius: 16px 16px 0 0;
	background: var(--am-surface);
}

.am-search-sheet::backdrop {
	background: color-mix(in srgb, var(--am-ink) 45%, transparent);
}

.am-search-sheet__inner {
	padding: 1rem 1.25rem 1.5rem;
	overflow: auto;
}

.am-search-sheet__close {
	display: block;
	margin: 0 0 1rem auto;
	border: 0;
	background: none;
	color: var(--am-muted);
	font: inherit;
	font-size: 0.875rem;
	cursor: pointer;
}

body.am-is-search .am-header--mobile {
	display: none;
}

@media (min-width: 768px) {
	.am-search-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0.75rem;
	}
}

@media (min-width: 1024px) {
	.am-search-toolbar,
	.am-search-sheet {
		display: none;
	}

	.am-search-layout {
		flex-direction: row;
		align-items: stretch;
		width: min(100%, var(--am-shell-width));
		margin-inline: auto;
	}

	.am-search-filters {
		display: block;
		position: sticky;
		top: var(--am-header-height);
		flex: 0 0 260px;
		align-self: flex-start;
		max-height: calc(100dvh - var(--am-header-height));
		padding: 1.5rem 1.25rem 2rem;
		overflow: auto;
		border-right: 1px solid var(--am-border);
		background: var(--am-surface);
	}

	.am-search-results {
		flex: 1 1 auto;
		min-width: 0;
		padding: 1.5rem 2rem 3rem;
	}

	.am-search-results__head h1 {
		display: block;
		margin-bottom: 0.25rem;
		font-family: var(--wp--preset--font-family--heading), system-ui, sans-serif;
		font-size: 1.875rem;
		font-weight: 800;
		letter-spacing: -0.03em;
	}

	.am-search-results__meta p {
		font-size: 0.875rem;
	}

	.am-search-grid {
		gap: 0.75rem;
	}
}

@media (min-width: 1280px) {
	.am-search-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}
