/**
 * Phase 5.3B â€” Global header & mobile chrome.
 * Structural density inspired by the reference; Meridian tokens only.
 */

/* â€”â€” Tokens (local to chrome) â€”â€” */
:root {
	--nds-utility-h: 2.5rem;
	--nds-main-header-h: 5.25rem;
	--nds-bottom-bar-h: 3.75rem;
	--nds-header-sticky-shadow: 0 6px 18px rgba(10, 31, 40, 0.08);
}

/* â€”â€” Skip link â€”â€” */
.nds-skip-link {
	position: absolute;
	left: var(--nds-space-3);
	top: 0;
	z-index: 1000;
	transform: translateY(-120%);
	padding: 0.55rem 0.9rem;
	background: var(--nds-color-ink);
	color: #fff;
	border-radius: var(--nds-radius-md);
	text-decoration: none;
	font-weight: 600;
}

.nds-skip-link:focus,
.nds-skip-link:focus-visible {
	transform: translateY(0.5rem);
	outline: 2px solid var(--nds-color-focus);
	outline-offset: 2px;
}

/* â€”â€” Site header shell â€”â€” */
.nds-site-header {
	position: sticky;
	top: 0;
	z-index: 200;
	background: var(--nds-color-surface);
	border-bottom: 1px solid var(--nds-color-border);
	transition: box-shadow var(--nds-dur) var(--nds-ease);
}

.nds-site-header.is-scrolled {
	box-shadow: var(--nds-header-sticky-shadow);
}

/* Admin bar clearance (sticky, no layout jump) */
.admin-bar .nds-site-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .nds-site-header {
		top: 46px;
	}
}

/* â€”â€” Utility row â€”â€” */
.nds-utility-bar {
	display: none;
	min-height: var(--nds-utility-h);
	background: var(--nds-color-paper);
	border-bottom: 1px solid var(--nds-color-border);
	font-size: var(--nds-fs-xs);
}

.nds-utility-bar__inner {
	display: flex;
	align-items: center;
	min-height: var(--nds-utility-h);
}

.nds-utility-bar__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nds-utility-bar__list li + li::before {
	content: "";
	display: inline-block;
	width: 1px;
	height: 0.85rem;
	margin: 0 0.85rem;
	background: var(--nds-color-border);
	vertical-align: middle;
}

.nds-utility-bar__list a {
	color: var(--nds-color-muted);
	text-decoration: none;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.nds-utility-bar__list a:hover,
.nds-utility-bar__list a:focus-visible {
	color: var(--nds-color-teal-deep);
}

/* â€”â€” Main header row â€”â€” */
.nds-site-header__main {
	background: var(--nds-color-surface);
}

.nds-site-header__inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--nds-space-3);
	min-height: var(--nds-main-header-h);
	padding-block: 0.65rem;
}

.nds-brand {
	display: inline-flex;
	align-items: center;
	gap: var(--nds-space-3);
	min-width: 0;
	text-decoration: none;
	color: var(--nds-color-ink);
}

.nds-brand__mark {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 2.55rem;
	height: 2.55rem;
	border-radius: var(--nds-radius-md);
	background: var(--nds-color-ink);
	color: #fff;
	font-family: var(--nds-font-display);
	font-weight: 700;
	font-size: var(--nds-fs-xs);
	letter-spacing: 0.04em;
}

.nds-brand__text {
	min-width: 0;
}

.nds-brand__name {
	display: block;
	font-family: var(--nds-font-brand);
	font-weight: 600;
	font-size: clamp(0.95rem, 1.5vw, 1.2rem);
	line-height: 1.2;
	max-width: 11.5rem;
}

.nds-header-center {
	display: none;
	align-items: center;
	gap: var(--nds-space-3);
	min-width: 0;
}

.nds-header-tools {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.35rem;
	flex-shrink: 0;
}

/* â€”â€” Category trigger + panel â€”â€” */
.nds-cat-menu {
	position: relative;
	flex: 0 0 auto;
}

