/* ==========================================================================
   Header — Top bar, navigation, mobile menu, alert banner
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ALERT BANNER — Dismissible, full-width, above header
   -------------------------------------------------------------------------- */

.alert-banner {
	background-color: var(--color-accent);
	color: var(--color-dark);
	padding: var(--space-sm) 0;
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	position: relative;
	z-index: var(--z-sticky);
}

.alert-banner__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-md);
}

.alert-banner__message {
	text-align: center;
	flex: 1;
}

.alert-banner__message a {
	color: var(--color-dark);
	font-weight: var(--weight-semibold);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.alert-banner__message a:hover {
	color: var(--color-primary);
}

.alert-banner__dismiss {
	background: none;
	border: none;
	cursor: pointer;
	padding: var(--space-xs);
	color: var(--color-dark);
	line-height: 1;
	flex-shrink: 0;
	border-radius: var(--radius-sm);
	transition: opacity var(--transition-base);
}

.alert-banner__dismiss:hover {
	opacity: 0.7;
}

.alert-banner__dismiss:focus-visible {
	outline: 2px solid var(--color-dark);
	outline-offset: 2px;
}

.alert-banner[hidden] {
	display: none;
}

/* --------------------------------------------------------------------------
   2. SITE HEADER — Wrapper
   -------------------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: var(--z-sticky);
	background-color: var(--color-bg);
	box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   3. TOP BAR — Logo, search, basket, login
   -------------------------------------------------------------------------- */

.top-bar {
	background-color: var(--color-primary);
	color: var(--color-bg);
	padding: var(--space-sm) 0;
}

.top-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-md);
}

/* Logo */
.top-bar__logo {
	flex-shrink: 0;
}

.top-bar__logo a {
	display: flex;
	align-items: center;
	text-decoration: none;
	color: var(--color-bg);
	gap: var(--space-sm);
}

.top-bar__logo-text {
	font-family: var(--font-heading);
	font-size: var(--text-xl);
	font-weight: var(--weight-extrabold);
	line-height: var(--leading-tight);
	letter-spacing: -0.01em;
	white-space: nowrap;
}

@media (min-width: 768px) {
	.top-bar__logo-text {
		font-size: var(--text-2xl);
	}
}

.top-bar__logo-strapline {
	display: none;
	font-family: var(--font-body);
	font-size: var(--text-xs);
	font-weight: var(--weight-regular);
	opacity: 0.8;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

@media (min-width: 1024px) {
	.top-bar__logo-strapline {
		display: block;
	}
}

/* Search — hidden on mobile, visible on desktop */
.top-bar__search {
	display: none;
	flex: 1;
	max-width: 320px;
}

@media (min-width: 768px) {
	.top-bar__search {
		display: block;
	}
}

.top-bar__search-form {
	display: flex;
	position: relative;
}

.top-bar__search-input {
	width: 100%;
	padding: 0.5em 0.75em;
	padding-right: 2.5em;
	font-size: var(--text-sm);
	background-color: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: var(--radius-sm);
	color: var(--color-bg);
	transition: background-color var(--transition-base), border-color var(--transition-base);
}

.top-bar__search-input::placeholder {
	color: rgba(255, 255, 255, 0.7);
}

.top-bar__search-input:focus {
	outline: none;
	background-color: rgba(255, 255, 255, 0.25);
	border-color: var(--color-accent);
	box-shadow: 0 0 0 2px rgba(232, 163, 61, 0.3);
}

.top-bar__search-submit {
	position: absolute;
	right: 0.5em;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: rgba(255, 255, 255, 0.8);
	padding: var(--space-xs);
	line-height: 1;
	border-radius: var(--radius-sm);
}

.top-bar__search-submit:hover {
	color: var(--color-bg);
}

.top-bar__search-submit:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

/* Actions group — basket and login */
.top-bar__actions {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	flex-shrink: 0;
}

@media (min-width: 768px) {
	.top-bar__actions {
		gap: var(--space-md);
	}
}

/* Basket icon */
.header-basket {
	position: relative;
}

.header-basket__link {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	text-decoration: none;
	color: var(--color-bg);
	padding: var(--space-xs);
	border-radius: var(--radius-sm);
	transition: opacity var(--transition-base);
}

.header-basket__link:hover {
	opacity: 0.85;
	color: var(--color-bg);
}

.header-basket__link:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

.header-basket__icon {
	position: relative;
}

.header-basket__count {
	position: absolute;
	top: -6px;
	right: -8px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	font-size: 11px;
	font-weight: var(--weight-bold);
	line-height: 18px;
	text-align: center;
	background-color: var(--color-accent);
	color: var(--color-dark);
	border-radius: var(--radius-full);
}

.header-basket__count:empty,
.header-basket__count[data-count="0"] {
	display: none;
}

.header-basket__info {
	display: none;
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
}

@media (min-width: 768px) {
	.header-basket__info {
		display: flex;
		flex-direction: column;
		line-height: var(--leading-tight);
	}
}

.header-basket__label {
	font-size: var(--text-xs);
	opacity: 0.8;
}

/* Login button */
.top-bar__login {
	display: none;
	padding: 0.4em 1em;
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	color: var(--color-bg);
	text-decoration: none;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: var(--radius-sm);
	transition: background-color var(--transition-base), border-color var(--transition-base);
}

@media (min-width: 768px) {
	.top-bar__login {
		display: inline-flex;
	}
}

.top-bar__login:hover {
	background-color: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.6);
	color: var(--color-bg);
}

