/*
 * START: DBTC Search Results Upgrade CSS
 * Purpose:
 * - Style upgraded WooCommerce search results.
 * - Keep layout clean, fast and mobile friendly.
 * - Avoid heavy effects.
 * END: DBTC Search Results Upgrade CSS
 */

body.search .dbtc-search-intro,
body.search .dbtc-search-suggestions,
body.search .dbtc-search-help {
	background: #ffffff;
	border: 1px solid rgba(10, 27, 78, 0.10);
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(10, 27, 78, 0.06);
	margin: 0 0 24px;
	padding: 22px;
}

body.search .dbtc-search-intro h2,
body.search .dbtc-search-suggestions h2,
body.search .dbtc-search-help h2 {
	color: #06154a;
	font-size: clamp(22px, 3vw, 34px);
	line-height: 1.18;
	margin: 0 0 8px;
}

body.search .dbtc-search-intro p,
body.search .dbtc-search-help p {
	color: #4d5565;
	font-size: 16px;
	line-height: 1.55;
	margin: 0 0 14px;
}

body.search .dbtc-search-kicker {
	color: #3347b8 !important;
	font-size: 13px !important;
	font-weight: 700;
	letter-spacing: 0.06em;
	margin: 0 0 8px !important;
	text-transform: uppercase;
}

body.search .dbtc-search-brand {
	align-items: center;
	display: flex;
	gap: 22px;
}

body.search .dbtc-search-brand__logo {
	background: #fff;
	border: 1px solid rgba(10, 27, 78, 0.10);
	border-radius: 12px;
	height: auto;
	max-height: 74px;
	max-width: 190px;
	object-fit: contain;
	padding: 10px;
}

body.search .dbtc-search-link,
body.search .dbtc-search-help__button {
	align-items: center;
	background: #06154a;
	border-radius: 999px;
	color: #ffffff !important;
	display: inline-flex;
	font-size: 15px;
	font-weight: 700;
	justify-content: center;
	line-height: 1.2;
	padding: 12px 18px;
	text-decoration: none !important;
}

