/**
 * FiboSearch (AJAX Search for WooCommerce) dropdown — Adriatic brand styling.
 *
 * Matches the reference search: grouped suggestions with navy uppercase group
 * headings (Top suggestions / Products / Blog posts), pale greige row hover,
 * navy titles, and a clear "Show all results" action at the bottom. Selectors
 * target FiboSearch's own markup (.dgwt-wcas-*); refined against the live
 * dropdown, with fallbacks for class-name variants across versions.
 */

/* The dropdown panel */
.dgwt-wcas-suggestions-wrapp {
	border: 1px solid #e6e4e3 !important;
	box-shadow: 0 8px 24px rgba( 0, 0, 0, .10 ) !important;
	border-radius: 2px !important;
	font-family: Arial, Helvetica, sans-serif !important;
}

/* Group headings: "Top suggestions", "Products", "Blog posts" */
.dgwt-wcas-suggestion-headline,
.dgwt-wcas-suggestion-headline .dgwt-wcas-suggestion-headline-t {
	color: #242c3f !important;
	text-transform: uppercase !important;
	letter-spacing: .06em !important;
	font-weight: 700 !important;
	font-size: 12px !important;
	background: #fbfbfc !important;
	border-bottom: 1px solid #efeeed !important;
}

/* Rows */
.dgwt-wcas-suggestion {
	color: #242c3f !important;
}
.dgwt-wcas-suggestion:hover,
.dgwt-wcas-suggestion-selected,
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-hovered {
	background: #f2f1ef !important;   /* pale greige */
}

/* Titles + highlighted match */
.dgwt-wcas-st__title,
.dgwt-wcas-st--title,
.dgwt-wcas-st-title {
	color: #242c3f !important;
	font-weight: 600 !important;
}
.dgwt-wcas-st__title mark,
.dgwt-wcas-st--title mark {
	background: transparent !important;
	color: #242c3f !important;
	font-weight: 700 !important;
	padding: 0 !important;
}

/* Price + SKU */
.dgwt-wcas-st-woo-price,
.dgwt-wcas-st__woo-price {
	color: #242c3f !important;
	font-weight: 700 !important;
}
.dgwt-wcas-st-sku {
	color: #8a8f98 !important;
}

/* "Show all results" action — a clear navy bar at the bottom */
.dgwt-wcas-suggestion-more,
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-more {
	text-align: center !important;
	background: #242c3f !important;
	border-top: 0 !important;
}
.dgwt-wcas-suggestion-more,
.dgwt-wcas-suggestion-more a,
.dgwt-wcas-suggestion-more span {
	color: #fff !important;
	font-weight: 700 !important;
	letter-spacing: .02em !important;
}
.dgwt-wcas-suggestion-more:hover {
	background: #1a2030 !important;
}

/* Search input focus in the brand navy */
.dgwt-wcas-search-input:focus {
	border-color: #242c3f !important;
	box-shadow: 0 0 0 1px #242c3f !important;
}

/* The submit/search icon button in brand navy */
.dgwt-wcas-search-submit,
.dgwt-wcas-ico-magnifier {
	color: #242c3f !important;
}

/* --- Full-screen search overlay (matches the reference) --------------------
 * Clicking the header search opens a full-width search bar at the top with a
 * Close button, the page white below, and full-width grouped results. */
.adr-search-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 82vh;              /* a top sheet (~80%), like the reference — not full height */
	z-index: 100000;
	background: #fff;
	display: none;
	overflow-y: auto;
	box-shadow: 0 16px 40px rgba( 0, 0, 0, .18 );
}
.adr-search-overlay.is-open { display: block; }
body.adr-search-open { overflow: hidden; }

.adr-search-overlay__bar {
	max-width: 1200px;
	margin: 0 auto;
	padding: 22px 20px;
	display: flex;
	align-items: center;
	gap: 18px;
	box-sizing: border-box;
}
.adr-search-overlay__field { flex: 1 1 auto; min-width: 0; }
.adr-search-overlay__close {
	flex: 0 0 auto;
	background: none;
	border: 0;
	padding: 6px 4px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	font-weight: 700;
	color: #242c3f;
	cursor: pointer;
	letter-spacing: .01em;
}
.adr-search-overlay__close:hover { opacity: .75; }

/* The FiboSearch field inside the overlay: tall, full-width, thin border. */
.adr-search-overlay .dgwt-wcas-search-wrapp { max-width: none !important; width: 100% !important; }
.adr-search-overlay .dgwt-wcas-search-input {
	height: 52px !important;
	font-size: 17px !important;
	border: 1px solid #cfcfd4 !important;
	border-radius: 2px !important;
	color: #242c3f !important;
	font-family: Arial, Helvetica, sans-serif !important;
}
/* Placeholder: quiet grey, same face as the field. */
.adr-search-overlay .dgwt-wcas-search-input::placeholder {
	color: #8a8f98 !important;
	opacity: 1 !important;
	font-weight: 400 !important;
}
/* FiboSearch's own dropdown is the DATA source only while the overlay is open —
 * keep it rendered (so JS can read it) but off-screen; our .adr-sr shows instead. */
