/* Shared HTML across devices keeps page caches independent of user agents. */
.vamh-actions,
.vamh-announcement { display: none; }

@media (max-width: 767px) {
	/* Clip horizontal overflow without creating a scrolling ancestor of sticky. */
	body.vamh-active #page { overflow: visible; overflow-x: clip; }
	body.vamh-active #masthead {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto auto;
		align-items: center;
		column-gap: 4px;
		position: relative;
		width: 100%;
		min-height: 68px;
		box-sizing: border-box;
		padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
		margin: 0 0 16px;
		border: 0;
		background: #fff;
		color: #001d34;
		box-shadow: 0 2px 8px #001d3414;
		z-index: 1000;
	}
	body.vamh-active.vamh-sticky #masthead { position: sticky; top: 0; }
	body.vamh-active #masthead::before,
	body.vamh-active #masthead::after,
	body.vamh-active #masthead > .col-full::before,
	body.vamh-active #masthead > .col-full::after,
	body.vamh-active #masthead .storefront-primary-navigation::before,
	body.vamh-active #masthead .storefront-primary-navigation::after,
	body.vamh-active #masthead .storefront-primary-navigation > .col-full::before,
	body.vamh-active #masthead .storefront-primary-navigation > .col-full::after { display: none; }
	body.vamh-active #masthead > .col-full,
	body.vamh-active #masthead .storefront-primary-navigation,
	body.vamh-active #masthead .storefront-primary-navigation > .col-full,
	body.vamh-active #masthead .vama-menu-shell { display: contents; }
	body.vamh-active #masthead .site-branding {
		grid-column: 1;
		grid-row: 1;
		float: none;
		width: auto !important; /* Overrides the verified child theme's 40% !important rule. */
		min-width: 0;
		margin: 0;
		align-self: center;
		line-height: 1;
	}
	body.vamh-active #masthead .site-branding a { display: block; width: fit-content; max-width: 100%; }
	body.vamh-active #masthead .site-branding img { display: block; width: auto; height: auto; min-width: 0; max-width: min(100%, 144px); max-height: 48px; margin: 0; }
	body.vamh-active #masthead .site-title { font-size: 21px; line-height: 1.1; margin: 0; overflow-wrap: anywhere; }
	body.vamh-active #masthead .site-description,
	body.vamh-active #masthead > .col-full > .site-search,
	body.vamh-active #masthead .secondary-navigation,
	body.vamh-active #masthead .site-header-cart,
	body.vamh-active .storefront-handheld-footer-bar { display: none; }
	body.vamh-active #masthead .vamh-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 0; grid-column: 2; grid-row: 1; margin: 0; }
	.vamh-actions *, .vamh-announcement { box-sizing: border-box; }
	body.vamh-active #masthead .vamh-control,
	body.vamh-active #masthead .vamh-contact > a {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: none;
		width: 44px;
		height: 44px;
		min-height: 44px;
		padding: 0;
		margin: 0;
		border: 0;
		border-radius: 8px;
		background: transparent;
		color: #001d34;
		box-shadow: none;
		line-height: 1;
		font-size: 0;
		text-decoration: none;
		list-style: none;
		cursor: pointer;
		animation: none;
	}
	body.vamh-active #masthead .vamh-contact > a { color: #087d42; }
	body.vamh-active #masthead .vamh-cart { position: relative; }
	body.vamh-active #masthead .vamh-cart-count {
		position: absolute; top: 0; right: 0; min-width: 18px; height: 18px;
		padding: 0 3px; border-radius: 10px; background: #a40810; color: #fff;
		font-size: 10px; line-height: 18px; font-weight: 700; text-align: center;
		white-space: nowrap; pointer-events: none;
	}
	body.vamh-active #masthead .vamh-cart [hidden] { display: none; }
	.vamh-contact { position: relative; width: 44px; height: 44px; }
	.vamh-contact > svg { position: absolute; top: 10px; left: 10px; color: #087d42; pointer-events: none; }
	.vamh-contact > a > svg { display: none; }
	.vamh-contact > a > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
	.vamh-contact > a::before, .vamh-contact > a::after { display: none; }
	.vamh-actions svg { display: block; flex: none; width: 24px; height: 24px; }
	.vamh-search > summary::-webkit-details-marker { display: none; }
	.vamh-search > summary::marker { content: ''; }
	body.vamh-active #masthead .vamh-control:hover,
	body.vamh-active #masthead .vamh-contact > a:hover { background: #f0f4f6; }
	body.vamh-active #masthead .vamh-actions :focus-visible,
	body.vamh-active #masthead .site-branding a:focus-visible { outline: 3px solid #2876b5; outline-offset: 2px; }
	/* The existing VAMA/native menu remains the only menu and owns its behavior. */
	body.vamh-active #masthead .vama-menu-mobile,
	body.vamh-active #masthead #site-navigation { grid-column: 3; grid-row: 1; width: auto; min-width: 0; margin: 0; padding: 0; float: none; clear: none; }
	body.vamh-active #masthead .vama-menu-toggle,
	body.vamh-active #masthead #site-navigation button.menu-toggle {
		position: static;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		min-height: 44px;
		margin: 0;
		padding: 9px 10px;
		border: 1px solid #ccd7df;
		border-radius: 9px;
		background: #fff;
		color: #001d34;
		font-size: 14px;
		font-weight: 600;
		line-height: 1.3;
		white-space: nowrap;
		box-sizing: border-box;
	}
	body.vamh-active #masthead .vama-menu-toggle svg { width: 22px; height: 22px; }
	body.vamh-active #masthead #site-navigation button.menu-toggle { position: relative; padding-left: 34px; }
	body.vamh-active #masthead #site-navigation .handheld-navigation,
	body.vamh-active:not(.vama-menu-ready) #masthead .vama-menu-panel {
		position: absolute; top: 100%; left: 0; right: 0;
		width: 100%; max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px);
		margin: 0; overflow-y: auto; background: #fff; border: 1px solid #e3e8ec;
		box-sizing: border-box; z-index: 2;
	}
	body.vamh-active #masthead #site-navigation .handheld-navigation { padding-inline: 16px; }
	body.vamh-active #masthead #site-navigation:not(.toggled) .handheld-navigation { visibility: hidden; }
	body.vamh-active #masthead #site-navigation.toggled .handheld-navigation { visibility: visible; }
	.vamh-search-panel { position: absolute; z-index: 3; top: 100%; left: 0; right: 0; padding: 8px 16px 16px; background: #fff; border-top: 1px solid #edf0f2; box-shadow: 0 6px 12px #001d3414; color: #001d34; }
	.vamh-search:not([open]) > .vamh-search-panel { display: none; }
	.vamh-search-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 600; }
	body.vamh-active #masthead .vamh-search-close { display: none; }
	body.vamh-active #masthead .vamh-search.vamh-ready .vamh-search-close { display: flex; }
	.vamh-search-form { display: flex; align-items: stretch; gap: 8px; margin: 0; }
	body.vamh-active #masthead .vamh-search-form input[type=search] { width: 100%; min-width: 0; min-height: 44px; padding: 10px; border: 1px solid #8699a7; border-radius: 6px; font-size: 16px; background: #fff; color: #001d34; }
	.vamh-search-submit { min-height: 44px; padding: 10px 12px; border-radius: 6px; background: #001d34; color: #fff; font-size: 14px; }
	body.vamh-active #masthead .vamh-search-panel .dgwt-wcas-search-wrapp { display: block; width: 100%; max-width: none; margin: 0; }
	body.vamh-active #masthead .vamh-search-panel input[type=search] { font-size: 16px; }
	.vamh-announcement { display: block; padding: 7px 12px; background: #f5f1ec; color: #424a4f; text-align: center; }
	.vamh-announcement p { margin: 0; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
	html.vamh-mobile-root { scroll-padding-top: 90px; }
	/* Storefront reserves footer space here; its handheld bar is absent. */
	body.vamh-active .site-footer { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}
@media (max-width: 389px) {
	body.vamh-active #masthead .site-branding img { max-width: min(100%, 120px); }
}
@media (max-width: 359px) {
	body.vamh-active #masthead {
		column-gap: 2px;
		padding-right: max(10px, env(safe-area-inset-right));
		padding-left: max(10px, env(safe-area-inset-left));
	}
	body.vamh-active #masthead .site-branding img { max-width: min(100%, 104px); }
	body.vamh-active #masthead .vama-menu-toggle,
	body.vamh-active #masthead #site-navigation button.menu-toggle {
		gap: 5px;
		padding-right: 8px;
		padding-left: 8px;
		font-size: 13px;
	}
	body.vamh-active #masthead .vama-menu-toggle svg { width: 20px; height: 20px; }
	body.vamh-active #masthead #site-navigation button.menu-toggle { padding-left: 30px; }
}
@media (min-width: 601px) and (max-width: 767px) {
	body.admin-bar.vamh-active.vamh-sticky #masthead { top: 46px; }
	html.vamh-mobile-root:has(.admin-bar) { scroll-padding-top: 136px; }
}
@media (prefers-reduced-motion: reduce) {
	.vamh-actions *, .vamh-search-panel { animation: none; transition: none; }
}
