/**
 * Woo Quick Search - front-end styles.
 * Deliberately low-specificity so themes can override without !important.
 */

.wqs-root {
	--wqs-accent: #2271b1;
	position: relative;
	display: block;
	width: 100%;
}

.wqs-form {
	display: flex;
	align-items: stretch;
	gap: 0;
	width: 100%;
}

.wqs-input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.65em 0.9em;
	border: 1px solid rgba( 0, 0, 0, 0.18 );
	border-radius: 4px 0 0 4px;
	font: inherit;
	line-height: 1.4;
}

.wqs-input:focus {
	outline: 2px solid var( --wqs-accent );
	outline-offset: -1px;
}

.wqs-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 0.9em;
	border: 1px solid var( --wqs-accent );
	border-radius: 0 4px 4px 0;
	background: var( --wqs-accent );
	color: #fff;
	cursor: pointer;
}

/* ---------- dropdown panel ---------- */

.wqs-panel {
	--wqs-accent: #2271b1;
	position: fixed;
	z-index: 99999;
	max-height: 70vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 6px;
	box-shadow: 0 12px 32px rgba( 0, 0, 0, 0.16 );
	font-size: 14px;
	color: #1d2327;
}

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

.wqs-panel__message,
.wqs-panel__suggestion {
	padding: 12px 14px;
	color: #50575e;
}

.wqs-panel__suggestion {
	border-bottom: 1px solid rgba( 0, 0, 0, 0.08 );
	background: #f6f7f7;
}

.wqs-panel__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wqs-panel__item + .wqs-panel__item {
	border-top: 1px solid rgba( 0, 0, 0, 0.06 );
}

.wqs-panel__item.is-active,
.wqs-panel__item:hover {
	background: rgba( 34, 113, 177, 0.07 );
}

.wqs-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	text-decoration: none;
	color: inherit;
}

.wqs-item__media img {
	display: block;
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 4px;
	background: #f0f0f1;
}

.wqs-item__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	flex: 1 1 auto;
}

.wqs-item__title {
	font-weight: 600;
	line-height: 1.3;
}

.wqs-item__title mark {
	background: rgba( 255, 214, 0, 0.45 );
	color: inherit;
	padding: 0 1px;
}

.wqs-item__sku,
.wqs-item__excerpt {
	font-size: 12px;
	color: #646970;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wqs-item__price {
	flex: 0 0 auto;
	font-weight: 600;
	white-space: nowrap;
}

.wqs-item__price del {
	opacity: 0.6;
	font-weight: 400;
	margin-right: 4px;
}

.wqs-panel__all {
	display: block;
	padding: 11px 14px;
	text-align: center;
	font-weight: 600;
	text-decoration: none;
	color: var( --wqs-accent );
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	background: #fafafa;
}

/* ---------- results page ---------- */

.wqs-results__meta {
	margin: 0 0 0.5em;
	font-weight: 600;
}

.wqs-results__suggestion,
.wqs-results__empty {
	margin: 0 0 1.2em;
	color: #50575e;
}

.wqs-grid {
	display: grid;
	gap: 20px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
	grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
}

.wqs-grid--2 { grid-template-columns: repeat( auto-fill, minmax( 320px, 1fr ) ); }
.wqs-grid--4 { grid-template-columns: repeat( auto-fill, minmax( 180px, 1fr ) ); }
.wqs-grid--5,
.wqs-grid--6 { grid-template-columns: repeat( auto-fill, minmax( 150px, 1fr ) ); }

.wqs-card-product {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.wqs-card-product__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 6px;
	background: #f0f0f1;
}

.wqs-card-product__title {
	font-weight: 600;
	line-height: 1.35;
}

.wqs-card-product__sku,
.wqs-card-product__excerpt {
	font-size: 13px;
	color: #646970;
}

.wqs-card-product__price {
	font-weight: 600;
}

.wqs-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wqs-pagination .page-numbers {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid rgba( 0, 0, 0, 0.14 );
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
}

.wqs-pagination .page-numbers.current {
	background: var( --wqs-accent, #2271b1 );
	border-color: var( --wqs-accent, #2271b1 );
	color: #fff;
}

.wqs-loadmore {
	display: block;
	margin: 0 auto 24px;
	padding: 10px 24px;
	border: 1px solid rgba( 0, 0, 0, 0.16 );
	border-radius: 4px;
	background: #fff;
	font: inherit;
	cursor: pointer;
}

.wqs-loadmore[disabled] {
	opacity: 0.6;
	cursor: default;
}

/*
 * Colours (panel background, link, hover, description, price, highlight) are
 * emitted as inline CSS from the plugin settings - see WQS_Frontend::inline_css().
 * Nothing here hardcodes a dark theme any more: a visitor browsing in dark mode
 * no longer gets a dark dropdown on a light shop unless the shop owner asks for
 * it in Quick Search > Settings > Appearance.
 */
