/* =========================================================================
   Onpy Product Search — Autocomplete Widget
   ========================================================================= */

.onpy-search {
	position: relative;
	width: 100%;
	max-width: 700px;
	margin: 0 auto;
}

/* ── Form / Input row ─────────────────────────────────────────────────── */

.onpy-search__form {
	display: flex;
	align-items: stretch;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.onpy-search__form:focus-within {
	border-color: #FFD700;
	box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.25);
}

.onpy-search__input {
	flex: 1;
	border: none !important;
	outline: none !important;
	padding: 0 18px !important;
	height: 50px;
	font-family: 'Open Sans', sans-serif;
	font-size: 14px;
	color: #333;
	background: transparent !important;
	box-shadow: none !important;
	margin: 0 !important;
}

.onpy-search__input::placeholder {
	color: #999;
}

/* ── Search button ────────────────────────────────────────────────────── */

.onpy-search__button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	min-width: 52px;
	border: none;
	background: #FFD700;
	cursor: pointer;
	transition: background 0.2s;
	padding: 0;
}

.onpy-search__button:hover {
	background: #FFC600;
}

.onpy-search__button svg {
	fill: #000;
	width: 20px;
	height: 20px;
}

/* ── Results dropdown ─────────────────────────────────────────────────── */

.onpy-search__results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 9999;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-top: none;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.15);
	max-height: 420px;
	overflow-y: auto;
}

/* Scrollbar */
.onpy-search__results::-webkit-scrollbar {
	width: 6px;
}

.onpy-search__results::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 3px;
}

/* ── Result item ──────────────────────────────────────────────────────── */

.onpy-search__result-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 16px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.15s;
}

.onpy-search__result-item:last-child {
	border-bottom: none;
}

.onpy-search__result-item:hover {
	background: #f5f5f5;
}

/* Image */
.onpy-search__result-image {
	flex-shrink: 0;
}

.onpy-search__result-image img {
	width: 50px;
	height: 50px;
	object-fit: contain;
	border-radius: 4px;
	background: #fafafa;
}

/* Text block */
.onpy-search__result-info {
	flex: 1;
	min-width: 0;
}

.onpy-search__result-title {
	font-family: 'Open Sans', sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: #333;
	line-height: 1.3;
	margin: 0 0 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.onpy-search__result-category {
	font-size: 11px;
	color: #999;
	margin: 0;
}

.onpy-search__result-price {
	flex-shrink: 0;
	font-family: 'Open Sans', sans-serif;
	font-size: 13px;
	font-weight: 700;
	color: #000;
	white-space: nowrap;
}

/* ── Loading spinner ──────────────────────────────────────────────────── */

.onpy-search__loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.onpy-search__spinner {
	width: 24px;
	height: 24px;
	border: 3px solid #eee;
	border-top-color: #FFD700;
	border-radius: 50%;
	animation: onpy-spin 0.6s linear infinite;
}

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

/* ── No results ───────────────────────────────────────────────────────── */

.onpy-search__no-results {
	padding: 20px 16px;
	text-align: center;
	font-family: 'Open Sans', sans-serif;
	font-size: 13px;
	color: #999;
}

/* ── View all link ────────────────────────────────────────────────────── */

.onpy-search__view-all {
	display: block;
	text-align: center;
	padding: 12px 16px;
	font-family: 'Open Sans', sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: #000;
	text-decoration: none;
	border-top: 1px solid #eee;
	transition: background 0.15s;
}

.onpy-search__view-all:hover {
	background: #f5f5f5;
}

/* ── Highlight match ──────────────────────────────────────────────────── */

.onpy-search__highlight {
	background: rgba(255, 215, 0, 0.3);
	border-radius: 2px;
	padding: 0 1px;
}
