/**
 * MrLMS — Elementor widgets.
 *
 * Shared, theme-agnostic styles for every MrLMS Elementor widget. All rules
 * are scoped under a plugin class (or two) so theme/Elementor defaults never
 * leak in.
 */

.mrlms-ews.mrlms-ews {
	--mrlms-eor-brand: #7c3aed;
	--mrlms-eor-brand-soft: #ede9fe;
	--mrlms-eor-border: #e7e2f5;
	--mrlms-eor-text: #1e1b2e;
	--mrlms-eor-muted: #6f6a85;

	position: relative;
	width: 480px;
	max-width: 100%;
	direction: rtl;
	text-align: start;
	font-family: "Vazirmatn", Vazir, IRANSans, "Segoe UI", system-ui, -apple-system, sans-serif;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.7;
	color: var(--mrlms-eor-text);
}

.mrlms-ews.mrlms-ews *,
.mrlms-ews.mrlms-ews *::before,
.mrlms-ews.mrlms-ews *::after {
	box-sizing: border-box;
}

.mrlms-ews .mrlms-ews__label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.mrlms-ews .mrlms-ews__field {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 52px;
	background-color: #ffffff;
	border: 1px solid var(--mrlms-eor-border);
	border-radius: 14px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mrlms-ews .mrlms-ews__field:focus-within {
	border-color: var(--mrlms-eor-brand);
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
}

.mrlms-ews .mrlms-ews__icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--mrlms-eor-brand);
	pointer-events: none;
}

.mrlms-ews .mrlms-ews__icon svg {
	display: block;
	width: 20px;
	height: 20px;
}

.mrlms-ews .mrlms-ews__input {
	width: 100%;
	min-height: inherit;
	padding: 10px 16px 10px 52px;
	border: 0;
	border-radius: inherit;
	background-color: transparent;
	font: inherit;
	color: var(--mrlms-eor-text);
	text-align: start;
	appearance: none;
	-webkit-appearance: none;
	outline: none;
}

.mrlms-ews .mrlms-ews__input::placeholder {
	color: var(--mrlms-eor-muted);
	opacity: 1;
}

.mrlms-ews .mrlms-ews__input::-webkit-search-cancel-button,
.mrlms-ews .mrlms-ews__input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.mrlms-ews .mrlms-ews__input:focus-visible {
	outline: none;
}

.mrlms-ews .mrlms-ews__spinner {
	position: absolute;
	right: 16px;
	top: 50%;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border: 2px solid var(--mrlms-eor-border);
	border-top-color: var(--mrlms-eor-brand);
	border-radius: 50%;
	animation: mrlms-ews-spin 0.7s linear infinite;
}

.mrlms-ews .mrlms-ews__results {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 30;
	max-height: 340px;
	overflow-y: auto;
	background-color: #ffffff;
	border: 1px solid var(--mrlms-eor-border);
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba(30, 27, 46, 0.14);
	padding: 6px;
}

.mrlms-ews .mrlms-ews__results[hidden] {
	display: none;
}

.mrlms-ews .mrlms-ews__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
	transition: background-color 0.12s ease;
}

.mrlms-ews .mrlms-ews__item:hover,
.mrlms-ews .mrlms-ews__item.is-active {
	background-color: var(--mrlms-eor-brand-soft);
}

.mrlms-ews .mrlms-ews__item:focus-visible {
	outline: 2px solid var(--mrlms-eor-brand);
	outline-offset: -2px;
}

.mrlms-ews .mrlms-ews__thumb {
	flex-shrink: 0;
	width: 52px;
	height: 40px;
	border-radius: 8px;
	overflow: hidden;
	background-color: var(--mrlms-eor-brand-soft);
}

.mrlms-ews .mrlms-ews__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mrlms-ews .mrlms-ews__thumb.is-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--mrlms-eor-brand);
}

.mrlms-ews .mrlms-ews__thumb.is-fallback svg {
	width: 20px;
	height: 20px;
}

.mrlms-ews .mrlms-ews__item-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.6;
	color: var(--mrlms-eor-text);
}

.mrlms-ews .mrlms-ews__message {
	margin: 0;
	padding: 12px 14px;
	font-size: 13px;
	color: var(--mrlms-eor-muted);
	text-align: center;
}

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

@media (prefers-reduced-motion: reduce) {
	.mrlms-ews .mrlms-ews__field,
	.mrlms-ews .mrlms-ews__item {
		transition: none;
	}

	.mrlms-ews .mrlms-ews__spinner {
		animation-duration: 1.6s;
	}
}
