/*
 * Navigation v2 (nav spec v1.2). Loaded only when the flag is on (includes/nav.php).
 * Every rule is scoped to body.nj-nav-v2 or the .njn block, so nothing reaches the rest of the site.
 * Values from the developer notes, section 4, and the design guide.
 */

/* ---------- Page offsets ----------
   Measured 30 Nov on live and staging: the current header (#masthead) is position: relative
   (in the normal flow, 120px high on desktop, 72px tablet, 44px phone) and live prints
   `html body { padding-top: 0 !important }`. So the page starts below the header and the header
   scrolls away. The v2 header keeps exactly that behaviour: in the flow, no body padding, so every
   page's first block sits right under the header as it does today. */

html body.nj-nav-v2 {
	padding-top: 0 !important;
}

/* style.css zooms html to 80% between 1501 and 1720px (the old dropdown cancelled it with zoom 125%).
   Cancel it for the new header so it keeps the spec sizes there: 80px bar, 16px links. */
@media (min-width: 1501px) and (max-width: 1720px) {
	body.nj-nav-v2 #masthead .njn {
		zoom: 1.25;
	}
}

/* Anchors on the solution pages (/systems/#system-types and others): the header is not fixed,
   so only a small breathing space is needed. Beats the plugin's values (120/72/51px), which
   stay for the flag off. */
body.nj-nav-v2 .nj-sp [id] {
	scroll-margin-top: 16px;
}

body.nj-nav-v2 #masthead.site-header {
	position: relative;
	top: auto;
	left: auto;
	right: auto;
	width: 100%;
	/* Spec: nav 100, mega menu 99 (set on .njn-bar and .njn-panel below). The header box keeps
	   the old stacking level so page blocks that use z-index 100 or 101 never paint over the
	   open mega menu. */
	z-index: 1000;
	background: #fff;
}

/* Body scroll lock while the mobile menu is open (own class, not overflow-stacked). */
html.njn-locked,
html.njn-locked body.nj-nav-v2 {
	overflow: hidden !important;
}

html.njn-locked body.nj-nav-v2 .fixed-cart {
	visibility: hidden;
}

/* ---------- Base and resets inside the block ----------
   Resets use :where() so they weigh one class: every component rule below wins over them,
   and they still beat the theme's bare element rules (button padding, borders). */

.njn {
	font-family: "Mulish", sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	color: #111111;
	text-align: left;
}

.njn *,
.njn *::before,
.njn *::after {
	box-sizing: border-box;
}

.njn [hidden] {
	display: none !important;
}

.njn :where(ul, li) {
	list-style: none;
	margin: 0;
	padding: 0;
}

.njn :where(p) {
	margin: 0;
}

.njn :where(a) {
	text-decoration: none;
	transition: none;
}

.njn :where(button) {
	-webkit-appearance: none;
	appearance: none;
	background: none;
	border: 0;
	border-radius: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	line-height: inherit;
	color: inherit;
	cursor: pointer;
	transition: none;
	text-align: left;
}

.njn :where(button):hover {
	border-color: transparent;
}

.njn svg {
	flex: none;
	display: block;
}

/* Visible keyboard focus: 2px #FF6900, 2px offset (spec; the theme sets outline none !important on
   buttons), plus a 1px #111111 ring on the element edge. #FF6900 on white is only 2.89:1, the #111 ring
   is 18:1 on white and #F4F4F2, so the indicator meets WCAG 2.1 SC 1.4.11 (3:1). On the #111 strip
   the orange itself is 6.4:1. */
.njn a:focus-visible,
.njn button:focus-visible,
.njn [role="option"]:focus-visible,
.njn [role="listbox"]:focus-visible {
	outline: 2px solid #FF6900 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 1px #111111 !important;
}

/* Elements that already have a box-shadow keep it next to the ring. */
.njn .njn-m-trigger.is-current:focus-visible,
.njn .njn-m-top-link.is-current:focus-visible {
	box-shadow: inset 3px 0 0 #FF6900, 0 0 0 1px #111111 !important;
}

.njn .njn-region-list:focus-visible {
	box-shadow: 0 0 0 1px #111111, 0 18px 40px rgba(0, 0, 0, 0.28) !important;
}

.njn .njn-region--m .njn-region-list:focus-visible {
	box-shadow: 0 0 0 1px #111111 !important;
}

.njn a:focus:not(:focus-visible),
.njn button:focus:not(:focus-visible) {
	outline: none;
}

/* ---------- Bar ---------- */

.njn-bar {
	position: relative;
	z-index: 100;
	background: #FFFFFF;
	box-shadow: 0 1px 0 #E6E6E4;
}

.njn-inner {
	display: flex;
	align-items: center;
	max-width: 1288px;
	height: 80px;
	margin: 0 auto;
	padding: 0 24px;
}