.top-bar__login:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

/* Mobile hamburger toggle */
.mobile-menu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-xs);
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-bg);
	border-radius: var(--radius-sm);
}

@media (min-width: 1024px) {
	.mobile-menu-toggle {
		display: none;
	}
}

.mobile-menu-toggle:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   4. DESKTOP NAVIGATION — Below top bar
   -------------------------------------------------------------------------- */

.nav-bar {
	display: none;
	background-color: var(--color-bg);
	border-bottom: 1px solid var(--color-border);
}

@media (min-width: 1024px) {
	.nav-bar {
		display: block;
	}
}

.nav-bar__inner {
	display: flex;
	align-items: stretch;
	justify-content: flex-start;
}

/* Primary nav list */
.primary-nav {
	display: flex;
	list-style: none;
	padding: 0;
	margin: 0;
}

.primary-nav__item {
	position: relative;
}

.primary-nav__link {
	display: flex;
	align-items: center;
	gap: 0.3em;
	padding: 0.875em 1.25em;
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	text-decoration: none;
	color: var(--color-text);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border-bottom: 3px solid transparent;
	transition: color var(--transition-base), border-color var(--transition-base);
}

.primary-nav__link:hover,
.primary-nav__link[aria-current='page'] {
	color: var(--color-primary);
	border-bottom-color: var(--color-primary);
}

.primary-nav__link:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: -3px;
}

.primary-nav__link .icon-chevron {
	width: 12px;
	height: 12px;
	transition: transform var(--transition-base);
}

.primary-nav__item:hover .icon-chevron,
.primary-nav__item:focus-within .icon-chevron {
	transform: rotate(180deg);
}

/* Dropdown sub-menus */
.primary-nav__dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: var(--z-dropdown);
	min-width: 220px;
	background-color: var(--color-bg);
	border: 1px solid var(--color-border);
	border-top: 3px solid var(--color-primary);
	box-shadow: var(--shadow-lg);
	list-style: none;
	padding: var(--space-sm) 0;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity var(--transition-base),
		visibility var(--transition-base),
		transform var(--transition-base);
}

.primary-nav__item:hover > .primary-nav__dropdown,
.primary-nav__item:focus-within > .primary-nav__dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.primary-nav__dropdown-link {
	display: block;
	padding: 0.625em 1.25em;
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	text-decoration: none;
	color: var(--color-text);
	transition: background-color var(--transition-base), color var(--transition-base);
}

.primary-nav__dropdown-link:hover {
	background-color: var(--color-bg-soft);
	color: var(--color-primary);
}

