/**
 * Sonic Live Search — dropdown styles.
 *
 * Brand-agnostic: colours are driven by custom properties so any theme can
 * recolour the dropdown by overriding them on `.sonic-live-search-panel`
 * without editing this file. Neutral defaults below.
 */
.sonic-live-search-panel {
	--sls-bg: #fff;
	--sls-accent: #2563eb;
	--sls-accent-soft: rgba( 37, 99, 235, 0.12 );
	--sls-text: #1f2937;
	--sls-muted: #6b7280;
	--sls-radius: 0.75rem;

	position: absolute;
	top: calc( 100% + 6px );
	left: 0;
	right: 0;
	z-index: 60;
	max-height: min( 70vh, 480px );
	overflow-y: auto;
	padding: 0.25rem;
	background: var( --sls-bg );
	border: 1px solid var( --sls-accent );
	border-radius: var( --sls-radius );
	box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.12 );
	font-family: inherit;
	text-align: left;
}

.sonic-live-search-panel[hidden] {
	display: none;
}

.sonic-live-search-panel--loading,
.sonic-live-search-panel--empty,
.sonic-live-search-panel--error {
	padding: 1rem;
	text-align: center;
	font-weight: 600;
	color: var( --sls-text );
}

.sonic-live-search-panel--error {
	color: #b42318;
}

.sonic-live-search-option {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 0.75rem;
	border-radius: calc( var( --sls-radius ) - 0.25rem );
	color: var( --sls-text );
	text-decoration: none;
}

.sonic-live-search-option:hover,
.sonic-live-search-option.is-active {
	background: var( --sls-accent-soft );
}

.sonic-live-search-option:focus {
	outline: 2px solid var( --sls-accent );
	outline-offset: -2px;
}

.sonic-live-search-option__thumb {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 0.375rem;
	background: #f4f4f4;
}

.sonic-live-search-option__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.sonic-live-search-option__title {
	font-weight: 600;
	color: var( --sls-text );
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sonic-live-search-option__price {
	font-size: 0.875rem;
	color: var( --sls-muted );
}

.sonic-live-search-option__price del {
	opacity: 0.6;
}

.sonic-live-search-option__price ins {
	text-decoration: none;
	font-weight: 600;
	color: var( --sls-text );
}

.sonic-live-search-viewall {
	display: block;
	margin-top: 0.25rem;
	padding: 0.75rem;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	text-align: center;
	font-weight: 700;
	color: var( --sls-accent );
	text-decoration: none;
}

.sonic-live-search-viewall:hover,
.sonic-live-search-viewall.is-active {
	background: var( --sls-accent-soft );
}