.njn-logo {
	display: inline-flex;
	align-items: center;
	flex: none;
	line-height: 0;
	color: #111111;
}

.njn-logo-img {
	display: block;
	width: auto;
	height: 36px;
	max-width: 190px;
}

.njn-logo-text {
	font-family: "Jost", sans-serif;
	font-size: 24px;
	font-weight: 600;
	line-height: 1;
}

.njn-nav {
	flex: 1 1 auto;
	align-self: stretch;
	margin-left: 28px;
}

.njn-list {
	display: flex;
	align-items: stretch;
	height: 100%;
}

.njn-item {
	display: flex;
}

.njn-top {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 100%;
	padding: 0 14px;
	font-family: "Mulish", sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	color: #111111;
	white-space: nowrap;
}

.njn .njn-top:hover,
.njn .njn-trigger[aria-expanded="true"] {
	color: #B84A00;
}

.njn-top::after {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 0;
	height: 3px;
	background: transparent;
}

/* Active section (set server side by the request path). */
.njn-top.is-current::after {
	background: #FF6900;
}

.njn-caret {
	width: 10px;
	height: 6px;
}

.njn-trigger[aria-expanded="true"] .njn-caret,
.njn-m-trigger[aria-expanded="true"] .njn-caret,
.njn-region-btn[aria-expanded="true"] .njn-caret {
	transform: rotate(180deg);
}

.njn-right {
	display: flex;
	align-items: center;
	gap: 18px;
	flex: none;
	margin-left: auto;
}

.njn .njn-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	border-radius: 4px;
	background: #FF6900;
	color: #111111;
	font-family: "Mulish", sans-serif;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
}

.njn .njn-cta:hover {
	background: #E65F00;
	color: #111111;
}

.njn-burger {
	display: none;
}

/* ---------- Region selector (quiet text control) ---------- */

.njn-region {
	position: relative;
}

.njn .njn-region-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 4px;
	color: #333333;
	font-size: 15px;
	font-weight: 500;
	white-space: nowrap;
}

/* "Region: " is visible in the mobile menu only; on desktop it stays for screen readers. */
.njn-region--d .njn-region-prefix {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.njn .njn-region-btn:hover,
.njn .njn-region-btn[aria-expanded="true"] {
	color: #B84A00;
}

.njn-region-list {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 101;
	min-width: 210px;
	padding: 6px;
	background: #FFFFFF;
	border: 1px solid #E6E6E4;
	border-radius: 4px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.njn .njn-region-option {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0 12px;
	border-radius: 4px;
	color: #111111;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
}

.njn .njn-region-option:hover,
.njn .njn-region-option:focus {
	background: #F4F4F2;
	color: #B84A00;
}

.njn .njn-region-option[aria-selected="true"] {
	font-weight: 700;
}

/* ---------- Mega menu panel ---------- */

.njn-panel {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 99;
	max-height: calc(100vh - 80px);
	overflow-y: auto;
	background: #FFFFFF;
	border-top: 1px solid #E6E6E4;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
	/* keep the shadow off the bar above */
	clip-path: inset(0 -60px -80px -60px);
}

.njn-panel-inner {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	max-width: 1240px;
	margin: 0 auto;
	padding: 36px 40px 32px;
}

.njn-cols-1 { grid-template-columns: minmax(0, 1fr); }
.njn-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.njn-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.njn-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.njn-col {
	min-width: 0;
	padding: 0 32px;
}

.njn-col:first-child {
	padding-left: 0;
}

.njn-col:last-child {
	padding-right: 0;
}

.njn-col + .njn-col {
	border-left: 1px solid #E6E6E4;
}

.njn .njn-heading {
	margin: 0 0 7px;
	font-family: "Jost", sans-serif;
	font-size: 11px; /* Aubrey 2 Dec: 11px, weight 500, 1px tracking */
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #5F5F5F;
}

.njn .njn-nudge {
	margin: 7px 0 12px;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.5;
	color: #333333;
}

.njn .njn-link {
	display: block;
	margin: 0 -10px;
	padding: 7px 10px;
	border-radius: 4px;
	color: #111111;
}

.njn-title {
	display: block;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: #111111;
}

.njn-desc {
	display: block;
	margin-top: 2px;
	font-size: 13.5px;
	font-weight: 400;
	line-height: 1.4;
	color: #666666;
}

.njn-link--plain .njn-title {
	font-size: 15px;
	font-weight: 500;
	color: #333333;
}

.njn-link--sku .njn-title {
	font-size: 15px;
	font-weight: 400;
	color: #333333;
}

.njn .njn-link:hover,
.njn .njn-link:focus-visible {
	background: #F4F4F2;
}

.njn .njn-link:hover .njn-title,
.njn .njn-link:focus-visible .njn-title {
	color: #B84A00;
}

.njn-links--sku {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 20px;
}

.njn-divider {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #E6E6E4;
}

/* Signpost strip: 50px, #111, white 14px/500, link #FF6900 600, no orange bar. */
.njn-strip {
	background: #111111;
}

.njn-strip-inner {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 10px;
	max-width: 1240px;
	min-height: 50px;
	margin: 0 auto;
	padding: 0 40px;
	color: #FFFFFF;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
}

.njn .njn-strip-link {
	color: #FF6900;
	font-weight: 600;
}

.njn .njn-strip-link:hover {
	color: #FF6900;
	text-decoration: underline;
}

/* ---------- Mobile overlay (hidden on desktop) ---------- */

.njn-mobile {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 110;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	background: #FFFFFF;
}

body.admin-bar .njn-mobile {
	top: 46px;
}

@media (min-width: 783px) {
	body.admin-bar .njn-mobile {
		top: 32px;
	}
}

.njn-m-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: none;
	height: 64px;
	padding: 0 16px;
	border-bottom: 1px solid #E6E6E4;
}

.njn-m-top .njn-logo-img {
	height: 30px;
}

.njn .njn-m-close,
.njn .njn-burger {
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-right: -10px;
	color: #111111;
	text-align: center;
}

.njn .njn-m-close {
	display: inline-flex;
}

.njn-m-nav {
	flex: none;
	padding: 4px 16px 8px;
}

.njn-m-item {
	border-bottom: 1px solid #E6E6E4;
}

.njn .njn-m-trigger,
.njn .njn-m-top-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 56px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	color: #111111;
}

