.atlasblog-search-widget {
	position: relative;
	display: inline-block;
	width: var(--atlasblog-search-width, 270px);
	max-width: 100%;
	direction: rtl;
	transition: width 0.35s ease;
}

.atlasblog-search-widget[data-expand-on-focus='1'].is-expanded,
.atlasblog-search-widget[data-expand-on-focus='1']:focus-within {
	width: min(
		calc(var(--atlasblog-search-width, 270px) + var(--atlasblog-search-expand, 90px)),
		100%
	);
}

.atlasblog-search-widget__form {
	position: relative;
	display: flex;
	align-items: center;
	width: 100% !important;
	max-width: 100%;
	min-height: 58px;
	padding: 5px 0 5px 62px;
	border: 0 !important;
	outline: 0 !important;
	border-radius: 999px;
	background: #fff;
	box-shadow: none !important;
	direction: rtl;
	overflow: hidden;
}

.atlasblog-search-widget__form:focus-within {
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
}

.atlasblog-search-widget__input {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0 !important;
	outline: 0 !important;
	background: transparent;
	box-shadow: none !important;
	color: #8d8d8d;
	font: inherit;
	line-height: 1.4;
	text-align: right;
}

.atlasblog-search-widget__input:focus {
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
}

.atlasblog-search-widget__input::placeholder {
	color: #8d8d8d;
	opacity: 1;
}

.atlasblog-search-widget__input::-webkit-search-decoration,
.atlasblog-search-widget__input::-webkit-search-cancel-button {
	display: none;
}

.atlasblog-search-widget__button {
	position: absolute;
	top: 50%;
	left: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #253583;
	color: #fff;
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity 0.2s ease;
}

.atlasblog-search-widget__button:hover,
.atlasblog-search-widget__button:focus {
	opacity: 0.9;
}

.atlasblog-search-widget__icon {
	display: block;
	width: 20px;
	height: 20px;
	font-size: 20px;
	line-height: 1;
	object-fit: contain;
}

.atlasblog-search-widget__icon svg {
	display: block;
	width: 1em;
	height: 1em;
	fill: currentColor;
}

@media (prefers-reduced-motion: reduce) {
	.atlasblog-search-widget {
		transition: none;
	}
}

.atlasblog-search-widget__suggestions {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	left: 0;
	z-index: 30;
	overflow: hidden;
	border-radius: 14px;
	background: #ffffff;
	box-shadow: 0 12px 32px rgba(30, 41, 59, 0.14);
}

.atlasblog-search-widget__suggestions.is-loading {
	opacity: 0.7;
}

.atlasblog-search-widget__suggestions-list {
	margin: 0;
	padding: 8px;
	list-style: none;
}

.atlasblog-search-widget__suggestion-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	color: #15223d;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.atlasblog-search-widget__suggestion-thumb {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 8px;
	background-color: #dde2ec;
	background-position: center;
	background-size: cover;
}

.atlasblog-search-widget__suggestion-thumb.is-empty {
	background-image: linear-gradient(135deg, #e8edf5 0%, #d5ddea 100%);
}

.atlasblog-search-widget__suggestion-title {
	display: -webkit-box;
	overflow: hidden;
	line-height: 1.6;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.atlasblog-search-widget__suggestions-empty {
	padding: 14px 16px;
	text-align: center;
}

/* Mobile trigger button */
.atlasblog-search-widget__mobile-trigger {
	display: none;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #253583;
	color: #fff;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.atlasblog-search-widget__mobile-trigger:hover,
.atlasblog-search-widget__mobile-trigger:focus {
	opacity: 0.9;
}

/* Mobile popup overlay */
.atlasblog-search-widget__mobile-overlay {
	position: fixed;
	inset: 0;
	z-index: 999997;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 16px;
	padding-top: max(16px, env(safe-area-inset-top, 0px));
}

.atlasblog-search-widget__mobile-overlay[hidden] {
	display: none !important;
}

.atlasblog-search-widget__mobile-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
}

.atlasblog-search-widget__mobile-panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 480px;
	padding: 48px 16px 16px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
	direction: rtl;
}

.atlasblog-search-widget__mobile-close {
	position: absolute;
	top: 12px;
	left: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f4f6fa;
	color: #15223d;
	cursor: pointer;
}

.atlasblog-search-widget__mobile-close svg {
	width: 18px;
	height: 18px;
}

.atlasblog-search-widget__mobile-panel .atlasblog-search-widget__suggestions {
	position: static;
	margin-top: 8px;
	box-shadow: none;
}

html.atlasblog-search-popup-open {
	overflow: hidden;
}

@media (min-width: 1025px) {
	.atlasblog-search-widget--hide-on-desktop .atlasblog-search-widget__inline {
		display: none !important;
	}

	.elementor-editor-active .atlasblog-search-widget--hide-on-desktop .atlasblog-search-widget__inline,
	.atlasblog-search-widget--editor.atlasblog-search-widget--hide-on-desktop .atlasblog-search-widget__inline {
		display: block !important;
	}

	.elementor-editor-active .atlasblog-search-widget--hide-on-desktop.atlasblog-search-widget--mobile-popup .atlasblog-search-widget__mobile-trigger,
	.atlasblog-search-widget--editor.atlasblog-search-widget--hide-on-desktop.atlasblog-search-widget--mobile-popup .atlasblog-search-widget__mobile-trigger {
		display: none !important;
	}
}

@media (max-width: 1024px) {
	.atlasblog-search-widget--hide-on-mobile {
		display: none !important;
	}

	.atlasblog-search-widget--mobile-popup:not(.atlasblog-search-widget--editor) {
		width: auto;
	}

	.atlasblog-search-widget--mobile-popup:not(.atlasblog-search-widget--editor) .atlasblog-search-widget__mobile-trigger {
		display: inline-flex;
	}

	.atlasblog-search-widget--mobile-popup:not(.atlasblog-search-widget--editor) .atlasblog-search-widget__inline {
		display: none;
	}
}

@media (max-width: 1024px) {
	.atlasblog-search-widget--editor.atlasblog-search-widget--mobile-popup {
		width: auto;
	}

	.atlasblog-search-widget--editor.atlasblog-search-widget--mobile-popup .atlasblog-search-widget__mobile-trigger {
		display: inline-flex;
	}

	.atlasblog-search-widget--editor.atlasblog-search-widget--mobile-popup .atlasblog-search-widget__inline {
		display: none;
	}

	.atlasblog-search-widget--editor.atlasblog-search-widget--hide-on-mobile:not(.atlasblog-search-widget--mobile-popup) .atlasblog-search-widget__inline {
		display: block;
	}
}
