/* DSG Header preview 0.1.2. Only header scopes; native state/display/position owns interaction. */
body.dsg-header-preview-active {
	--dsg-h-primary: #224444;
	--dsg-h-hover: #193535;
	--dsg-h-text: #30383B;
	--dsg-h-muted: #69767A;
	--dsg-h-panel: #F3F7F6;
	--dsg-h-border: #D4E2DF;
	--dsg-h-white: #FFFFFF;
}
body.dsg-header-preview-active #page :is(.topbar-wrapper, #masthead, .col-full-nav) {
	font-family: "Open Sans", sans-serif;
	color: var(--dsg-h-text);
}
/* Existing Additional CSS sets these exact properties with !important. */
body.dsg-header-preview-active #page .topbar-wrapper {
	background: var(--dsg-h-panel) !important;
	border-bottom: 1px solid var(--dsg-h-border) !important;
}
body.dsg-header-preview-active #page .topbar-wrapper .top-bar > .col-full {
	gap: 12px !important;
	min-height: 36px !important;
}
body.dsg-header-preview-active #page .topbar-wrapper :is(.top-bar-left, .top-bar-center, .top-bar-right) {
	font-family: inherit !important;
	font-size: 12px !important;
	line-height: 1.5 !important;
	color: var(--dsg-h-text) !important;
}
body.dsg-header-preview-active #page .topbar-wrapper a { color: var(--dsg-h-primary); text-decoration: none; }
body.dsg-header-preview-active #page #masthead { background: var(--dsg-h-white); }
body.dsg-header-preview-active #page #masthead .main-header { padding-top: 14px; padding-bottom: 14px; }
body.dsg-header-preview-active #page #masthead .custom-logo-link img { width: auto; height: 52px; max-width: 100%; object-fit: contain; }
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) .site-search { min-width: 0; }
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) .aws-container { width: 100%; max-width: 720px; }
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) .aws-container .aws-search-form {
	box-sizing: border-box;
	height: 48px;
	border: 1px solid var(--dsg-h-muted);
	border-radius: 8px;
	background: var(--dsg-h-white) !important;
	box-shadow: none;
}
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) .aws-container .aws-search-form:focus-within {
	border-color: var(--dsg-h-primary);
	outline: 2px solid var(--dsg-h-primary);
	outline-offset: 2px;
	box-shadow: none;
}
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) .aws-container .aws-search-field {
	min-width: 0;
	padding: 0 14px;
	font: 400 16px/1.4 "Open Sans", sans-serif;
	letter-spacing: 0;
	color: var(--dsg-h-text);
	transform: none;
}
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) .aws-container .aws-search-field::placeholder { font: inherit; color: var(--dsg-h-muted); }
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) .aws-container .aws-search-btn.aws-form-btn {
	width: 50px;
	flex: 0 0 50px;
	background: var(--dsg-h-panel) !important;
}
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) .aws-container .aws-search-btn.aws-form-btn:hover { background: var(--dsg-h-border) !important; }
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) .aws-container .aws-search-btn svg {
	width: 24px !important;
	height: 24px !important;
	fill: var(--dsg-h-primary) !important;
}
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) :is(.secondary-navigation, .shoptimizer-myaccount, .site-header-cart) { font-size: 13px; }
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) :is(.secondary-navigation a, .shoptimizer-myaccount > a, .cart-contents) { color: var(--dsg-h-primary); }
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav, .topbar-wrapper) a:focus-visible,
body.dsg-header-preview-active #page :is(#masthead, .col-full-nav) button:focus-visible { outline: 2px solid var(--dsg-h-primary); outline-offset: 3px; }
body.dsg-header-preview-active #page .col-full-nav { background: var(--dsg-h-primary) !important; }
body.dsg-header-preview-active #page .col-full-nav.is_stuck { box-shadow: 0 3px 12px rgb(34 68 68 / 12%); }
body.dsg-header-preview-active #page #mega-menu-wrap-primary {
	--dsg-menu-text: var(--dsg-h-text);
	/* Preserve existing custom menu structure, replacing only its old red hover tokens. */
	--dsg-menu-red: var(--dsg-h-primary);
	--dsg-menu-red-soft: var(--dsg-h-panel);
	background: transparent;
}
body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
	font-family: "Open Sans", sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0;
	padding-left: 10px;
	padding-right: 10px;
}
body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary .mega-sub-menu .mega-menu-item > a.mega-menu-link {
	font-family: "Open Sans", sans-serif;
	color: var(--dsg-h-text) !important;
}
body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary .mega-sub-menu .mega-menu-item > a.mega-menu-link:hover,
body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary .mega-menu-tabbed > ul.mega-sub-menu > li.mega-toggle-on > a.mega-menu-link {
	background: var(--dsg-h-panel) !important;
	color: var(--dsg-h-primary) !important;
	border-left-color: var(--dsg-h-primary) !important;
}
/* Keep Shoptimizer's native 992px mobile boundary and Max Mega Menu's state classes. */
@media (min-width: 993px) {
	body.dsg-header-preview-active #page .topbar-wrapper .top-bar > .col-full { min-height: 40px !important; }
	body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary { display: flex; align-items: stretch; }
	body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item { flex: 1 1 0; min-width: 0; float: none; }
	body.dsg-header-preview-active #page #masthead .main-header { display: flex; align-items: center; gap: 24px; padding-top: 18px; padding-bottom: 18px; }
	/* Approved desktop logo +35%; contain preserves artwork proportions. Mobile stays unchanged. */
	body.dsg-header-preview-active #page #masthead .site-branding { flex: 0 0 230px; margin: 0; }
	body.dsg-header-preview-active #page #masthead .custom-logo-link img { height: 64px; }
	body.dsg-header-preview-active #page #masthead .site-search { flex: 1 1 auto; width: auto; margin: 0; }
	body.dsg-header-preview-active #page #masthead .secondary-navigation { flex: 0 0 auto; margin: 0; }
	body.dsg-header-preview-active #page #masthead .site-header-cart { flex: 0 0 auto; margin: 0; }
	body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
		color: var(--dsg-h-white) !important;
		background: var(--dsg-h-primary) !important;
		border-left: 0 !important;
		display: flex !important;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		height: 60px;
		line-height: 1.3;
		white-space: normal;
		font-weight: 600 !important;
		padding: 2px 8px !important;
		text-align: center;
	}
	body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a > .mega-indicator {
		flex-shrink: 0;
	}
	/* Hide only the root glyph; keep the native indicator, hit area and events.
	 * Descendant submenu indicators and mobile navigation are unchanged. */
	body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link > .mega-indicator::after {
		visibility: hidden !important;
	}
	body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link:is(:hover, :focus-visible),
	body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary > li.mega-toggle-on > a.mega-menu-link {
		background: var(--dsg-h-hover) !important;
	}
}
@media (max-width: 992px) {
	/* The same native wrapper becomes a drawer on mobile: keep dark text on white. */
	body.dsg-header-preview-active #page .col-full-nav { background: var(--dsg-h-white) !important; }
	body.dsg-header-preview-active #page .col-full-nav .shoptimizer-mobile-menu a { color: var(--dsg-h-primary); }
	body.dsg-header-preview-active #page #masthead .main-header { padding-top: 10px; padding-bottom: 10px; }
	body.dsg-header-preview-active #page #masthead .custom-logo-link img { height: 42px; width: auto; }
	body.dsg-header-preview-active #page #masthead .menu-toggle { color: var(--dsg-h-primary); font-size: 12px; }
	body.dsg-header-preview-active #page #masthead .menu-toggle .bar { background: var(--dsg-h-primary); }
	body.dsg-header-preview-active #page #masthead .site-search { margin-top: 10px; }
	body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link { color: var(--dsg-h-primary) !important; }
}
@media (min-width: 993px) {
	body.dsg-header-preview-active #page #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link:focus-visible {
		outline: 2px solid var(--dsg-h-white);
		outline-offset: -3px;
	}
}
@media (max-width: 480px) {
	body.dsg-header-preview-active #page .topbar-wrapper .top-bar > .col-full { gap: 8px !important; }
	body.dsg-header-preview-active #page .topbar-wrapper .top-bar-left { font-size: 11px !important; }
}
