/**
 * PA Custom Features — Advanced Search
 * Default/structural styles. Color/typography/spacing/border/shadow
 * properties are also exposed as Elementor Style-tab controls
 * (class-srch-elementor-widget.php) bound via {{WRAPPER}} selectors.
 */

.srch-search-wrapper {
	position: relative;
	width: 100%;
	max-width: 420px;
}

.srch-search-wrapper,
.srch-search-wrapper *,
.srch-search-wrapper *::before,
.srch-search-wrapper *::after {
	box-sizing: border-box;
}

/* Structural resets only (never color/typography/border, which the
   Elementor Style tab controls via higher-specificity {{WRAPPER}} selectors
   — see class-srch-elementor-widget.php). Guards against theme global
   `button`/link styling (e.g. Astra's Customizer-driven rules). */
.srch-search-wrapper .srch-result-item,
.srch-search-wrapper .srch-result-item:visited,
.srch-search-wrapper .srch-result-item:hover {
	text-decoration: none !important;
	box-shadow: none;
}

.srch-search-wrapper button {
	box-shadow: none;
}

.srch-search-form {
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1px solid #dcdcdc;
	border-radius: 8px;
	padding: 8px 14px;
	background-color: #ffffff;
}

.srch-search-icon {
	display: inline-flex;
	color: #8a8a8a;
	flex: 0 0 auto;
}

.srch-search-input {
	flex: 1 1 auto;
	border: 0;
	outline: none;
	font-size: 14px;
	background: transparent;
	min-width: 0;
}

.srch-category-select {
	flex: 0 0 auto;
	border: 0;
	border-left: 1px solid #e2e2e2;
	padding-left: 8px;
	background: transparent;
	font-size: 13px;
	max-width: 130px;
}

.srch-results-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 6px;
	background-color: #ffffff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	max-height: 360px;
	overflow-y: auto;
	z-index: 100;
}

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

.srch-result-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 14px;
	text-decoration: none;
	color: #2c2c2c;
	cursor: pointer;
}

.srch-result-item:hover,
.srch-result-item.srch-active {
	background-color: #f5f5f5;
}

.srch-result-thumbnail {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 4px;
	object-fit: cover;
	background-color: #f0f0f0;
}

.srch-result-text {
	flex: 1 1 auto;
	min-width: 0;
}

.srch-result-title {
	display: block;
	font-size: 13px;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.srch-result-title mark {
	background-color: #ffe8a3;
	color: inherit;
	padding: 0;
}

.srch-result-price {
	display: block;
	font-size: 12px;
	color: #6b6b6b;
	margin-top: 2px;
}

.srch-empty-state,
.srch-loading-state {
	padding: 14px;
	font-size: 13px;
	color: #6b6b6b;
	text-align: center;
}

.srch-popular-keywords {
	padding: 8px 14px;
}

.srch-popular-keywords-label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #9a9a9a;
	margin-bottom: 6px;
}

.srch-popular-keyword {
	display: inline-block;
	margin: 0 6px 6px 0;
	padding: 4px 10px;
	border-radius: 999px;
	background-color: #f2f2f2;
	font-size: 12px;
	color: #3c3c3c;
	cursor: pointer;
	border: 0;
}

.srch-popular-keyword:hover {
	background-color: #e6e6e6;
}

.srch-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(0, 0, 0, 0.1);
	border-top-color: #ff6a2b;
	border-radius: 50%;
	animation: srch-spin 0.7s linear infinite;
	flex: 0 0 auto;
}

@keyframes srch-spin {
	to {
		transform: rotate(360deg);
	}
}

.srch-search-wrapper .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
