/**
 * Serpent Search — dropdown and facet styling.
 *
 * Kept deliberately neutral so it sits inside the Vantage theme without
 * fighting it. Colours come from a small set of custom properties, so the whole
 * thing can be re-skinned from one place.
 */

:root {
	--suk-bg: #ffffff;
	--suk-fg: #1c1c1c;
	--suk-muted: #6b7280;
	--suk-line: #e4e6ea;
	--suk-accent: #b8121b;
	--suk-hover: #f5f6f8;
	--suk-radius: 4px;
	--suk-shadow: 0 8px 28px rgba( 15, 20, 30, 0.16 );
}

.suk-panel {
	position: absolute;
	z-index: 100000;
	max-height: min( 70vh, 560px );
	overflow-y: auto;
	background: var( --suk-bg );
	color: var( --suk-fg );
	border: 1px solid var( --suk-line );
	border-radius: var( --suk-radius );
	box-shadow: var( --suk-shadow );
	font-size: 14px;
	line-height: 1.4;
	-webkit-overflow-scrolling: touch;
}

.suk-panel[hidden] {
	display: none !important;
}

.suk-list {
	display: block;
}

.suk-item {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 8px 12px;
	border-bottom: 1px solid var( --suk-line );
	text-decoration: none;
	color: inherit;
}

.suk-item:last-child {
	border-bottom: 0;
}

.suk-item:hover,
.suk-item.is-active {
	background: var( --suk-hover );
	text-decoration: none;
}

.suk-thumb {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var( --suk-hover );
	border-radius: 3px;
	overflow: hidden;
}

.suk-thumb img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
}

.suk-body {
	flex: 1 1 auto;
	min-width: 0;
}

.suk-name {
	display: block;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.suk-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 2px;
	font-size: 12px;
	color: var( --suk-muted );
}

.suk-sku {
	font-variant-numeric: tabular-nums;
}

.suk-price {
	color: var( --suk-fg );
	font-weight: 600;
}

.suk-oos {
	color: var( --suk-accent );
}

.suk-empty {
	padding: 14px 12px;
	color: var( --suk-muted );
}

.suk-more {
	display: block;
	padding: 10px 12px;
	text-align: center;
	font-weight: 600;
	background: var( --suk-hover );
	border-top: 1px solid var( --suk-line );
	text-decoration: none;
	color: inherit;
	position: sticky;
	bottom: 0;
}

.suk-more:hover,
.suk-more.is-active {
	background: var( --suk-line );
	text-decoration: none;
}

/* ---------- facets on the results page ---------- */

.suk-facets {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 18px;
	padding: 10px 0;
	border-top: 1px solid var( --suk-line );
	border-bottom: 1px solid var( --suk-line );
	font-size: 13px;
}

.suk-facet-group {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.suk-facet-label {
	color: var( --suk-muted );
	margin-right: 2px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 11px;
}

.suk-facet {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 9px;
	border: 1px solid var( --suk-line );
	border-radius: 999px;
	text-decoration: none;
	color: inherit;
	background: var( --suk-bg );
	line-height: 1.5;
}

.suk-facet:hover {
	border-color: var( --suk-muted );
	text-decoration: none;
}

.suk-facet.is-active {
	background: var( --suk-accent );
	border-color: var( --suk-accent );
	color: #fff;
}

.suk-facet-count {
	color: var( --suk-muted );
	font-size: 11px;
	font-variant-numeric: tabular-nums;
}

.suk-facet.is-active .suk-facet-count {
	color: rgba( 255, 255, 255, 0.8 );
}

.suk-facet-clear {
	color: var( --suk-muted );
	text-decoration: underline;
	margin-left: 4px;
}

/* ---------- the shortcode form ---------- */

/*
 * Fills whatever it is dropped into — full width in page content, sidebar width
 * in a widget. Constrain it from the container, or with the shortcode's width
 * attribute, rather than capping it here.
 */
.suk-form {
	display: flex;
	gap: 6px;
	width: 100%;
	max-width: 100%;
}

.suk-form .suk-input {
	flex: 1 1 auto;
	min-width: 0;
}

.suk-form .suk-submit {
	flex: 0 0 auto;
}

@media ( max-width: 600px ) {
	.suk-panel {
		font-size: 13px;
	}

	.suk-thumb {
		flex-basis: 36px;
		width: 36px;
		height: 36px;
	}
}