body.adr-search-open .dgwt-wcas-suggestions-wrapp {
	position: fixed !important;
	left: -99999px !important;
	top: 0 !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* --- Full-page results layout inside the overlay (matches the reference) ---- */
.adr-search-overlay__results {
	max-width: 1200px;
	margin: 0 auto;
	padding: 8px 20px 60px;
	box-sizing: border-box;
	font-family: Arial, Helvetica, sans-serif;
}
/* Group headings — measured from the reference search overlay: Oswald (the
 * site's heading face), 16px, navy, sentence/title case (NOT uppercase), no
 * letter-spacing. */
.adr-sr__h {
	font-family: "Oswald", sans-serif;
	color: #242c3f;
	text-transform: none;
	font-weight: 500;
	font-size: 16px;
	line-height: 24px;
	letter-spacing: normal;
	margin: 0 0 1rem;
}
.adr-sr__grid {
	display: grid;
	grid-template-columns: 240px 1fr;   /* suggestions left · products right */
	gap: 40px;
	align-items: start;
}
.adr-sr__terms { list-style: none; margin: 0; padding: 0; }
.adr-sr__terms li { margin: 0 0 .7em; }
.adr-sr__terms a { color: #242c3f; text-decoration: none; font-size: 15px; display: block; }
.adr-sr__terms a:hover .adr-sr__termname { text-decoration: underline; }
.adr-sr__termname { display: block; font-weight: 600; }
.adr-sr__termsub { display: block; color: #8a8f98; font-size: 12px; margin-top: .1em; }

.adr-sr__products {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: 24px;
}
/* Empty-state trending row: never more than one row. The first row stays auto
 * (visible); only extra rows collapse — grid-auto-rows alone would zero EVERY
 * row (blanking the section), so an explicit template-rows: auto is required. */
.adr-sr__products--single { grid-template-rows: auto; grid-auto-rows: 0; overflow: hidden; }
.adr-sr__product { text-decoration: none; color: #242c3f; display: block; }
.adr-sr__thumb {
	display: block;
	background: #f2f1ef; aspect-ratio: 1 / 1; border-radius: 2px;
	overflow: hidden; margin-bottom: .6rem;
}
/* contain, not cover: the whole product shows (tall Toschi bottles were cut). */
.adr-sr__thumb { display: flex; align-items: center; justify-content: center; padding: 8%; box-sizing: border-box; }
.adr-sr__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; mix-blend-mode: multiply; }
.adr-sr__name { display: block; color: #242c3f; font-weight: 700; font-size: 15px; line-height: 1.35; }
.adr-sr__price { display: block; color: #5b616f; font-size: 14px; margin-top: .25rem; }

/* Blog posts — reference layout: three across, an 82px square thumb on the left,
 * title + excerpt on the right. Title in Oswald navy (like the headings); excerpt
 * navy body text clamped to two lines. */
.adr-sr__posts { margin-top: 40px; }
.adr-sr__postlist { display: grid; grid-template-columns: repeat( 3, minmax( 0, 1fr ) ); gap: 28px 24px; }
.adr-sr__post { display: flex; gap: 14px; text-decoration: none; color: #242c3f; align-items: flex-start; }
.adr-sr__postthumb { flex: 0 0 82px; }
.adr-sr__postthumb img { width: 82px; height: 82px; object-fit: cover; border-radius: 2px; display: block; }
.adr-sr__posttext { min-width: 0; }
.adr-sr__posttitle { display: block; font-family: "Oswald", sans-serif; color: #242c3f; font-weight: 500; font-size: 16px; line-height: 20px; margin-bottom: .35rem; }
.adr-sr__postexc {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	color: #242c3f; font-size: 14px; line-height: 1.5;
}

.adr-sr__showall {
	display: inline-block;
	margin: 32px 0 0;          /* left-aligned, not a full-width bar */
	text-align: center;
	background: #242c3f;
	color: #fff;
	padding: .75em 1.6em;
	font-family: "Oswald", sans-serif;
	font-weight: 500;
	font-size: 15px;
	letter-spacing: .02em;
	text-decoration: none;
	border-radius: 0;
}
.adr-sr__showall:hover { background: #1a2030; }
.adr-sr__empty { color: #5b616f; padding: 24px 0; }

/* Loader while a query is in flight. */
.adr-search-overlay.is-loading .adr-search-overlay__results::before {
	content: "";
	display: block;
	width: 34px; height: 34px;
	margin: 60px auto;
	border: 3px solid #e6e4e3;
	border-top-color: #242c3f;
	border-radius: 50%;
	animation: adr-spin .7s linear infinite;
}
@keyframes adr-spin { to { transform: rotate( 360deg ); } }

@media ( max-width: 900px ) {
	.adr-sr__grid { grid-template-columns: 1fr; gap: 24px; }
	.adr-sr__products { grid-template-columns: repeat( 3, minmax( 0, 1fr ) ); }
	.adr-sr__postlist { grid-template-columns: 1fr; }
	/* Give the bar a small top gap on phones (plus the notch inset) so the search
	 * field is not jammed against the top edge. */
	.adr-search-overlay__bar {
		padding: 14px 16px;
		padding-top: calc( 14px + env( safe-area-inset-top, 0px ) );
		gap: 12px;
	}
	/* On phones the overlay is full-height (not the shorter desktop sheet); the
	 * bar's top padding keeps the field off the very top edge. */
	.adr-search-overlay {
		top: 0;
		height: 100vh;
		height: 100dvh;
		border-radius: 0;
	}
}
