/* ==========================================================================
   Підказки пошуку товарів (inc/woocommerce/product-search.php, assets/js/product-search.js)
   Саме поле — віджет Elementor Search Form (його стилі — в Elementor); тут лише список підказок
   і форма [product_search] для місць без Elementor.
   ========================================================================== */

.has-product-search{
	--ps-width:   440px;                        /* ← ПРОЄКТ мінімальна ширина списку підказок */
	--ps-thumb:   52px;                         /* ← ПРОЄКТ фото товару */
	--ps-radius:  var(--theme-radius-lg);
	--ps-hover:   var(--theme-accent-soft);
	--ps-accent:  var(--theme-accent);
	--ps-muted:   var(--theme-text-muted);
	position:relative;
}

.product-search__results{
	position:absolute;top:calc(100% + 8px);left:0;z-index:1000;
	box-sizing:border-box;
	width:max(100%, var(--ps-width));max-width:calc(100vw - 32px);
	max-height:min(70vh, 560px);overflow:auto;overscroll-behavior:contain;
	padding:8px;
	border-radius:var(--ps-radius);
	background:var(--theme-bg);
	box-shadow:0 12px 40px rgba(60, 54, 70, .16);
	color:var(--theme-text);
	font:400 14px/1.35 var(--theme-font), sans-serif;
	text-align:left;
}
.product-search__results[hidden]{display:none}
.has-product-search.is-searching .elementor-search-form__input,
.has-product-search.is-searching .product-search__input{background-image:none} /* місце для індикатора, якщо знадобиться */

/* Віджет «Search»: лупа стоїть поверх поля, а padding полів із Site Settings (Kit) перебиває відступ віджета —
   текст заїжджав під іконку. Відступ зліва — під іконку. */
.elementor-widget-search .e-search-form:has(.e-search-label svg, .e-search-label i) input.e-search-input{
	padding-inline-start:var(--ps-input-indent, 44px) !important; /* ← ПРОЄКТ відступ тексту від лівого краю */
}

/* Форма віджета «Search» — flex-рядок; список підказок — окремим рядком на всю ширину (важливо в Off-Canvas,
   де список не «спливає», а стоїть у потоці — інакше стискається збоку від поля) */
.e-search-form.has-product-search{flex-wrap:wrap}
.e-search-form.has-product-search > .product-search__results{flex:1 1 100%;min-width:0}

/* В Off-Canvas (мобільний): список — просто під полем на всю ширину панелі, без «спливаючої» тіні */
.e-off-canvas .product-search__results{
	position:static;width:100%;max-width:none;max-height:none;margin-top:12px;padding:0;
	border-radius:0;box-shadow:none;background:transparent;
}

/* Full Screen: список — у повноекранному шарі під полем */
.elementor-search-form--skin-full_screen .elementor-search-form__container{flex-wrap:wrap;align-content:center}
.elementor-search-form--skin-full_screen .product-search__results{
	position:static;flex:1 1 100%;width:100%;max-width:none;max-height:60vh;margin-top:12px;
}

.product-search__group + .product-search__group{margin-top:6px;padding-top:6px;border-top:1px solid var(--theme-line)}
.product-search__heading{margin:4px 8px 6px;color:var(--ps-muted);font-size:12px;letter-spacing:.02em}

/* категорії — «таблетки» */
.product-search__cats{display:flex;flex-wrap:wrap;gap:6px;padding:0 8px 6px}
.product-search__cat{
	padding:5px 12px;border:1px solid var(--theme-line);border-radius:999px;
	color:var(--theme-text);text-decoration:none;
	transition:border-color .15s,background-color .15s;
}
.product-search__cat:hover,
.product-search__cat.is-active{border-color:var(--ps-accent);background:var(--ps-hover);color:var(--theme-text)}

/* товари */
.product-search__items{margin:0;padding:0;list-style:none}
.product-search__item{margin:0;padding:0}
.product-search__item::before,.product-search__item::marker{content:none}
.product-search__item a{
	display:flex;align-items:center;gap:12px;
	padding:8px;border-radius:var(--theme-radius);
	color:var(--theme-text);text-decoration:none;
	transition:background-color .15s;
}
.product-search__item a:hover,
.product-search__item a.is-active{background:var(--ps-hover);color:var(--theme-text)}
.product-search__thumb{flex:0 0 var(--ps-thumb);width:var(--ps-thumb);height:var(--ps-thumb);border-radius:var(--theme-radius);overflow:hidden;background:var(--theme-highlight)}
.product-search__thumb img{display:block;width:100% !important;height:100% !important;object-fit:contain;border-radius:0 !important}
.product-search__text{display:flex;flex-direction:column;gap:2px;min-width:0}
.product-search__brand{color:var(--ps-muted);font-size:12px}
.product-search__name{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.product-search__price{color:var(--ps-accent);font-weight:600}
.product-search__price del{margin-right:6px;color:var(--ps-muted);font-weight:400;font-size:12px}
.product-search__price ins{text-decoration:none}
.product-search__item.is-soldout .product-search__thumb img{opacity:.5}
.product-search__item.is-soldout .product-search__price{color:var(--ps-muted)}
.product-search__results mark{background:none;color:inherit;font-weight:700}

.product-search__all{
	display:block;margin-top:6px;padding:12px;border-radius:var(--theme-radius);
	background:var(--ps-hover);color:var(--ps-accent);
	font-weight:600;text-align:center;text-decoration:none;
}
.product-search__all:hover,
.product-search__all.is-active{background:var(--ps-accent);color:var(--theme-on-accent)}
.product-search__nothing{margin:0;padding:14px 10px;color:var(--ps-muted);text-align:center}

/* ---------- [product_search] — форма без Elementor ---------- */
.product-search{position:relative;display:flex;align-items:center;margin:0}
.product-search__label{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.product-search__icon{position:absolute;left:16px;top:50%;width:20px;height:20px;transform:translateY(-50%);color:var(--theme-text-muted);pointer-events:none}
.product-search__icon svg,.product-search__clear svg{display:block;width:100%;height:100%}
.product-search input.product-search__input{
	box-sizing:border-box;width:100%;min-height:48px;margin:0;padding:0 44px 0 48px;
	border:1px solid var(--theme-line);border-radius:var(--theme-radius);
	background:var(--theme-light);color:var(--theme-text);
	font:400 16px/1.2 var(--theme-font), sans-serif;box-shadow:none;-webkit-appearance:none;appearance:none;
}
.product-search input.product-search__input:focus{border-color:var(--theme-accent);outline:none}
.product-search input.product-search__input::-webkit-search-cancel-button{-webkit-appearance:none}
.product-search button.product-search__clear{
	position:absolute;right:12px;top:50%;width:24px;height:24px;min-height:0;margin:0;padding:4px;
	border:0;border-radius:50%;background:none;color:var(--theme-text-muted);transform:translateY(-50%);cursor:pointer;
}
.product-search button.product-search__clear[hidden]{display:none}
.product-search__submit{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

@media (prefers-reduced-motion:reduce){
	.product-search__results *{transition:none !important}
}
