/**
 * Compact floating sticky header (scroll replacement for full header).
 * Full .nds-site-header stays in normal document flow (not sticky).
 */

.nds-header-sentinel {
	width: 100%;
	height: 1px;
	margin: 0;
	padding: 0;
	pointer-events: none;
	visibility: hidden;
}

.nds-compact-header {
	--nds-compact-h: 56px;
	--nds-compact-inset: clamp(0.55rem, 1.6vw, 0.9rem);
	--nds-compact-radius: 16px;
	--nds-compact-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--nds-compact-dur: 210ms;
	position: fixed;
	z-index: 210;
	left: 0;
	right: 0;
	top: var(--nds-compact-inset);
	display: flex;
	justify-content: center;
	padding-inline: var(--nds-compact-inset);
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-0.55rem);
	transition:
		opacity var(--nds-compact-dur) var(--nds-compact-ease),
		transform var(--nds-compact-dur) var(--nds-compact-ease),
		visibility var(--nds-compact-dur) var(--nds-compact-ease);
}

.nds-compact-header.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.admin-bar .nds-compact-header {
	top: calc(32px + var(--nds-compact-inset));
}

@media screen and (max-width: 782px) {
	.admin-bar .nds-compact-header {
		top: calc(46px + var(--nds-compact-inset));
	}
}

.nds-compact-header__shell {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.65rem;
	width: min(100%, var(--nds-container, 72rem));
	min-height: var(--nds-compact-h);
	max-height: var(--nds-compact-h);
	padding: 0.2rem 0.45rem 0.2rem 0.7rem;
	border: 1px solid rgba(13, 101, 112, 0.14);
	border-radius: var(--nds-compact-radius);
	background: rgba(255, 255, 255, 0.92);
	box-shadow:
		0 1px 2px rgba(8, 36, 44, 0.04),
		0 10px 28px -14px rgba(8, 36, 44, 0.28);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.nds-compact-header .nds-brand--compact-bar {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	min-width: 0;
	text-decoration: none;
	color: inherit;
}

.nds-compact-header .nds-brand--compact-bar .nds-brand__icon,
.nds-compact-header .nds-brand--compact-bar .nds-brand-svg {
	width: 1.75rem;
	height: 1.75rem;
	flex-shrink: 0;
}

.nds-compact-header .nds-brand--compact-bar .nds-brand__name {
	font-size: 0.92rem;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.nds-compact-header .nds-brand--compact-bar .nds-brand__tagline {
	display: none !important;
}

.nds-compact-header__actions {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	flex-shrink: 0;
}

.nds-compact-header__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	border-radius: 0.7rem;
	background: transparent;
	color: #0a1a2a;
	text-decoration: none;
	cursor: pointer;
	transition: background 160ms var(--nds-compact-ease), color 160ms var(--nds-compact-ease);
}

.nds-compact-header__btn:hover,
.nds-compact-header__btn:focus-visible {
	background: rgba(13, 101, 112, 0.08);
	color: #0d6570;
}

.nds-compact-header__btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0d6570;
}

.nds-compact-header__btn .nds-icon,
.nds-compact-header__btn svg {
	width: 1.2rem;
	height: 1.2rem;
	display: block;
}

.nds-compact-header__btn--cart {
	padding-inline-end: 0.35rem;
}

.nds-compact-header__count {
	position: absolute;
	top: 0.35rem;
	right: 0.28rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.05rem;
	height: 1.05rem;
	padding: 0 0.22rem;
	border-radius: 999px;
	background: #0d6570;
	color: #fff;
	font-size: 0.625rem;
	font-weight: 700;
	line-height: 1;
}

.nds-compact-header__btn--menu {
	display: none;
}

@media (max-width: 1099px) {
	.nds-compact-header {
		--nds-compact-h: 54px;
		--nds-compact-radius: 15px;
	}

	.nds-compact-header__btn--menu {
		display: inline-flex;
	}
}

@media (max-width: 767px) {
	.nds-compact-header {
		--nds-compact-h: 52px;
		--nds-compact-inset: 0.45rem;
		--nds-compact-radius: 14px;
	}

	.nds-compact-header__shell {
		padding-inline: 0.45rem 0.3rem;
	}

	.nds-compact-header .nds-brand--compact-bar .nds-brand__text {
		display: none;
	}
}

@media (max-width: 430px) {
	.nds-compact-header {
		--nds-compact-h: 50px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nds-compact-header {
		transition: none;
		transform: none;
	}
}

/* PDP purchase sticky sits below compact header */
.nds-px-sticky,
.nds-pdp-sticky {
	z-index: 80;
}

html.nds-compact-header-active {
	--nds-compact-header-offset: calc(
		var(--nds-compact-inset, 0.55rem) + var(--nds-compact-h, 56px) + 0.55rem
	);
	/* Keep in-page anchors / focus targets out from under the floating bar. */
	scroll-padding-top: calc(var(--nds-compact-header-offset) + env(safe-area-inset-top, 0px));
}

html.nds-compact-header-active:has(body.admin-bar) {
	scroll-padding-top: calc(32px + var(--nds-compact-header-offset) + env(safe-area-inset-top, 0px));
}

@media screen and (max-width: 782px) {
	html.nds-compact-header-active:has(body.admin-bar) {
		scroll-padding-top: calc(46px + var(--nds-compact-header-offset) + env(safe-area-inset-top, 0px));
	}
}

@media (max-height: 500px) and (orientation: landscape) {
	.nds-compact-header {
		--nds-compact-h: 44px;
		--nds-compact-inset: 0.3rem;
	}

	.nds-compact-header__shell {
		min-height: var(--nds-compact-h);
		max-height: var(--nds-compact-h);
	}
}

/* Compact search reuses the existing panel as a floating overlay. */
html.nds-compact-header-active .nds-mobile-search-panel.is-open,
html.nds-compact-header-active .nds-mobile-search-panel:not([hidden]) {
	display: block !important;
	position: fixed;
	z-index: 220;
	left: max(0.55rem, env(safe-area-inset-left));
	right: max(0.55rem, env(safe-area-inset-right));
	top: calc(var(--nds-compact-inset, 0.75rem) + var(--nds-compact-h, 56px) + 0.45rem);
	width: auto;
	max-width: min(36rem, calc(100vw - 1.2rem));
	margin-inline: auto;
	padding: 0.75rem;
	border: 1px solid rgba(13, 101, 112, 0.14);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 14px 36px -18px rgba(8, 36, 44, 0.35);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

html.nds-compact-header-active body.admin-bar .nds-mobile-search-panel.is-open,
html.nds-compact-header-active body.admin-bar .nds-mobile-search-panel:not([hidden]) {
	top: calc(32px + var(--nds-compact-inset, 0.75rem) + var(--nds-compact-h, 56px) + 0.45rem);
}

@media screen and (max-width: 782px) {
	html.nds-compact-header-active body.admin-bar .nds-mobile-search-panel.is-open,
	html.nds-compact-header-active body.admin-bar .nds-mobile-search-panel:not([hidden]) {
		top: calc(46px + var(--nds-compact-inset, 0.75rem) + var(--nds-compact-h, 56px) + 0.45rem);
	}
}
