/* Advanced Search Container */
.sawi-search-wrapper {
	position: relative;
	display: flex;
	justify-content: flex-end; /* Ensures it expands to the left */
}

.sawi-search-container {
	display: flex;
	align-items: center;
	width: 50px; /* Initially just the width of the button */
	height: 50px;
	border-radius: 50px; /* Pill shape */
	background-color: #1a1a1a; /* Background for input */
	overflow: hidden;
	transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
	position: relative;
	z-index: 10;
}

/* When active, Elementor inline styles will override the width to expanded_width */
.sawi-search-wrapper.is-active .sawi-search-container {
	/* width: 300px; - Overridden by Elementor */
}

.sawi-search-input {
	flex-grow: 1;
	width: 0 !important;
	height: 100%;
	border: none !important;
	background: transparent !important;
	color: #fff;
	padding: 0 !important;
	margin: 0 !important;
	min-width: 0 !important;
	opacity: 0;
	transition: opacity 0.3s ease;
	outline: none !important;
	box-shadow: none !important;
	pointer-events: none;
	font-size: 16px;
}

.sawi-search-wrapper.is-active .sawi-search-input {
	width: 100% !important;
	padding: 0 0 0 20px !important; /* Fallback padding when active */
	opacity: 1;
	pointer-events: auto;
}

.sawi-search-btn {
	width: 50px;
	height: 50px;
	border-radius: 50% !important; /* Always perfectly round */
	background-color: #ffa500;
	color: #fff;
	border: none !important;
	flex-shrink: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.3s ease;
	outline: none !important;
	padding: 0;
	z-index: 2;
}

.sawi-search-btn i {
	font-size: 18px;
}

.sawi-search-btn svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.sawi-search-btn:hover {
	opacity: 0.9;
}

/* Dropdown */
.sawi-search-results-dropdown {
	position: absolute;
	top: calc(100% + 15px);
	right: 0;
	width: 100%;
	min-width: 450px;
	background-color: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 50px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
	z-index: 999;
	max-height: 500px;
	overflow-y: auto;
	padding: 10px;
}

.sawi-search-wrapper.is-active .sawi-search-results-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.sawi-search-group {
	margin-bottom: 10px;
}

.sawi-search-group:last-child {
	margin-bottom: 0;
}

.sawi-search-group-title {
	margin: 10px 15px 5px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #FF6B00;
	border-bottom: 1px solid #f0f0f0;
	padding-bottom: 8px;
}

.sawi-search-results-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sawi-search-result-item {
	border-bottom: 1px solid #f5f5f5;
	border-radius: 8px;
	transition: all 0.2s ease;
}

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

.sawi-search-result-link {
	display: flex;
	padding: 12px 15px;
	text-decoration: none;
	color: inherit;
	align-items: center;
	border-radius: 8px;
	transition: all 0.3s ease;
}

.sawi-search-result-link:hover {
	background-color: #f8f9fa;
	transform: translateX(4px);
}

.sawi-search-result-thumb {
	width: 50px;
	height: 50px;
	flex-shrink: 0;
	margin-right: 15px;
	border-radius: 4px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #eee;
}

.sawi-search-result-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sawi-search-result-content {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow: hidden;
}

.sawi-search-result-title {
	margin: 0 0 6px 0 !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	color: #333 !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sawi-search-result-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
}

.sawi-badge {
	padding: 4px 8px !important;
	border-radius: 4px !important;
	font-size: 10px !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	line-height: 1 !important;
	display: inline-block !important;
}

.sawi-badge-product {
	background-color: #96588a;
	color: #fff;
}

.sawi-badge-post {
	background-color: #0073aa;
	color: #fff;
}

.sawi-product-price {
	font-weight: bold;
	color: #333;
}

.sawi-search-no-results {
	padding: 20px;
	text-align: center;
	color: #777;
}

/* Loader */
.sawi-search-loader {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 30px;
}

.sawi-spinner {
	animation: rotate 2s linear infinite;
	z-index: 2;
	width: 40px;
	height: 40px;
}

.sawi-spinner .path {
	stroke: #ffa500;
	stroke-linecap: round;
	animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
	100% { transform: rotate(360deg); }
}

@keyframes dash {
	0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
	50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
	100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}