.nds-cat-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	min-height: 2.65rem;
	padding: 0 1rem;
	border: 0;
	border-radius: 999px;
	background: var(--nds-color-teal);
	color: #fff;
	font: inherit;
	font-size: var(--nds-fs-sm);
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
}

.nds-cat-trigger:hover,
.nds-cat-trigger:focus-visible {
	background: var(--nds-color-teal-deep);
}

.nds-cat-trigger[aria-expanded="true"] {
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.nds-cat-trigger__icon {
	display: grid;
	place-items: center;
}

.nds-cat-trigger__icon .nds-icon {
	width: 1.1rem;
	height: 1.1rem;
}

.nds-cat-panel {
	position: absolute;
	top: calc(100% + 0.55rem);
	left: 0;
	z-index: 240;
	width: min(22rem, 80vw);
	padding: 0.55rem;
	border: 1px solid var(--nds-color-border);
	border-radius: var(--nds-radius-lg);
	background: var(--nds-color-surface);
	box-shadow: var(--nds-shadow-md);
}

.nds-cat-panel[hidden] {
	display: none !important;
}

.nds-cat-panel__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.15rem;
}

.nds-cat-panel__list a {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.7rem 0.8rem;
	border-radius: var(--nds-radius-md);
	color: var(--nds-color-ink);
	text-decoration: none;
	font-weight: 600;
	font-size: var(--nds-fs-sm);
}

.nds-cat-panel__list a:hover,
.nds-cat-panel__list a:focus-visible {
	background: var(--nds-color-teal-soft);
	color: var(--nds-color-teal-deep);
}

.nds-cat-panel__icon {
	display: grid;
	place-items: center;
	color: var(--nds-color-teal);
}

.nds-cat-panel__icon .nds-icon {
	width: 1.15rem;
	height: 1.15rem;
}

/* â€”â€” Pill search â€”â€” */
.nds-search-pill {
	display: flex;
	align-items: center;
	gap: 0;
	flex: 1 1 auto;
	min-width: 0;
	max-width: 28rem;
	height: 2.65rem;
	border: 1px solid var(--nds-color-border);
	border-radius: 999px;
	background: var(--nds-color-paper);
	overflow: hidden;
}

.nds-search-pill__icon {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	padding-left: 0.85rem;
	color: var(--nds-color-muted);
}

.nds-search-pill__icon .nds-icon {
	width: 1.1rem;
	height: 1.1rem;
}

.nds-search-pill input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	border: 0;
	background: transparent;
	padding: 0 0.65rem;
	font: inherit;
	font-size: var(--nds-fs-sm);
	color: var(--nds-color-ink);
}

.nds-search-pill input[type="search"]::placeholder {
	color: var(--nds-color-muted);
}

.nds-search-pill input[type="search"]:focus {
	outline: none;
}

.nds-search-pill:focus-within {
	border-color: var(--nds-color-teal);
	box-shadow: 0 0 0 3px rgba(15, 107, 117, 0.15);
}

.nds-search-pill__submit {
	flex: 0 0 auto;
	height: 100%;
	border: 0;
	border-left: 1px solid var(--nds-color-border);
	background: var(--nds-color-surface);
	color: var(--nds-color-ink);
	font: inherit;
	font-size: var(--nds-fs-sm);
	font-weight: 700;
	padding: 0 1.05rem;
	cursor: pointer;
}

.nds-search-pill__submit:hover,
.nds-search-pill__submit:focus-visible {
	background: var(--nds-color-teal-soft);
	color: var(--nds-color-teal-deep);
}

.nds-search-pill--desktop {
	display: none;
}

.nds-search-pill--mobile {
	max-width: none;
	width: 100%;
	margin: 0;
}