.njn .njn-m-trigger.is-current,
.njn .njn-m-top-link.is-current {
	box-shadow: inset 3px 0 0 #FF6900;
	padding-left: 12px;
}

.njn .njn-m-trigger[aria-expanded="true"] {
	color: #B84A00;
}

.njn-m-panel {
	padding: 0 0 16px;
}

.njn .njn-m-sub {
	margin: 12px 0 2px;
	font-family: "Jost", sans-serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	color: #5F5F5F;
}

.njn .njn-m-link {
	display: flex;
	align-items: center;
	min-height: 44px;
	margin: 0 -8px;
	padding: 6px 8px;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.3;
	color: #111111;
}

.njn .njn-m-link:hover {
	background: #F4F4F2;
	color: #B84A00;
}

.njn-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 4px 0 10px;
}

.njn .njn-chips li {
	display: block;
}

.njn .njn-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 64px;
	min-height: 44px;
	padding: 0 14px;
	border-radius: 4px;
	background: #F4F4F2;
	font-size: 15px;
	font-weight: 500;
	color: #333333;
}

.njn .njn-chip:hover {
	color: #B84A00;
}

.njn-m-foot {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: auto;
	padding: 16px 16px 24px;
	border-top: 1px solid #E6E6E4;
}

.njn-region--m .njn-region-btn {
	width: 100%;
}

.njn-region--m .njn-region-list {
	position: static;
	margin-top: 4px;
	box-shadow: none;
}

.njn .njn-cta--m {
	width: 100%;
	min-height: 48px;
}

/* ---------- Breakpoints ---------- */

@media (min-width: 1025px) {
	.njn-mobile {
		display: none !important;
	}
}

/* Narrow desktops: tighter spacing so the globe and the region name (spec: "Globe and region
   name") fit beside the links, even for the longest name, United Kingdom. */
@media (min-width: 1025px) and (max-width: 1279px) {
	.njn-inner {
		padding: 0 16px;
	}

	.njn-nav {
		margin-left: 12px;
	}

	.njn-top {
		gap: 5px;
		padding: 0 8px;
		font-size: 15px;
	}

	.njn-top::after {
		left: 8px;
		right: 8px;
	}

	.njn-right {
		gap: 8px;
	}

	.njn .njn-region-btn {
		gap: 5px;
		padding: 0 2px;
		font-size: 14px;
	}

	.njn .njn-cta {
		padding: 0 14px;
	}

	.njn-logo-img {
		max-width: 140px;
	}

	.njn-panel-inner {
		padding: 36px 24px 32px;
	}

	.njn-col {
		padding: 0 24px;
	}

	.njn-strip-inner {
		padding: 0 24px;
	}
}

@media (max-width: 1024px) {
	.njn-inner {
		height: 64px;
		padding: 0 16px;
	}

	.njn-logo-img {
		height: 30px;
	}

	.njn-nav,
	.njn-right > .njn-region,
	.njn-right > .njn-cta {
		display: none;
	}

	.njn .njn-burger {
		display: inline-flex;
	}

	.njn-panel {
		display: none !important;
	}
}
