/* Team Moon — panel under the theme search boxes (recent + popular) and a red clear X. */

.tm-sp {
	--tm-sp-ink: #09122d;
	--tm-sp-muted: #6b7280;
	--tm-sp-line: rgba(9, 18, 45, 0.08);
	--tm-sp-soft: #f6f4ef;
	--tm-sp-gold: #c8a24a;
	position: absolute;
	inset-inline: 0;
	top: calc(100% + 8px);
	z-index: 400;
	max-height: min(70vh, 460px);
	overflow-y: auto;
	padding: 14px 16px 16px;
	border: 1px solid var(--tm-sp-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 18px 40px rgba(9, 18, 45, 0.14);
	color: var(--tm-sp-ink);
	text-align: start;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.18s, transform 0.18s, visibility 0s 0.18s;
}

.tm-sp.is-open {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.18s, transform 0.18s;
}

.tm-sp__sec + .tm-sp__sec {
	margin-top: 16px;
}

.tm-sp__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 4px;
}

.tm-sp__title {
	display: block;
	margin-bottom: 10px;
	color: var(--tm-sp-muted);
	font-size: 13px;
	font-weight: 500;
}

.tm-sp__head .tm-sp__title {
	margin: 0;
}

.tm-sp .tm-sp__clear-all,
.tm-sp .tm-sp__q,
.tm-sp .tm-sp__x,
.tm-sp .tm-sp__chip {
	min-height: 0;
	margin: 0;
	border: 0;
	background: none;
	box-shadow: none;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
}

.tm-sp .tm-sp__clear-all {
	height: auto;
	padding: 4px 0;
	color: #ef4444;
	font-size: 13px;
	font-weight: 500;
}

.tm-sp__recent {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tm-sp__recent li {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	border-bottom: 1px solid var(--tm-sp-line);
}

.tm-sp__recent li:last-child {
	border-bottom: 0;
}

.tm-sp .tm-sp__q {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	height: 42px;
	padding: 0;
	color: var(--tm-sp-ink);
	font-size: 14px;
	font-weight: 400;
	text-align: start;
}

.tm-sp__q span {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.tm-sp__q svg {
	flex: none;
	width: 17px;
	height: 17px;
	color: var(--tm-sp-muted);
}

.tm-sp .tm-sp__x {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border-radius: 50%;
	color: var(--tm-sp-muted);
	transition: background-color 0.2s, color 0.2s;
}

.tm-sp .tm-sp__x:hover {
	background: rgba(239, 68, 68, 0.1);
	color: #ef4444;
}

.tm-sp__x svg {
	width: 13px;
	height: 13px;
}

.tm-sp__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tm-sp .tm-sp__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 13px;
	border: 1px solid var(--tm-sp-line);
	border-radius: 17px;
	background: #fff;
	color: var(--tm-sp-ink);
	font-size: 13px;
	font-weight: 500;
	transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.tm-sp .tm-sp__chip:hover {
	border-color: var(--tm-sp-gold);
	background: var(--tm-sp-soft);
}

.tm-sp .tm-sp__chip:active {
	transform: scale(0.96);
}

.tm-sp__chip svg {
	width: 14px;
	height: 14px;
	color: var(--tm-sp-gold);
}

/* Red clear X in the theme search boxes (instead of the browser's grey one). */
form.searchform input[type="search"]::-webkit-search-cancel-button,
.woocommerce-product-search input[type="search"]::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	margin-inline-start: 6px;
	border-radius: 50%;
	background: #ef4444 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 12px no-repeat;
	box-shadow: 0 3px 8px rgba(239, 68, 68, 0.35);
	cursor: pointer;
}

form.searchform input[type="search"]::-webkit-search-cancel-button:hover,
.woocommerce-product-search input[type="search"]::-webkit-search-cancel-button:hover {
	background-color: #dc2626;
}

@media (prefers-reduced-motion: reduce) {
	.tm-sp,
	.tm-sp.is-open {
		transition: none;
	}
}