body.search .dbtc-search-suggestions__grid {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.search .dbtc-search-suggestion {
	align-items: center;
	background: #f5f7fb;
	border: 1px solid rgba(10, 27, 78, 0.10);
	border-radius: 14px;
	color: #06154a !important;
	display: flex;
	font-weight: 700;
	justify-content: center;
	min-height: 64px;
	padding: 14px;
	text-align: center;
	text-decoration: none !important;
}

body.search .dbtc-search-suggestion:hover {
	background: #eef2ff;
	border-color: rgba(10, 27, 78, 0.20);
}

/* Product card improvements */

body.search ul.products li.product {
	border-radius: 14px;
	overflow: hidden;
	position: relative;
}

body.search ul.products li.product .dbtc-search-sale-badge {
	display: none !important;
}

body.search ul.products li.product .onsale {
	border-radius: 999px !important;
	font-size: 10px !important;
	font-weight: 800 !important;
	line-height: 1 !important;
	padding: 6px 8px !important;
	top: 10px !important;
	left: 10px !important;
	right: auto !important;
	z-index: 4 !important;
}

body.search ul.products li.product .woocommerce-loop-product__title,
body.search ul.products li.product h4,
body.search ul.products li.product .desc h4 {
	display: -webkit-box;
	min-height: 58px;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

body.search ul.products li.product .price {
	min-height: 24px;
}

body.search .dbtc-search-card-meta {
	color: #5e6675;
	display: flex;
	flex-wrap: wrap;
	font-size: 13px;
	gap: 6px 10px;
	justify-content: center;
	line-height: 1.35;
	margin: 8px 0 0;
}

body.search .dbtc-search-card-meta__brand {
	color: #06154a;
	font-weight: 700;
}

body.search .dbtc-search-card-meta__sku {
	color: #6b7280;
}

body.search .dbtc-search-actions {
	margin-top: 10px;
	text-align: center;
}

body.search .dbtc-search-request-sample.button {
	background: #f5f7fb !important;
	border: 1px solid rgba(10, 27, 78, 0.16) !important;
	border-radius: 999px !important;
	color: #06154a !important;
	display: inline-flex !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	justify-content: center;
	line-height: 1.2 !important;
	min-height: 38px;
	padding: 10px 16px !important;
	text-decoration: none !important;
	width: auto;
}

body.search .dbtc-search-request-sample.button:hover {
	background: #eef2ff !important;
}

/* Help block */

body.search .dbtc-search-help {
	background: #f8fafc;
	text-align: center;
}

body.search .dbtc-search-help__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin-top: 16px;
}

body.search .dbtc-search-help__button--secondary {
	background: #ffffff !important;
	border: 1px solid rgba(10, 27, 78, 0.18);
	color: #06154a !important;
}

/* Search overlay */

.dbtc-search-overlay {
	display: none;
}

body.dbtc-search-overlay-open {
	overflow: hidden;
}

body.dbtc-search-overlay-open .dbtc-search-overlay {
	display: block;
}

.dbtc-search-overlay__backdrop {
	background: rgba(6, 21, 74, 0.42);
	inset: 0;
	position: fixed;
	z-index: 99997;
}

.dbtc-search-overlay__panel {
	background: #ffffff;
	border-radius: 0 0 24px 24px;
	box-shadow: 0 18px 50px rgba(6, 21, 74, 0.20);
	left: 50%;
	max-height: 88vh;
	max-width: 980px;
	overflow: auto;
	padding: 28px;
	position: fixed;
	top: 0;
	transform: translateX(-50%);
	width: calc(100% - 32px);
	z-index: 99998;
}

.dbtc-search-overlay__close {
	align-items: center;
	background: #f5f7fb;
	border: 1px solid rgba(10, 27, 78, 0.12);
	border-radius: 999px;
	color: #06154a;
	cursor: pointer;
	display: flex;
	font-size: 28px;
	height: 42px;
	justify-content: center;
	line-height: 1;
	position: absolute;
	right: 18px;
	top: 18px;
	width: 42px;
}

.dbtc-search-overlay__panel h2 {
	color: #06154a;
	font-size: clamp(28px, 4vw, 46px);
	line-height: 1.1;
	margin: 0 52px 10px 0;
}

.dbtc-search-overlay__panel p {
	color: #4d5565;
	font-size: 16px;
	line-height: 1.55;
	margin: 0 0 20px;
}

.dbtc-search-overlay__grid {
	display: grid;
	gap: 18px;
	grid-template-columns: 1fr 1fr 1fr;
	margin-top: 18px;
}

.dbtc-search-overlay__panel h3 {
	color: #06154a;
	font-size: 18px;
	margin: 0 0 12px;
}

.dbtc-search-overlay__links {
	display: grid;
	gap: 8px;
}

.dbtc-search-overlay__links a,
.dbtc-search-overlay__help a {
	background: #f5f7fb;
	border: 1px solid rgba(10, 27, 78, 0.10);
	border-radius: 999px;
	color: #06154a !important;
	display: inline-flex;
	font-weight: 700;
	justify-content: center;
	padding: 11px 14px;
	text-align: center;
	text-decoration: none !important;
}

.dbtc-search-overlay__links a:hover,
.dbtc-search-overlay__help a:hover {
	background: #eef2ff;
}

.dbtc-search-overlay__help {
	background: #f8fafc;
	border: 1px solid rgba(10, 27, 78, 0.10);
	border-radius: 18px;
	padding: 18px;
}

.dbtc-search-overlay__help a {
	background: #06154a;
	color: #ffffff !important;
	width: 100%;
}

/* Mobile */

@media (max-width: 767px) {
	body.search .dbtc-search-brand {
		align-items: flex-start;
		flex-direction: column;
	}

	body.search .dbtc-search-suggestions__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	body.search .dbtc-search-intro,
	body.search .dbtc-search-suggestions,
	body.search .dbtc-search-help {
		border-radius: 12px;
		padding: 18px;
	}

	body.search .dbtc-search-suggestion {
		min-height: 54px;
	}

	body.search .dbtc-search-help__button {
		width: 100%;
	}

	body.search ul.products li.product .woocommerce-loop-product__title,
	body.search ul.products li.product h4,
	body.search ul.products li.product .desc h4 {
		min-height: auto;
	}

	.dbtc-search-overlay__panel {
		border-radius: 0 0 18px 18px;
		padding: 22px 16px;
		width: calc(100% - 16px);
	}

	.dbtc-search-overlay__grid {
		grid-template-columns: 1fr;
	}
}


/* START: v1.2 search dropdown under search box */

/* This turns the search helper from a full-screen overlay into a small dropdown
   below the active search box, so customers can still type and search normally. */

body.dbtc-search-overlay-open {
	overflow: auto !important;
}

.dbtc-search-host {
	position: relative !important;
	z-index: 9999;
}

.dbtc-search-overlay {
	display: none;
	left: 0;
	position: absolute;
	right: auto;
	top: calc(100% + 10px);
	width: min(720px, calc(100vw - 24px));
	z-index: 99999;
}

.dbtc-search-overlay.is-open {
	display: block;
}

.dbtc-search-overlay__backdrop {
	display: none !important;
}

.dbtc-search-overlay__panel {
	background: #ffffff;
	border: 1px solid rgba(10, 27, 78, 0.12);
	border-radius: 16px;
	box-shadow: 0 18px 46px rgba(6, 21, 74, 0.18);
	left: auto !important;
	max-height: min(72vh, 620px);
	max-width: none;
	overflow: auto;
	padding: 18px;
	position: relative !important;
	top: auto !important;
	transform: none !important;
	width: 100%;
	z-index: 99999;
}

.dbtc-search-overlay__close {
	font-size: 22px;
	height: 34px;
	right: 12px;
	top: 12px;
	width: 34px;
}

.dbtc-search-overlay__panel h2 {
	font-size: 22px;
	line-height: 1.18;
	margin: 0 44px 8px 0;
}

.dbtc-search-overlay__panel p {
	font-size: 14px;
	margin-bottom: 14px;
}

.dbtc-search-overlay__grid {
	display: grid;
	gap: 14px;
	grid-template-columns: 1fr 1fr 1.1fr;
	margin-top: 12px;
}

.dbtc-search-overlay__panel h3 {
	font-size: 15px;
	margin-bottom: 8px;
}

.dbtc-search-overlay__links {
	gap: 7px;
}

.dbtc-search-overlay__links a,
.dbtc-search-overlay__help a {
	font-size: 13px;
	padding: 9px 11px;
}

.dbtc-search-overlay__help {
	border-radius: 14px;
	padding: 14px;
}

.dbtc-search-overlay__help p {
	font-size: 13px;
}

@media (max-width: 767px) {
	.dbtc-search-overlay {
		left: 50%;
		right: auto;
		transform: translateX(-50%);
		width: calc(100vw - 20px);
	}

	.dbtc-search-overlay__panel {
		border-radius: 14px;
		padding: 16px;
	}

	.dbtc-search-overlay__grid {
		grid-template-columns: 1fr;
	}
}

/* END: v1.2 search dropdown under search box */


/* START: v1.3 featured search results */

body.search .dbtc-featured-search {
	background: #ffffff;
	border: 1px solid rgba(10, 27, 78, 0.10);
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(10, 27, 78, 0.06);
	margin: 0 0 24px;
	padding: 22px;
}

body.search .dbtc-featured-search__head h2 {
	color: #06154a;
	font-size: clamp(22px, 3vw, 34px);
	line-height: 1.18;
	margin: 0 0 8px;
}

body.search .dbtc-featured-search__head p {
	color: #4d5565;
	font-size: 16px;
	line-height: 1.55;
	margin: 0 0 16px;
}

body.search .dbtc-featured-search__grid {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.search .dbtc-featured-search-card {
	background: #f8fafc;
	border: 1px solid rgba(10, 27, 78, 0.10);
	border-radius: 14px;
	overflow: hidden;
}

body.search .dbtc-featured-search-card__image {
	background: #ffffff;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

body.search .dbtc-featured-search-card__image img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

body.search .dbtc-featured-search-card__body {
	padding: 14px;
}

body.search .dbtc-featured-search-card h3 {
	font-size: 15px;
	line-height: 1.3;
	margin: 0 0 8px;
	min-height: 40px;
}

body.search .dbtc-featured-search-card h3 a {
	color: #06154a !important;
	text-decoration: none !important;
}

body.search .dbtc-featured-search-card__price {
	color: #06154a;
	font-size: 14px;
	font-weight: 700;
	margin: 0 0 10px;
}

body.search .dbtc-featured-search-card__button {
	align-items: center;
	background: #06154a;
	border-radius: 999px;
	color: #ffffff !important;
	display: inline-flex;
	font-size: 13px;
	font-weight: 700;
	justify-content: center;
	line-height: 1.2;
	padding: 10px 14px;
	text-decoration: none !important;
	width: 100%;
}

@media (max-width: 900px) {
	body.search .dbtc-featured-search__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	body.search .dbtc-featured-search {
		border-radius: 12px;
		padding: 18px;
	}

	body.search .dbtc-featured-search__grid {
		grid-template-columns: 1fr;
	}
}

/* END: v1.3 featured search results */