/* â€”â€” Account / cart / icon buttons â€”â€” */
.nds-header-link,
.nds-header-cart,
.nds-header-icon-btn,
.nds-menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	min-width: var(--nds-touch);
	min-height: var(--nds-touch);
	padding: 0 0.55rem;
	border: 0;
	border-radius: var(--nds-radius-md);
	background: transparent;
	color: var(--nds-color-ink);
	text-decoration: none;
	font: inherit;
	font-size: var(--nds-fs-sm);
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.nds-header-link:hover,
.nds-header-link:focus-visible,
.nds-header-cart:hover,
.nds-header-cart:focus-visible,
.nds-header-icon-btn:hover,
.nds-header-icon-btn:focus-visible,
.nds-menu-toggle:hover,
.nds-menu-toggle:focus-visible {
	background: var(--nds-color-paper-deep);
	color: var(--nds-color-teal-deep);
}

.nds-header-cart {
	position: relative;
	border-radius: 999px;
	background: var(--nds-color-teal-soft);
	padding-inline: 0.75rem;
}

.nds-header-cart__icon {
	display: grid;
	place-items: center;
}

.nds-cart-count {
	display: inline-grid;
	place-items: center;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 0.3rem;
	border-radius: 999px;
	background: var(--nds-color-teal);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
}

.nds-header-cart .nds-cart-count {
	position: absolute;
	top: 0.15rem;
	right: 0.15rem;
}

.nds-menu-toggle {
	border: 1px solid var(--nds-color-border);
	background: var(--nds-color-surface);
}

.nds-menu-toggle--header {
	order: 0;
}

.nds-header-icon-btn--search-mobile {
	display: inline-flex;
}

.nds-header-link__text {
	display: none;
}

.nds-mobile-search-panel {
	display: none;
	border-top: 1px solid var(--nds-color-border);
	background: var(--nds-color-paper);
	padding: 0.75rem 0;
}

.nds-mobile-search-panel.is-open,
.nds-mobile-search-panel:not([hidden]) {
	display: block;
}

.nds-mobile-search-panel[hidden] {
	display: none !important;
}

/* â€”â€” Mobile drawer â€”â€” */
.nds-mobile-drawer[hidden] {
	display: none !important;
}

.nds-mobile-drawer {
	position: fixed;
	inset: 0;
	z-index: 400;
}

.nds-mobile-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 31, 40, 0.45);
}

.nds-mobile-drawer__panel {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: min(22rem, 88vw);
	height: 100%;
	background: var(--nds-color-surface);
	box-shadow: var(--nds-shadow-md);
	padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
	overflow: auto;
}

.admin-bar .nds-mobile-drawer__panel {
	padding-top: calc(1rem + 32px);
}

@media screen and (max-width: 782px) {
	.admin-bar .nds-mobile-drawer__panel {
		padding-top: calc(1rem + 46px);
	}
}

.nds-mobile-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--nds-space-3);
	margin-bottom: var(--nds-space-4);
}

.nds-mobile-drawer__title {
	margin: 0;
	font-family: var(--nds-font-brand);
	font-size: var(--nds-fs-lg);
	font-weight: 600;
	color: var(--nds-color-ink);
}

.nds-mobile-drawer__close {
	display: inline-grid;
	place-items: center;
	min-width: var(--nds-touch);
	min-height: var(--nds-touch);
	border: 1px solid var(--nds-color-border);
	border-radius: var(--nds-radius-md);
	background: var(--nds-color-surface);
	cursor: pointer;
	color: var(--nds-color-ink);
}

.nds-mobile-drawer__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.2rem;
}

.nds-mobile-drawer__list a {
	display: block;
	padding: 0.85rem 0.75rem;
	border-radius: var(--nds-radius-md);
	color: var(--nds-color-ink);
	text-decoration: none;
	font-weight: 600;
}

.nds-mobile-drawer__list a:hover,
.nds-mobile-drawer__list a:focus-visible {
	background: var(--nds-color-teal-soft);
	color: var(--nds-color-teal-deep);
}

body.nds-drawer-open {
	overflow: hidden;
}

/* â€”â€” Bottom bar â€”â€” */
.nds-bottom-bar {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 300;
	grid-template-columns: repeat(3, 1fr);
	align-items: stretch;
	min-height: var(--nds-bottom-bar-h);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background: var(--nds-color-surface);
	border-top: 1px solid var(--nds-color-border);
	box-shadow: 0 -6px 18px rgba(10, 31, 40, 0.06);
}

