/* ==========================================================================
   Search: header typeahead, results page heading, no-results page
   ========================================================================== */

/* ---------- Header typeahead ---------- */

/* WoodMart's own AJAX dropdown is replaced by .yb-search-panel. */
.yb .whb-header .wd-header-search-form .search-results-wrapper { display: none !important; }

.yb .whb-header .yb-search-form { position: relative; }
.yb .whb-header .yb-search-form input[name="s"] { padding-right: 40px !important; }

.yb .yb-search-clear {
	position: absolute;
	top: 50%;
	right: 6px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	min-height: 0;
	margin: 0;
	padding: 0;
	transform: translateY(-50%);
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #111;
	font: 400 24px/1 var(--yb-font, inherit);
	box-shadow: none;
	cursor: pointer;
}
.yb .yb-search-clear:hover { background: #f2f2f2; }
.yb .yb-search-clear[hidden] { display: none !important; }

/* Dim the page under the header while the panel is open. */
.yb-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 380;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
}
.yb-search-open .yb-search-overlay { opacity: 1; visibility: visible; }
.yb.yb-search-open .whb-main-header { z-index: 400; }

.yb .yb-search-panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 20;
	width: max(100%, 455px);
	max-width: calc(100vw - 32px);
	max-height: min(560px, calc(100vh - 140px));
	overflow-y: auto;
	scrollbar-width: none;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
	color: #111;
	text-align: left;
}
.yb .yb-search-panel::-webkit-scrollbar { display: none; }
.yb .yb-search-panel[hidden] { display: none !important; }
.yb .yb-search-panel ul { margin: 0; padding: 0; list-style: none; }
.yb .yb-search-panel li { margin: 0; }
.yb .yb-search-panel a { color: #111; text-decoration: none; }

.yb .yb-search-panel__label {
	margin: 0 0 12px;
	color: #111;
	font: 700 12px/1.3 var(--yb-font, inherit);
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* Empty input: popular searches */
.yb .yb-search-panel__popular { padding: 24px; }
.yb .yb-search-panel ul.yb-search-panel__terms li + li { margin-top: 4px; }
.yb .yb-search-panel__terms a,
.yb .yb-search-panel__suggest a {
	display: block;
	padding: 6px 0;
	font: 400 16px/1.4 var(--yb-font, inherit);
}
.yb .yb-search-panel__terms a:hover,
.yb .yb-search-panel__suggest a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Typing: suggested terms + top results */
.yb .yb-search-panel ul.yb-search-panel__suggest { padding: 14px 24px; }
.yb .yb-search-panel__suggest a { font-size: 17px; }
.yb .yb-search-panel__top { padding: 20px 24px 24px; background: #f5f5f5; }
.yb .yb-search-panel__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}
.yb .yb-search-card a { display: flex; flex-direction: column; height: 100%; background: #fff; }
.yb .yb-search-card__img { display: block; aspect-ratio: 5 / 6; overflow: hidden; background: #eee; }
.yb .yb-search-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.yb .yb-search-card__name {
	display: block;
	padding: 10px 12px 14px;
	font: 600 15px/1.35 var(--yb-font, inherit);
}
.yb .yb-search-card a:hover .yb-search-card__name { text-decoration: underline; text-underline-offset: 3px; }
.yb .yb-search-panel__none { margin: 0; font-size: 14px; color: #555; }
.yb .yb-search-panel__all {
	display: inline-block;
	margin-top: 16px;
	font: 600 14px/1.3 var(--yb-font, inherit);
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

@media (max-width: 767px) {
	.yb .yb-search-panel { width: calc(100vw - 32px); }
	.yb .yb-search-panel__grid { gap: 10px; }
}

/* ---------- Results page ---------- */

/* No H1 band, breadcrumb or count next to sort (the count is in the Products tab). */
.yb.search-results.woocommerce-shop .page-title,
.yb.search-no-results.woocommerce-shop .page-title,
.yb.yb-search-has-results .page-title,
.yb.yb-search-no-results .page-title { display: none !important; }
.yb.search-results .shop-loop-head .wd-breadcrumbs,
.yb.search-results .shop-loop-head .woocommerce-breadcrumb,
.yb.search-results .shop-loop-head .woocommerce-result-count,
.yb.search .yb-search-head ~ .shop-loop-head .woocommerce-breadcrumb { display: none !important; }

/* No FAQ / promo tile on search (the PHP removes the FAQ; this is a safety net). */
.yb.search .yb-cat-faq,
.yb.search .ll-promo-tile,
.yb.search .ll-seo { display: none !important; }

.yb.search .yb-search-head {
	flex: 0 0 100%;
	order: -2;
	width: 100%;
	max-width: 100%;
	padding: 32px 0 24px;
}
.yb.search .yb-search-head__title {
	margin: 0 0 18px;
	color: #111;
	font: 400 18px/1.4 var(--yb-font, inherit);
}
.yb.search .yb-search-head__title strong { font-weight: 700; }
.yb.search .yb-search-tabs {
	display: flex;
	gap: 32px;
	border-bottom: 1px solid #d5d5d5;
}
.yb.search .yb-search-tabs__tab {
	display: inline-block;
	margin-bottom: -1px;
	padding: 0 0 10px;
	border-bottom: 2px solid transparent;
	color: #767676;
	font: 600 16px/1.3 var(--yb-font, inherit);
	text-decoration: none;
}
.yb.search .yb-search-tabs__tab.is-active { border-bottom-color: #d22030; color: #111; }
.yb.search a.yb-search-tabs__tab:hover { color: #111; }

/* ---------- No results ---------- */

.yb.yb-search-no-results .page-title,
.yb.yb-search-no-results .sidebar-container,
.yb.yb-search-no-results .wd-show-sidebar-btn,
.yb.yb-search-no-results .shop-loop-head,
.yb.yb-search-no-results .no-products-footer,
.yb.yb-search-no-results .woocommerce-no-products-found { display: none !important; }
.yb.yb-search-no-results .content-layout-wrapper > .site-content {
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
}

.yb .yb-search-empty {
	max-width: 720px;
	margin: 0 auto;
	padding: 56px 0 48px;
	color: #111;
	text-align: center;
}
.yb .yb-search-empty__line { margin: 0 0 6px; font: 400 18px/1.5 var(--yb-font, inherit); }
.yb .yb-search-empty__term { margin: 0 0 28px; font: 700 26px/1.3 var(--yb-font, inherit); word-break: break-word; }
.yb .yb-search-empty__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 24px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}
.yb .yb-search-empty__links li { margin: 0; }
.yb .yb-search-empty__links a {
	color: #111;
	font: 400 16px/1.5 var(--yb-font, inherit);
	text-decoration: underline;
	text-underline-offset: 4px;
}
.yb .yb-search-empty__links a:hover { color: #d22030; }
.yb .yb-search-ymal { padding-bottom: 40px; }
@media (max-width: 767px) {
	.yb .yb-search-empty { padding: 40px 0 32px; }
}
