/* DSG AWS Layout 0.1.5. Only header-owned AWS dropdowns marked by its layout hook. */
body.dsg-header-preview-active .aws-search-result.dsg-aws-results {
	--dsg-aws-primary: var(--dsg-h-primary, #224444);
	--dsg-aws-text: var(--dsg-h-text, #30383B);
	--dsg-aws-muted: var(--dsg-h-muted, #69767A);
	--dsg-aws-soft: var(--dsg-h-panel, #F3F7F6);
	--dsg-aws-border: var(--dsg-h-border, #D4E2DF);
	/* Overrides the legacy child width:100%!important; coordinates still come from AWS. */
	width: var(--dsg-aws-width) !important;
	max-width: calc(100vw - 24px) !important;
	box-sizing: border-box;
	margin: 4px 0 0;
	padding: 0;
	border: 1px solid var(--dsg-aws-border);
	border-radius: 8px !important;
	background: #FFFFFF;
	box-shadow: 0 8px 24px rgb(34 68 68 / 14%);
	/* Restore AWS's own layer, rather than legacy child z-index:99999. */
	z-index: 999999999;
	font: 400 13px/1.4 "Open Sans", sans-serif;
	color: var(--dsg-aws-text);
	max-height: none;
	overflow: visible;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_scroll {
	max-height: min(440px, 65vh);
	max-height: min(440px, 65dvh);
	overflow-y: auto;
	overflow-x: hidden;
	overscroll-behavior: contain;
	border-radius: inherit;
}
body.dsg-header-preview-active .dsg-aws-results .aws_results .aws_result_item {
	padding: 8px 12px;
	border-bottom: 1px solid var(--dsg-aws-border);
	min-width: 0;
	color: var(--dsg-aws-text);
	background: #FFFFFF;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_item:is(:hover, .hovered, :focus-within) {
	background: var(--dsg-aws-soft);
	box-shadow: inset 3px 0 var(--dsg-aws-primary);
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_item .aws_result_link_top {
	/* Preserve AWS's transparent, full-row hit target, also when Tab-focused. */
	position: absolute;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_item a:focus-visible {
	outline: 2px solid var(--dsg-aws-primary);
	outline-offset: -3px;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_image {
	float: left;
	width: 64px;
	height: auto;
	padding: 0 10px 0 0;
	box-sizing: border-box;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_image img {
	display: block;
	width: 54px;
	height: 54px;
	max-width: 100%;
	object-fit: contain;
	border-radius: 4px;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_content {
	display: block;
	min-width: 0;
	overflow: hidden;
}
/* AWS 3.53 renders result.categories here, inside each product's content.
 * Hide only its presentation; standalone taxonomy results/Suggestions stay intact. */
body.dsg-header-preview-active .dsg-aws-results .aws_result_item > .aws_result_content > .aws_result_term {
	display: none;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_item .aws_result_head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	margin: 0 0 3px;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_item .aws_result_title {
	flex: 1 1 160px;
	min-width: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.35;
	font-weight: 600;
	color: var(--dsg-aws-primary);
	overflow-wrap: anywhere;
}
body.dsg-header-preview-active .dsg-aws-results :is(.aws_result_sku, .aws_result_gtin, .aws_result_brands, .aws_result_excerpt, .aws_result_term) {
	font-size: 12px;
	line-height: 1.4;
	font-weight: 400;
	margin: 2px 0;
	color: var(--dsg-aws-muted);
	overflow-wrap: anywhere;
}
/* Muted text stays on white even in hover, preserving 4.69:1 contrast. */
body.dsg-header-preview-active .dsg-aws-results .aws_result_item:is(:hover, .hovered, :focus-within) :is(.aws_result_sku, .aws_result_gtin, .aws_result_brands, .aws_result_excerpt, .aws_result_term) {
	color: var(--dsg-aws-text);
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_brands { flex-wrap: wrap; gap: 2px 6px; }
body.dsg-header-preview-active .dsg-aws-results .aws_brand { padding-right: 0; }
body.dsg-header-preview-active .dsg-aws-results .aws_result_item .aws_result_price {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 100%;
	margin: 0;
	padding: 0;
	font-size: 15px;
	line-height: 1.4;
	font-weight: 700;
	color: var(--dsg-aws-text);
	text-align: right;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_item .aws_result_price { margin-inline-start: auto; }
body.dsg-header-preview-active .dsg-aws-results .aws_result_price :is(.amount, bdi) { white-space: nowrap; }
body.dsg-header-preview-active .dsg-aws-results .aws_result_price del {
	display: block;
	padding: 0;
	font-size: 12px;
	font-weight: 400;
	color: var(--dsg-aws-muted);
	opacity: 1;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_price ins { padding: 0; background: none; text-decoration: none; }
body.dsg-header-preview-active .dsg-aws-results .aws_result_sale { display: block; margin-top: 3px; text-align: right; }
body.dsg-header-preview-active .dsg-aws-results .aws_onsale {
	position: static;
	transform: none;
	float: none;
	display: inline-block;
	width: auto;
	height: auto;
	padding: 1px 6px;
	font-size: 11px;
	line-height: 1.4;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_price .woocommerce-price-suffix {
	display: block;
	margin: 1px 0 0;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--dsg-aws-text);
}
/* Existing child-theme amber, only as an accent on AWS-confirmed sale prices.
 * Keep dark text: the old amber text does not have sufficient contrast on white. */
body.dsg-header-preview-active .dsg-aws-results .aws_result_item.on-sale .aws_result_price ins {
	text-decoration: underline;
	text-decoration-color: #e6a200;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_top_custom_item_s_suggest {
	display: inline-block;
	vertical-align: top;
	width: auto;
	max-width: calc(100% - 12px);
	margin: 5px 0 5px 6px !important;
	padding: 4px 8px !important;
	border: 1px solid var(--dsg-aws-border);
	border-radius: 4px;
	background: #FFFFFF;
	font-size: 12px;
}
body.dsg-header-preview-active .dsg-aws-results .aws_result_top_custom_item_s_suggest .aws_result_head {
	margin: 0;
	font-size: 12px;
	font-weight: 400;
	color: var(--dsg-aws-primary);
	overflow-wrap: anywhere;
}
body.dsg-header-preview-active .dsg-aws-results .aws_terms_suggestions { line-height: 1.8; }
body.dsg-header-preview-active .dsg-aws-results a.aws_term_suggestion {
	display: inline-block;
	padding: 3px 7px;
	margin: 2px;
	border: 1px solid var(--dsg-aws-border);
	border-radius: 4px;
	font-size: 12px;
	color: var(--dsg-aws-primary);
	background: #FFFFFF;
}
body.dsg-header-preview-active .dsg-aws-results .aws_search_more {
	font-size: 13px;
	line-height: 1.5;
	color: var(--dsg-aws-primary);
}
@media (max-width: 600px) {
	body.dsg-header-preview-active .dsg-aws-results .aws_results .aws_result_item { padding: 7px 10px; }
	body.dsg-header-preview-active .dsg-aws-results .aws_result_image { width: 60px; padding-right: 8px; }
	body.dsg-header-preview-active .dsg-aws-results .aws_result_image img { width: 52px; height: 52px; }
	body.dsg-header-preview-active .dsg-aws-results .aws_result_item .aws_result_head { display: block; }
	body.dsg-header-preview-active .dsg-aws-results .aws_result_item .aws_result_title { font-size: 13px; }
	body.dsg-header-preview-active .dsg-aws-results .aws_result_item .aws_result_price { margin-top: 3px; text-align: right; font-size: 14px; }
}
