/*! Eynakchi Live Search v1.0.0 — RTL, uses theme tokens from eynakchi-theme/assets/css/tokens.css */
.els {
	--els-main: var(--eyn-main, #303f34);
	--els-accent: var(--eyn-accent, #c39052);
	--els-off: var(--eyn-off, #ff4242);
	--els-font: var(--eyn-font, "YekanBakhnum", Tahoma, sans-serif);
	--els-radius: var(--eyn-radius, 15px);
	--els-h: 50px;
	--els-mh: 42px;
	--els-field-bg: #f5f5f6;
	--els-text: #1f2421;
	--els-muted: #6b7280;
	--els-line: #ececef;
	--els-hover: #f7f4ef;
	position: relative;
	width: 100%;
	font-family: var(--els-font);
	color: var(--els-text);
	direction: rtl;
	text-align: right;
	box-sizing: border-box;
	line-height: 1.6;
}
.els *, .els *::before, .els *::after { box-sizing: border-box; }
.els-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.els .els-ico { width: 18px; height: 18px; flex: 0 0 auto; }
.els button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.els a { text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }

/* ---------- field ---------- */
.els-form {
	position: relative;
	display: flex;
	align-items: center;
	gap: 4px;
	height: var(--els-h);
	margin: 0;
	padding: 0 14px 0 6px;
	background: var(--els-field-bg);
	border: 1.5px solid transparent;
	border-radius: var(--els-radius);
	transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.els-form:focus-within,
.els.is-open .els-form {
	background: #fff;
	border-color: var(--els-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--els-accent) 16%, transparent);
}
.els-icon { display: inline-flex; color: var(--els-muted); }
.els-icon svg { width: 20px; height: 20px; }
.els .els-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0 8px;
	border: 0 !important;
	outline: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	font: 400 14px/1 var(--els-font);
	color: var(--els-text);
	-webkit-appearance: none;
	appearance: none;
}
.els .els-input::placeholder { color: #8a8f98; opacity: 1; }
.els .els-input::-webkit-search-cancel-button,
.els .els-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.els-clear {
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
	background: #e7e8eb; color: #4a515f; transition: background .15s;
}
.els-clear:hover { background: #dcdde1; }
.els-clear[hidden] { display: none; }
.els-submit {
	height: calc(var(--els-h) - 12px);
	padding: 0 18px; border: 0; border-radius: calc(var(--els-radius) - 4px);
	background: var(--els-main); color: #fff; font-weight: 600; font-size: 13px;
}
.els-submit:hover { filter: brightness(1.12); }
.els-back { display: none; }
.els-spinner {
	display: none; width: 18px; height: 18px; border-radius: 50%;
	border: 2px solid color-mix(in srgb, var(--els-accent) 25%, transparent);
	border-top-color: var(--els-accent);
	animation: els-spin .7s linear infinite;
}
.els.is-loading .els-spinner, .els-portal.is-loading .els-spinner { display: inline-block; }
@keyframes els-spin { to { transform: rotate(360deg); } }

/* ---------- mobile trigger (hidden on desktop) ---------- */
.els-mtrigger { display: none; }

/* ---------- dropdown (desktop) ---------- */
.els-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	left: 0;
	min-width: min(460px, 92vw);
	z-index: 10001;
	background: #fff;
	border-radius: var(--els-radius);
	box-shadow: 0 18px 50px -12px rgba(23, 31, 25, .28), 0 0 0 1px rgba(0, 0, 0, .04);
	overflow: hidden;
	animation: els-drop .18s ease-out;
}
.els-dropdown[hidden] { display: none; }
@keyframes els-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.els-body {
	max-height: min(72vh, 640px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 6px 0 0;
	scrollbar-width: thin;
}

/* sections */
.els-sec { padding: 10px 16px 6px; }
.els-sec + .els-sec { border-top: 1px solid var(--els-line); }
.els-sec__head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--els-muted); font-size: 12px; font-weight: 600; }
.els-sec__head .els-ico { width: 16px; height: 16px; }
.els-sec__title { flex: 1 1 auto; }
.els-linkbtn { border: 0; background: none; padding: 4px 6px; color: var(--els-off); font-size: 12px; }

/* option states */
.els .els-opt, .els .els-chip, .els .els-recent__q { outline: none; }
.els .is-active { box-shadow: inset 0 0 0 2px var(--els-accent); }

/* chips */
.els-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 6px; }
.els-chip {
	display: inline-flex; align-items: center; gap: 6px;
	min-height: 36px; padding: 6px 14px;
	border: 1px solid var(--els-line); border-radius: 999px; background: #fff;
	color: var(--els-text); font-size: 13px; transition: all .15s;
}
.els-chip:hover, .els-chip.is-active { border-color: var(--els-accent); color: var(--els-main); background: var(--els-hover); }

/* recent */
.els-recent { display: flex; flex-direction: column; }
.els-recent__row { display: flex; align-items: center; }
.els-recent__q {
	flex: 1 1 auto; display: flex; align-items: center; gap: 10px;
	min-height: 42px; padding: 6px 8px; border: 0; border-radius: 10px;
	background: none; color: var(--els-text); font-size: 14px; text-align: right;
}
.els-recent__q .els-ico { color: #a0a5ad; }
.els-recent__q:hover, .els-recent__q.is-active { background: var(--els-hover); }
.els-recent__x { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: #a0a5ad; }
.els-recent__x:hover { background: #f1f1f3; color: var(--els-off); }

/* featured categories */
.els-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-bottom: 8px; }
.els-cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; text-align: center; transition: background .15s; }
.els-cat:hover, .els-cat.is-active { background: var(--els-hover); }
.els-cat__img { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: #f4f1ec; color: var(--els-accent); overflow: hidden; }
.els-cat__img img { width: 100%; height: 100%; object-fit: cover; }
.els-cat__img .els-ico { width: 28px; height: 28px; }
.els-cat__name { font-size: 12px; line-height: 1.5; color: var(--els-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* term suggestions */
.els-terms { display: flex; flex-direction: column; gap: 2px; padding-bottom: 4px; }
.els-term { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 8px; border-radius: 10px; font-size: 14px; }
.els-term:hover, .els-term.is-active { background: var(--els-hover); }
.els-term__type { flex: 0 0 auto; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--els-accent) 14%, #fff); color: color-mix(in srgb, var(--els-accent) 75%, #000); font-size: 11px; font-weight: 600; }
.els-term__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.els-term__count { flex: 0 0 auto; color: var(--els-muted); font-size: 12px; }

/* products */
.els-products { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.els-prod { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; transition: background .15s; }
.els-prod:hover, .els-prod.is-active { background: var(--els-hover); }
.els-prod > .els-ico { color: #c4c7cc; transition: transform .15s, color .15s; }
.els-prod:hover > .els-ico, .els-prod.is-active > .els-ico { color: var(--els-accent); transform: translateX(-3px); }
.els-prod__img { position: relative; flex: 0 0 64px; width: 64px; height: 64px; border-radius: 12px; background: #f6f6f7; overflow: hidden; }
.els-prod__img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.els-prod__off { position: absolute; top: 4px; right: 4px; padding: 1px 6px; border-radius: 6px; background: var(--els-off); color: #fff; font-size: 10px; font-weight: 600; line-height: 1.6; }
.els-prod__info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.els-prod__brand { color: var(--els-accent); font-size: 11px; font-weight: 600; }
.els-prod__name { font-size: 13.5px; line-height: 1.7; color: var(--els-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.els-prod__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.els-prod__price { font-size: 13px; font-weight: 600; color: var(--els-main); }
.els-prod__price del { color: #9aa0a6; font-weight: 400; font-size: 11.5px; margin-left: 6px; }
.els-prod__price ins { text-decoration: none; color: var(--els-off); }
.els-prod__price .woocommerce-Price-currencySymbol { font-size: 11px; font-weight: 400; }
.els-prod__sku { color: #a0a5ad; font-size: 11px; direction: ltr; unicode-bidi: isolate; }
.els-prod__oos { color: #9aa0a6; font-weight: 400; font-size: 12px; }
.els-prod.is-oos .els-prod__img img { opacity: .55; filter: grayscale(.4); }
.els-hl { background: color-mix(in srgb, var(--els-accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* footer */
.els-foot { position: sticky; bottom: 0; padding: 10px 16px 12px; background: linear-gradient(to top, #fff 75%, rgba(255, 255, 255, 0)); }
.els-all {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; padding: 10px 16px; border-radius: 12px;
	background: var(--els-main); color: #fff !important; font-size: 14px; font-weight: 600;
	transition: filter .15s, transform .15s;
}
.els-all span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.els-all:hover { filter: brightness(1.15); }
.els-all.is-active { box-shadow: 0 0 0 3px var(--els-accent); }

/* empty / error */
.els-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 20px 14px; text-align: center; }
.els-empty .els-ico { width: 56px; height: 56px; color: var(--els-accent); opacity: .8; }
.els-empty__title { font-size: 14.5px; color: var(--els-text); }
.els-empty__hint { font-size: 12.5px; color: var(--els-muted); }

/* skeleton */
.els-skel { display: flex; align-items: center; gap: 12px; padding: 8px; }
.els-skel__img { flex: 0 0 64px; height: 64px; border-radius: 12px; }
.els-skel__lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.els-skel__l1 { height: 12px; width: 80%; border-radius: 6px; }
.els-skel__l2 { height: 10px; width: 40%; border-radius: 6px; }
.els-skel__img, .els-skel__l1, .els-skel__l2 { background: linear-gradient(90deg, #f1f1f3 25%, #e7e7ea 37%, #f1f1f3 63%); background-size: 400% 100%; animation: els-shimmer 1.3s ease infinite; }
@keyframes els-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- mobile ---------- */
@media (max-width: 767px) {
	.els > .els-panel { display: none; }
	.els-mtrigger {
		display: flex; align-items: center; gap: 8px;
		width: 100%; height: var(--els-mh); margin: 0; padding: 0 12px;
		border: 0; border-radius: calc(var(--els-radius) - 5px);
		background: var(--els-field-bg); color: #4a515f;
		font: 400 13px/1 var(--els-font); text-align: right;
	}
	.els-mtrigger svg { width: 19px; height: 19px; flex: 0 0 auto; }
	.els-mtrigger__text { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6b7280; }
	.els-mtrigger:active { background: #ebecef; }
	.els--m-icon .els-mtrigger { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; background: transparent; }
	.els--m-icon .els-mtrigger svg { width: 24px; height: 24px; }
	.els--m-icon .els-mtrigger__text { display: none; }

	/* Inside the eynakchi-theme header slot (absolute row under the logo). */
	#eyn-site-header .eyn-header-col--search .els { --els-mh: 36px; }
	#eyn-site-header .eyn-header-col--search:has(.els) { height: auto !important; }
}

/* Full-screen overlay (portalled to <body>). */
html.els-lock, html.els-lock body { overflow: hidden !important; touch-action: none; }
html.els-lock .els-portal { touch-action: auto; }
.els-portal {
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	background: #fff;
	opacity: 0;
	transform: translateY(24px);
	transition: opacity .24s ease, transform .26s cubic-bezier(.2, .8, .2, 1);
}
.els-portal.is-open { opacity: 1; transform: none; }
.els-portal > .els-panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.els-portal .els-form {
	flex: 0 0 auto;
	height: auto;
	margin: 0;
	padding: calc(10px + env(safe-area-inset-top)) 10px 10px 12px;
	border: 0;
	border-bottom: 1px solid var(--els-line);
	border-radius: 0;
	background: #fff !important;
	box-shadow: none !important;
	gap: 6px;
}
.els-portal .els-back {
	display: inline-flex; align-items: center; justify-content: center;
	flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
	background: none; color: var(--els-text);
}
.els-portal .els-back:active { background: #f1f1f3; }
.els-portal .els-icon { display: none; }
.els-portal .els-input {
	height: 46px;
	padding: 0 14px;
	border-radius: 12px !important;
	background: var(--els-field-bg) !important;
	font-size: 16px; /* ≥16px prevents iOS zoom */
}
.els-portal .els-input:focus { box-shadow: 0 0 0 2px var(--els-accent) !important; background: #fff !important; }
.els-portal .els-input { padding-left: 48px; }
.els-portal .els-clear { position: absolute; left: 20px; bottom: 18px; width: 30px; height: 30px; }
.els-portal .els-spinner { position: absolute; left: 26px; bottom: 24px; }
.els-portal.is-loading .els-clear { display: none; }
.els-portal .els-submit { display: none; }
.els-portal .els-dropdown {
	position: static;
	flex: 1 1 auto;
	min-height: 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	border-radius: 0;
	box-shadow: none;
	animation: none;
}
.els-portal .els-dropdown[hidden] { display: flex; }
.els-portal .els-body { flex: 1 1 auto; max-height: none; padding-bottom: env(safe-area-inset-bottom); -webkit-overflow-scrolling: touch; }
.els-portal .els-sec { padding: 14px 16px 8px; }
.els-portal .els-chip { min-height: 40px; font-size: 14px; }
.els-portal .els-recent__q, .els-portal .els-term { min-height: 48px; font-size: 15px; }
.els-portal .els-prod { padding: 10px 6px; }
.els-portal .els-prod__img { flex-basis: 72px; width: 72px; height: 72px; }
.els-portal .els-prod__name { font-size: 14px; }
.els-portal .els-cats { grid-template-columns: repeat(4, 1fr); }
.els-portal .els-foot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
.els-portal .els-all { min-height: 50px; font-size: 15px; }
.els-portal .is-active { box-shadow: none; background: var(--els-hover); }
@media (max-width: 360px) { .els-portal .els-cats { grid-template-columns: repeat(3, 1fr); } }

@media (prefers-reduced-motion: reduce) {
	.els-portal, .els-dropdown, .els-prod > .els-ico { transition: none !important; animation: none !important; }
	.els-skel__img, .els-skel__l1, .els-skel__l2, .els-spinner { animation-duration: 2.5s; }
}
