/**
 * IW Search Suggestions
 *
 * The panel inherits the theme's font so it reads as part of the store,
 * not as a bolted-on widget.
 */

.iw-ss-panel {
	position: absolute;
	z-index: 999999;
	max-height: 70vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-top: 0;
	box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.12 );
	font-family: inherit;
	font-size: 15px;
	line-height: 1.35;
	color: #222;
	-webkit-overflow-scrolling: touch;
}

.iw-ss-panel[hidden] {
	display: none;
}

.iw-ss-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.iw-ss-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 11px 14px;
	cursor: pointer;
	border: 0;
}

.iw-ss-item.is-active,
.iw-ss-item:hover {
	background: #f4f4f4;
}

.iw-ss-icon {
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	color: #999;
}

.iw-ss-label {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	font-weight: 400;
	/* Product names are long. Wrap to two lines rather than truncating, which
	   hides the part that tells the shopper what the item actually is. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow-wrap: anywhere;
}

/* The characters already typed, matching the reference behavior. */
.iw-ss-label strong {
	font-weight: 700;
}

.iw-ss-section {
	padding: 10px 14px 6px;
	border-top: 1px solid #eee;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #888;
}

.iw-ss-product {
	align-items: flex-start;
	gap: 12px;
	padding: 10px 14px;
}

.iw-ss-thumb {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	object-fit: cover;
	background: #f2f2f2;
	border-radius: 2px;
}

.iw-ss-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.iw-ss-title {
	overflow: hidden;
	font-size: 14px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow-wrap: anywhere;
}

.iw-ss-price {
	font-size: 13px;
	color: #666;
}

.iw-ss-all {
	display: block;
	padding: 12px 14px;
	border-top: 1px solid #eee;
	background: #fafafa;
	font-size: 14px;
	text-decoration: none;
	color: inherit;
}

.iw-ss-all:hover,
.iw-ss-all:focus {
	background: #f0f0f0;
	text-decoration: underline;
}

.iw-ss-panel a:focus-visible,
.iw-ss-item:focus-visible {
	outline: 2px solid #005fcc;
	outline-offset: -2px;
}

/* Screen-reader announcement of result counts. */
.iw-ss-live {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect( 1px, 1px, 1px, 1px );
	white-space: nowrap;
}

/* Suppress the theme's own live-search dropdown so only one list appears. */
.iw-ss-hide-theme .live-search-results,
.iw-ss-hide-theme .autocomplete-suggestions,
.iw-ss-hide-theme .search-results-wrapper {
	display: none !important;
}

@media ( max-width: 600px ) {
	.iw-ss-panel {
		font-size: 16px;
		max-height: 60vh;
	}

	.iw-ss-item {
		padding: 13px 14px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.iw-ss-panel {
		transition: none;
	}
}

/* Category shortcut: a destination, not another search to run. */
.iw-ss-categories {
	border-top: 1px solid #eee;
}

.iw-ss-category {
	padding: 12px 14px;
}

.iw-ss-shop {
	font-size: 15px;
	color: #666;
}

.iw-ss-shop strong {
	font-weight: 700;
	color: #1a1a1a;
}

/* Spelling correction notice. */
.iw-ss-corrected {
	padding: 10px 14px;
	border-bottom: 1px solid #eee;
	background: #fafafa;
	font-size: 13px;
	color: #666;
}

.iw-ss-corrected strong {
	color: #1a1a1a;
}
