/* QPS Product Search: results-page note and discontinued label. */
.qps-note {
	margin: 0 0 1em;
	padding: 0.6em 0.9em;
	background: #fff8e5;
	border-left: 4px solid #dba617;
}

.qps-discontinued {
	margin: 0.3em 0 0;
	font-size: 0.85em;
	line-height: 1.4;
}

.qps-badge {
	display: inline-block;
	padding: 0.1em 0.45em;
	border-radius: 3px;
	background: #6c7781;
	color: #fff;
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

/*
 * Header search box (Task 16, operator-approved design). The form is the visible white pill: magnifier
 * drawn inside on the left (decoration), the box, and a clear button the script adds. The drop-down hangs
 * 10px under the pill at exactly its width. Header layout (rows, padding) lives in the child theme.
 */
.qps-search-form {
	position: relative;
	display: flex;
	gap: 6px;
	align-items: center;
	box-sizing: border-box;
	height: 48px;
	margin: 0;
	padding: 0 6px 0 48px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2301236D' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E") no-repeat 18px center / 20px 20px;
	border-radius: 24px;
}

.qps-search-form:focus-within {
	box-shadow: 0 0 0 3px #109cf6;
}

.qps-search-form input[type="search"].site-search-box,
.qps-search-form input[type="search"].site-search-box:focus {
	flex: 1;
	width: auto;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	outline: none;
	background: transparent;
	box-shadow: none;
	color: #01236d;
	font: 500 16px/1.2 Montserrat, sans-serif;
	-webkit-appearance: none;
	appearance: none;
}

.qps-search-form input[type="search"].site-search-box::placeholder {
	color: #6b7280;
	opacity: 1;
}

.qps-search-form input[type="search"].site-search-box::-webkit-search-cancel-button {
	display: none;
}

.qps-clear {
	flex: none;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 18px;
	background: #eef1f7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2301236D' stroke-width='2.4'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") no-repeat center / 16px 16px;
	cursor: pointer;
}

.qps-clear:hover,
.qps-clear:focus {
	background-color: #dde3ee;
}

.qps-clear[hidden] {
	display: none;
}

/* Drop-down (Task 7, restyled in Task 16). */
.qps-anchor {
	position: relative;
}

.qps-dropdown {
	position: absolute;
	z-index: 9999;
	top: calc(100% + 10px);
	left: 0;
	right: 0;
	box-sizing: border-box;
	max-height: 70vh;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
	text-align: left;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 12px 32px rgba(1, 35, 109, 0.22);
	color: #01236d;
	font-family: Montserrat, sans-serif;
	container-type: inline-size;
}

.qps-dropdown[hidden] {
	display: none;
}

.qps-dropdown li {
	margin: 0;
}

.qps-heading {
	padding: 16px 24px 8px;
	color: #4b5563;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.6px;
	text-transform: uppercase;
}

.qps-item a {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 14px 24px;
	color: #01236d;
	text-decoration: none;
}

.qps-item img {
	flex: none;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	border: 1px solid #dde3ee;
	border-radius: 6px;
	background: #f7f9fc;
	object-fit: contain;
}

.qps-item[aria-selected="true"],
.qps-item:hover,
.qps-all[aria-selected="true"],
.qps-all:hover {
	background: #eef6fe;
}

.qps-text {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.qps-sku {
	font-size: 15px;
	font-weight: 700;
}

.qps-name {
	overflow: hidden;
	color: #374151;
	font-size: 13px;
	line-height: 1.35;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.qps-disc {
	align-self: flex-start;
	margin-top: 0.15em;
	padding: 0 0.4em;
	border-radius: 3px;
	background: #6c7781;
	color: #fff;
	font-size: 0.7em;
	font-weight: 600;
	text-transform: uppercase;
}

.qps-repl {
	font-size: 0.8em;
}

.qps-label,
.qps-empty {
	padding: 8px 24px;
	color: #4b5563;
	font-size: 13px;
}

.qps-empty {
	padding: 16px 24px;
}

.qps-label {
	font-weight: 600;
}

.qps-all {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	border-top: 1px solid #e6e9f0;
	background: #f7f9fc;
	cursor: pointer;
}

.qps-all a {
	color: #005fe4;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.qps-hint {
	color: #4b5563;
	font-size: 12px;
	white-space: nowrap;
}

/* The keyboard hint only where it fits (desktop, wide box). */
@container (max-width: 539px) {
	.qps-hint {
		display: none;
	}
}

.qps-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.qps-backdrop {
	display: none;
}

@media (max-width: 1024px) {
	.qps-hint {
		display: none;
	}
}

/* Phone: slightly smaller pill, tighter rows, short footer, and the page dimmed under the open list. */
@media (max-width: 767px) {
	.qps-search-form {
		height: 46px;
		padding-left: 44px;
		background-position: 16px center;
		background-size: 18px 18px;
		border-radius: 23px;
	}

	.qps-clear {
		width: 34px;
		height: 34px;
		border-radius: 17px;
		background-size: 14px 14px;
	}

	.qps-dropdown {
		border-radius: 12px;
		box-shadow: 0 10px 28px rgba(1, 35, 109, 0.25);
	}

	.qps-heading,
	.qps-for {
		display: none;
	}

	.qps-item a {
		gap: 12px;
		padding: 14px 18px;
	}

	.qps-item {
		border-bottom: 1px solid #f0f2f7;
	}

	.qps-item img {
		width: 40px;
		height: 40px;
	}

	.qps-name {
		display: -webkit-box;
		white-space: normal;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}

	.qps-all {
		justify-content: center;
		padding: 16px 18px;
		border-top: 0;
	}

	.qps-all a {
		font-size: 15px;
	}

	.qps-backdrop:not([hidden]) {
		position: absolute;
		z-index: 9;
		left: 0;
		right: 0;
		display: block;
		background: rgba(1, 35, 109, 0.35);
	}
}