.nds-bottom-bar__item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.2rem;
	min-height: var(--nds-touch);
	padding: 0.45rem 0.35rem;
	border: 0;
	background: transparent;
	color: var(--nds-color-ink);
	text-decoration: none;
	font: inherit;
	font-size: 0.7rem;
	font-weight: 700;
	cursor: pointer;
}

.nds-bottom-bar__item:hover,
.nds-bottom-bar__item:focus-visible {
	color: var(--nds-color-teal-deep);
	background: var(--nds-color-paper);
}

.nds-bottom-bar__icon {
	display: grid;
	place-items: center;
}

.nds-bottom-bar__icon .nds-icon {
	width: 1.25rem;
	height: 1.25rem;
}

.nds-bottom-bar__item--cart .nds-cart-count {
	position: absolute;
	top: 0.35rem;
	right: calc(50% - 1.55rem);
}

body.nds-has-header-chrome:not(.nds-hide-bottom-bar) {
	padding-bottom: 0;
}

body.nds-hide-bottom-bar .nds-bottom-bar {
	display: none !important;
}

/* â€”â€” Desktop (â‰¥1100px): reference-like two-level chrome â€”â€” */
@media (min-width: 1100px) {
	.nds-utility-bar {
		display: block;
	}

	.nds-site-header__inner {
		grid-template-columns: auto minmax(0, 1fr) auto;
		gap: var(--nds-space-4);
		min-height: var(--nds-main-header-h);
	}

	.nds-menu-toggle--header,
	.nds-header-icon-btn--search-mobile,
	.nds-mobile-search-panel,
	.nds-bottom-bar {
		display: none !important;
	}

	.nds-header-center {
		display: flex;
	}

	.nds-search-pill--desktop {
		display: flex;
		flex: 1 1 auto;
		max-width: 28rem;
	}

	.nds-brand__name {
		max-width: none;
		white-space: nowrap;
	}

	.nds-header-link__text {
		display: inline;
	}

	.nds-header-cart .nds-header-link__text {
		display: none;
	}

	.nds-header-cart {
		min-width: 2.85rem;
		min-height: 2.85rem;
		padding: 0;
	}

	.nds-header-cart .nds-cart-count {
		top: -0.1rem;
		right: -0.1rem;
	}
}

/* â€”â€” Tablet / mobile chrome (â‰¤1099px) â€”â€” */
@media (max-width: 1099px) {
	.nds-site-header__inner {
		grid-template-columns: auto minmax(0, 1fr) auto;
	}

	.nds-brand {
		justify-self: center;
	}

	.nds-header-center {
		display: none;
	}

	.nds-bottom-bar {
		display: grid;
	}

	body.nds-has-header-chrome:not(.nds-hide-bottom-bar) {
		padding-bottom: calc(var(--nds-bottom-bar-h) + env(safe-area-inset-bottom, 0px));
	}

	.nds-brand__name {
		max-width: 9.5rem;
	}
}

