/* =============================================
 * Custom Search Widget
 * ============================================= */

.cs-search-widget {
	width: 100%;
}

/* =============================================
 * Search Input Wrap
 * ============================================= */
.cs-search-wrap {
	position: relative;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	background: #fff;
	border-radius: 50px;
	overflow: visible;
	margin-left: auto;
	margin-right: auto;
}

.cs-search-input {
	flex: 1;
	min-width: 0;
	padding: 0;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	font-size: 14px;
	background: transparent;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}

.cs-search-input::placeholder {
	transition: color 0.2s ease;
}

/* =============================================
 * Search Button
 * ============================================= */
.cs-search-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border: none;
	cursor: pointer;
	transition: background-color 0.2s ease, opacity 0.2s ease;
	line-height: 1;
	white-space: nowrap;
}

.cs-search-btn:hover {
	opacity: 0.85;
}

.cs-search-btn i,
.cs-search-btn svg {
	display: block;
	flex-shrink: 0;
}

.cs-btn-text {
	white-space: nowrap;
}

/* =============================================
 * Results Dropdown
 * ============================================= */
.cs-results-dropdown {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	width: 100%;
	box-sizing: border-box;
	margin-top: 4px;
	border-radius: 6px;
	z-index: 1000;
	max-height: 400px;
	overflow-y: auto;
	overflow-x: hidden;
	border: 1px solid #e5e5e5;
}

.cs-results-dropdown.active {
	display: block;
}

/* --- Loading --- */
.cs-results-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	color: #999;
	font-size: 13px;
	gap: 8px;
}

.cs-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid #e5e5e5;
	border-top-color: #F57B20;
	border-radius: 50%;
	animation: csSpinner 0.6s linear infinite;
}

@keyframes csSpinner {
	to { transform: rotate(360deg); }
}

/* --- Result Item --- */
.cs-result-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	text-decoration: none;
	border-bottom: 1px solid #f0f0f0;
	transition: background-color 0.15s ease;
}

.cs-result-item:last-child {
	border-bottom: none;
}

.cs-result-thumb {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 4px;
	overflow: hidden;
	background: #f5f5f5;
}

.cs-result-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cs-result-info {
	flex: 1;
	min-width: 0;
}

.cs-result-title {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0;
}

.cs-result-price {
	font-size: 13px;
	font-weight: 600;
	margin-top: 2px;
}

/* --- Highlight --- */
.cs-highlight {
	background: rgba(245, 123, 32, 0.15);
	border-radius: 2px;
	padding: 0 1px;
}

/* --- No result --- */
.cs-no-result {
	padding: 20px;
	text-align: center;
	color: #999;
	font-size: 13px;
}

/* --- View all link --- */
.cs-view-all {
	display: block;
	text-align: center;
	padding: 12px;
	font-size: 13px;
	color: #F57B20;
	text-decoration: none;
	border-top: 1px solid #f0f0f0;
	transition: background-color 0.15s ease;
}

.cs-view-all:hover {
	background-color: #f7f7f7;
}

/* =============================================
 * Scrollbar
 * ============================================= */
.cs-results-dropdown::-webkit-scrollbar {
	width: 6px;
}

.cs-results-dropdown::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 3px;
}

.cs-results-dropdown::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 3px;
}

.cs-results-dropdown::-webkit-scrollbar-thumb:hover {
	background: #a1a1a1;
}
