/* Live product search (efb/product-search, [efb_search], theme header). */
.efb-search { position: relative; display: flex; width: 100%; max-width: 520px; }
.efb-search__input {
	flex: 1;
	min-width: 0;
	height: 42px;
	padding: 0 14px;
	border: 1px solid var(--efb-brand-light, #81c784);
	border-radius: 4px;
	background: #fff;
	font: inherit;
	color: #333;
}
.efb-search__input:focus { outline: 2px solid var(--efb-brand-light, #81c784); border-color: var(--efb-brand, #228b22); }
.efb-search__submit + .efb-search__results,
.efb-search__submit { margin: 0; }
.efb-search__submit {
	height: 42px;
	margin-left: 6px;
	padding: 0 16px;
	border: 0;
	border-radius: 4px;
	background: var(--efb-brand, #228b22);
	color: #fff;
	font-family: var(--efb-font-head, inherit);
	cursor: pointer;
}
.efb-search__submit:hover { background: var(--efb-brand-dark, #1b6f1b); }
.efb-search.is-loading .efb-search__input {
	background-image: linear-gradient(90deg, transparent, rgba(34, 139, 34, .12), transparent);
	background-size: 200% 100%;
	animation: efb-search-loading 1s linear infinite;
}
@keyframes efb-search-loading { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* —— Results panel: rounded card, light shadow, opens with a short fade —— */
.efb-search__results {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	min-width: 320px;
	max-height: 75vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #e3ebe3;
	border-radius: 14px;
	box-shadow: 0 18px 40px -14px rgba(16, 60, 30, .28), 0 2px 6px rgba(16, 60, 30, .06);
	z-index: 1000;
	text-align: left;
	animation: efb-search-in .16s ease-out;
}
@keyframes efb-search-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.efb-search__results--wide { width: min(780px, calc(100vw - 32px)); }
.efb-search__results--empty { width: min(460px, calc(100vw - 32px)); }

/* 1. Summary bar */
.efb-search__bar {
	position: sticky; top: 0; z-index: 2;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 10px 12px 10px 16px; background: #fff; border-bottom: 1px solid #eef1ee;
}
.efb-search__summary { font-size: .85rem; color: #555; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.efb-search__summary strong { color: #222; }
.efb-search__item.efb-search__allbtn {
	flex: 0 0 auto; padding: 7px 14px; border: 0; border-radius: 999px;
	background: var(--efb-brand, #228b22); color: #fff !important; font-size: .8rem; font-weight: 600;
}
.efb-search__item.efb-search__allbtn:hover,
.efb-search__item.efb-search__allbtn.is-active { background: var(--efb-brand-dark, #1b6f1b); }

/* Groups and rows */
.efb-search__group { padding: 12px 16px 6px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #8a958c; }
.efb-search__item { display: flex; align-items: center; gap: 12px; padding: 8px 16px; color: #222 !important; text-decoration: none !important; transition: background .15s ease; }
.efb-search__item:hover,
.efb-search__item.is-active { background: #f1f7f1; }
.efb-search__item img,
.efb-search__noimg { width: 52px; height: 52px; object-fit: contain; flex: 0 0 52px; background: #f3f5f4; border-radius: 10px; mix-blend-mode: multiply; }
.efb-search__meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.efb-search__title { font-size: .9rem; line-height: 1.3; }
.efb-search__title mark,
.efb-search__tag mark { background: none; color: var(--efb-brand, #228b22); font-weight: 700; }
.efb-search__sku { font-size: .74rem; color: #8a958c; }
.efb-search__price { font-size: .82rem; color: var(--efb-brand, #228b22); font-weight: 700; }
.efb-search__parent { font-size: .75rem; color: #8a958c; }
.efb-search__count { flex: 0 0 auto; font-size: .72rem; color: #6b766d; background: #eef2ee; border-radius: 999px; padding: 1px 8px; }
.efb-search__all { justify-content: center; font-weight: 600; color: var(--efb-brand, #228b22) !important; }

/* 2. Best match card + the other categories */
.efb-search__item.efb-search__best {
	margin: 0 10px 4px; padding: 12px; border: 1px solid #cfe3cf; border-radius: 12px;
	background: linear-gradient(135deg, #eef7ee, #f8fbf8);
}
.efb-search__item.efb-search__best:hover,
.efb-search__item.efb-search__best.is-active { border-color: var(--efb-brand, #228b22); background: #eaf5ea; }
.efb-search__best-img { flex: 0 0 64px; height: 64px; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.efb-search__best-img img { width: 64px; height: 64px; flex-basis: 64px; background: #fff; border-radius: 0; }
.efb-search__best-img--icon { color: var(--efb-brand, #228b22); }
.efb-search__best .efb-search__title { font-size: 1rem; font-weight: 700; }
.efb-search__go {
	flex: 0 0 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
	background: var(--efb-brand, #228b22); color: #fff; font-size: 1rem; transition: transform .18s ease;
}
.efb-search__best:hover .efb-search__go,
.efb-search__best.is-active .efb-search__go { transform: translateX(3px); }
.efb-search__item--cat { padding: 8px 12px; margin: 0 6px; border-radius: 9px; }
.efb-search__item--cat .efb-search__title { font-weight: 600; }
.efb-search__ico { flex: 0 0 30px; height: 30px; border-radius: 8px; background: #eef5ee; color: var(--efb-brand, #228b22); display: flex; align-items: center; justify-content: center; }

/* 4. Tags as filter chips */
.efb-search__tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 14px; }
.efb-search__item.efb-search__tag {
	display: inline-flex; gap: 6px; padding: 5px 11px; border: 1px solid #dfe8df; border-radius: 999px;
	font-size: .8rem; line-height: 1.35; background: #fff;
}
.efb-search__tag svg { flex: 0 0 auto; color: var(--efb-brand, #228b22); }
.efb-search__item.efb-search__tag:hover,
.efb-search__item.efb-search__tag.is-active { border-color: var(--efb-brand, #228b22); background: #eef6ee; }

/* Two columns: categories + filters | products */
.efb-search__cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.efb-search__col--side { background: #fafcfa; border-right: 1px solid #eef1ee; padding-bottom: 6px; }
.efb-search__col:not(.efb-search__col--side) .efb-search__item + .efb-search__item { border-top: 1px solid #f2f4f2; }
.efb-search__single { padding-bottom: 6px; }

/* 6. Nothing found */
.efb-search__empty { padding: 18px 16px 16px; }
.efb-search__empty-title { margin: 0 0 4px; font-size: 1rem; font-weight: 700; color: #222; }
.efb-search__empty-text { margin: 0 0 10px; font-size: .85rem; color: #666; }
.efb-search__tags--ranges { padding: 0 0 14px; }
.efb-search__help {
	display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
	padding: 12px 14px; border-radius: 12px; background: #f3f8f3; font-size: .82rem; color: #4b574d;
}
.efb-search__help > span { flex: 1 1 200px; }
.efb-search__item.efb-search__cta {
	padding: 8px 16px; border-radius: 999px; background: var(--efb-brand, #228b22);
	color: #fff !important; font-size: .82rem; font-weight: 600;
}
.efb-search__item.efb-search__cta:hover,
.efb-search__item.efb-search__cta.is-active { background: var(--efb-brand-dark, #1b6f1b); }

/* Close button: only in the phone full-screen view */
.efb-search__close { display: none; }

/* 7. Phones: the search takes the whole screen while in use */
@media (max-width: 699px) {
	.efb-search__results { min-width: 0; }
	.efb-search__results--wide,
	.efb-search__results--empty { width: auto; }
	.efb-search__cols { grid-template-columns: 1fr; }
	.efb-search__col--side { border-right: 0; border-bottom: 1px solid #eef1ee; }

	html.efb-search-open { overflow: hidden; }
	.efb-search.is-full {
		position: fixed; inset: 0; z-index: 100001; max-width: none; width: auto; margin: 0;
		display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 8px;
		padding: 12px; background: #fff;
	}
	.admin-bar .efb-search.is-full { top: 46px; } /* below the WordPress toolbar (logged in) */
	.efb-search.is-full .efb-search__close {
		display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; height: 48px;
		padding: 0; border: 0; border-radius: 10px; background: #f1f5f1; color: #222; cursor: pointer;
	}
	.efb-search.is-full .efb-search__input { height: 48px; font-size: 16px; border-radius: 10px; }
	.efb-search.is-full .efb-search__results {
		position: static; flex: 1 0 100%; width: auto; max-height: calc(100vh - 84px); max-height: calc(100dvh - 84px);
		border: 0; border-radius: 0; box-shadow: none; animation: none;
	}
	.efb-search.is-full .efb-search__item { padding-top: 10px; padding-bottom: 10px; }
}