@media (max-width: 460px) {
	.nds-brand__name {
		max-width: 7.5rem;
		font-size: 0.92rem;
	}

	.nds-header-tools {
		gap: 0.1rem;
	}

	.nds-header-link--account .nds-header-link__text,
	.nds-header-cart .nds-header-link__text {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nds-site-header {
		transition: none;
	}
}

/* —— Phase 5.4 bookstore chrome —— */
.nds-utility-bar__inner {
	justify-content: space-between;
	gap: 1rem;
}

.nds-utility-bar__tools {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	font-weight: 650;
}

.nds-utility-bar__tools a {
	color: var(--nds-color-ink-soft);
	text-decoration: none;
}

.nds-utility-bar__tools a:hover,
.nds-utility-bar__tools a:focus-visible {
	color: var(--nds-color-teal-deep);
	text-decoration: underline;
}

.nds-utility-bar__cart {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.nds-commerce-nav {
	display: none;
	border-top: 1px solid var(--nds-color-border);
	background: #fff;
}

.nds-commerce-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.15rem 1.1rem;
	list-style: none;
	margin: 0;
	padding: 0.55rem 0;
}

.nds-commerce-nav__list a {
	display: inline-block;
	padding: 0.25rem 0;
	font-size: 0.86rem;
	font-weight: 650;
	color: var(--nds-color-ink);
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

.nds-commerce-nav__list a:hover,
.nds-commerce-nav__list a:focus-visible {
	color: var(--nds-color-teal-deep);
	border-bottom-color: var(--nds-color-teal);
}

@media (min-width: 1100px) {
	.nds-commerce-nav {
		display: block;
	}

	.nds-search-pill--desktop {
		max-width: 36rem;
	}
}

/* —— TEST BANKS brand lockup (Phase 5.4.1) —— */
.nds-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	text-decoration: none;
	color: var(--nds-color-ink);
	min-width: 0;
}

.nds-brand__icon {
	display: grid;
	flex: 0 0 auto;
}

.nds-brand-svg {
	display: block;
	width: 2.4rem;
	height: 2.4rem;
}

.nds-brand__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.15;
}

.nds-brand__name {
	font-family: var(--nds-font-brand);
	font-weight: 800;
	font-size: 1.05rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.nds-brand__tagline {
	display: none;
	font-size: 0.68rem;
	font-weight: 600;
	color: var(--nds-color-muted);
	margin-top: 0.15rem;
	white-space: nowrap;
}

.nds-brand--compact .nds-brand__tagline {
	display: none;
}

.nds-brand--on-dark,
.nds-brand--footer {
	color: #f4f7fa;
}

.nds-brand--footer .nds-brand__name {
	color: #f4f7fa;
}

@media (min-width: 1100px) {
	.nds-brand__tagline {
		display: block;
	}
	.nds-brand-svg {
		width: 2.65rem;
		height: 2.65rem;
	}
	.nds-brand__name {
		font-size: 1.15rem;
	}
}

/* Contact block */
.nds-contact-block__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.85rem;
}

.nds-contact-block__label {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--nds-color-muted);
	margin-bottom: 0.2rem;
}

.nds-address {
	font-style: normal;
	display: block;
	line-height: 1.45;
}

.nds-address__street::after {
	content: ", ";
}

.nds-contact-page {
	padding: 2rem 0 3rem;
}

.nds-contact-page__intro h1 {
	margin: 0.35rem 0 0.65rem;
	font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.nds-contact-page__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	margin-top: 1.5rem;
}

.nds-contact-page__card {
	background: #fff;
	border: 1px solid rgba(11, 31, 51, 0.08);
	border-radius: var(--nds-radius-lg);
	padding: 1.35rem 1.4rem;
	box-shadow: var(--nds-shadow-sm);
}

.nds-contact-page__topics {
	margin: 0 0 1rem;
	padding-left: 1.1rem;
	display: grid;
	gap: 0.45rem;
	color: var(--nds-color-muted);
}

@media (max-width: 768px) {
	.nds-contact-page__grid {
		grid-template-columns: 1fr;
	}
}

.nds-footer-brand__contact {
	margin-top: 1rem;
	display: grid;
	gap: 0.35rem;
	font-size: 0.9rem;
}

.nds-footer-brand__contact a {
	color: #d7eef0;
}

.nds-footer-brand__contact .nds-address {
	opacity: 0.9;
}

.nds-footer-delivery-note {
	margin-top: 1rem;
	font-size: 0.82rem;
	line-height: 1.45;
	opacity: 0.85;
}

.nds-story__icon {
	display: inline-grid;
	margin-bottom: 0.75rem;
}

.nds-story__icon .nds-brand-svg {
	width: 3.2rem;
	height: 3.2rem;
}

.nds-story__tag {
	display: block;
	margin-top: 0.35rem;
	opacity: 0.85;
	font-size: 0.9rem;
}