.primary-nav__dropdown-link:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: -2px;
}

/* --------------------------------------------------------------------------
   5. MOBILE NAVIGATION — Fullscreen overlay
   -------------------------------------------------------------------------- */

.mobile-nav {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: var(--z-overlay);
	background-color: var(--color-primary);
	color: var(--color-bg);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	transform: translateX(100%);
	visibility: hidden;
}

@media (prefers-reduced-motion: no-preference) {
	.mobile-nav {
		transition: transform var(--transition-slow), visibility var(--transition-slow);
	}
}

.mobile-nav.is-open {
	transform: translateX(0);
	visibility: visible;
}

.mobile-nav__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-md) var(--container-padding);
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.mobile-nav__logo {
	font-family: var(--font-heading);
	font-size: var(--text-xl);
	font-weight: var(--weight-extrabold);
	color: var(--color-bg);
	text-decoration: none;
}

.mobile-nav__close {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-sm);
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-bg);
	border-radius: var(--radius-sm);
}

.mobile-nav__close:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

/* Mobile search */
.mobile-nav__search {
	padding: var(--space-md) var(--container-padding);
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.mobile-nav__search-form {
	display: flex;
	position: relative;
}

.mobile-nav__search-input {
	width: 100%;
	padding: 0.75em 1em;
	padding-right: 3em;
	font-size: var(--text-base);
	background-color: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: var(--radius-sm);
	color: var(--color-bg);
}

.mobile-nav__search-input::placeholder {
	color: rgba(255, 255, 255, 0.6);
}

.mobile-nav__search-input:focus {
	outline: none;
	border-color: var(--color-accent);
	box-shadow: 0 0 0 2px rgba(232, 163, 61, 0.3);
}

.mobile-nav__search-submit {
	position: absolute;
	right: 0.75em;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: rgba(255, 255, 255, 0.8);
	padding: var(--space-xs);
	border-radius: var(--radius-sm);
}

.mobile-nav__search-submit:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

/* Mobile nav links */
.mobile-nav__menu {
	list-style: none;
	padding: var(--space-md) 0;
	margin: 0;
}

.mobile-nav__link {
	display: block;
	padding: 0.875em var(--container-padding);
	font-size: var(--text-xl);
	font-weight: var(--weight-semibold);
	text-decoration: none;
	color: var(--color-bg);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	transition: background-color var(--transition-base);
}

.mobile-nav__link:hover {
	background-color: rgba(255, 255, 255, 0.08);
	color: var(--color-bg);
}

.mobile-nav__link:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: -2px;
}

/* Mobile sub-menus */
.mobile-nav__submenu {
	list-style: none;
	padding: 0;
	margin: 0;
	background-color: rgba(0, 0, 0, 0.15);
}

.mobile-nav__submenu-link {
	display: block;
	padding: 0.75em var(--container-padding);
	padding-left: calc(var(--container-padding) + var(--space-lg));
	font-size: var(--text-lg);
	font-weight: var(--weight-medium);
	text-decoration: none;
	color: rgba(255, 255, 255, 0.85);
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav__submenu-link:hover {
	color: var(--color-bg);
	background-color: rgba(255, 255, 255, 0.05);
}

.mobile-nav__submenu-link:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: -2px;
}

/* Mobile nav footer actions */
.mobile-nav__actions {
	padding: var(--space-lg) var(--container-padding);
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.mobile-nav__action-link {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	padding: 0.75em 1em;
	font-size: var(--text-base);
	font-weight: var(--weight-medium);
	text-decoration: none;
	color: var(--color-bg);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: var(--radius-sm);
	text-align: center;
	justify-content: center;
	transition: background-color var(--transition-base);
}

.mobile-nav__action-link:hover {
	background-color: rgba(255, 255, 255, 0.1);
	color: var(--color-bg);
}

.mobile-nav__action-link:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

/* Body scroll lock when mobile nav is open */
body.mobile-nav-open {
	overflow: hidden;
}
