/*!
 * Syster P – header.css
 * Announcement bar, sticky header, mega menu, search drawer, mobile menu.
 */

/* -------------------------------------------------- Announcement bar */
.announcement-bar {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--announcement-height);
	padding: 0 var(--gutter);
	background-color: var(--color-white);
	color: var(--color-black);
	text-align: center;
}

.announcement-bar__text {
	font-size: var(--font-size-small);
	line-height: 1.3;
	letter-spacing: 0.04em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* -------------------------------------------------- Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: var(--z-header);
	width: 100%;
	height: var(--header-height);
	background-color: var(--color-white);
	border-bottom: 1px solid transparent;
	transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.site-header--transparent {
	background-color: transparent;
	color: var(--color-white);
	border-bottom-color: transparent;
}

/* Over the home hero: header floats above the first section */
.site-header--transparent {
	margin-bottom: calc(-1 * var(--header-height));
}

.site-header.is-scrolled,
.site-header--solid {
	background-color: var(--color-white);
	color: var(--color-black);
	border-bottom-color: var(--color-lightgrey);
}

/* Open mega menu: the transparent home header turns opaque white so the open
   panel/header sits on a solid bar instead of showing the hero through it.
   Closed state keeps the transparent hero header. */
.site-header.is-menu-open {
	background-color: var(--color-white) !important;
	color: var(--color-black);
	border-bottom-color: transparent;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.site-header__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	height: 100%;
	padding-left: 0;
}

/* --- hamburger (mobile only) */
.site-header__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-left: -10px;
	color: inherit;
}

/* --- primary nav */
.site-header__nav {
	display: flex;
	align-items: center;
	min-width: 0;
	padding-left: var(--gutter);
}

.primary-menu {
	display: flex;
	align-items: center;
	height: var(--header-height);
}

.primary-menu__item {
	position: static;
	display: flex;
	align-items: center;
	height: 100%;
	min-width: 110px;
}

.primary-menu__link {
	display: inline-flex;
	align-items: center;
	height: 100%;
	padding: 0;
	font-size: var(--font-size-body);
	font-weight: 500;
	letter-spacing: normal;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
	white-space: nowrap;
}

.primary-menu__item--has-panel.is-open > .primary-menu__link,
.primary-menu__item--has-panel:hover > .primary-menu__link {
	opacity: 0.7;
}

/* --- logo */
.site-header__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: inherit;
}

.site-header__logo-svg {
	width: 126px;
	height: 22px;
	fill: currentColor;
}

/* --- actions */
.site-header__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	height: 100%;
}

.header-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	height: 55px;
	padding: 0 16px;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
}

.header-action svg {
	width: 16px;
	height: 16px;
}

.header-action--search {
	width: 48px;
	margin-right: 31px;
}

.header-action--account {
	width: 48px;
	margin-right: 16px;
}

.header-action--cart {
	position: relative;
	width: 79px;
	padding-right: 30px;
}

.header-action__count {
	position: absolute;
	top: 12px;
	right: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 14px;
	height: 14px;
	font-size: 10px;
	line-height: 1;
	letter-spacing: 0;
}

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

/* -------------------------------------------------- Mega menu */
.mega-panel {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: var(--z-mega);
	padding: 40px var(--gutter) 50px;
	background-color: var(--color-white);
	color: var(--color-black);
	border-top: 1px solid var(--color-lightgrey);
	border-bottom: 1px solid var(--color-lightgrey);
	box-shadow: 0 18px 30px rgb(0 0 0 / 6%);
}

.mega-panel[hidden] {
	display: none !important;
}

.mega-panel__inner {
	display: flex;
	gap: var(--gutter-lg);
	max-width: var(--container-max);
	margin-inline: auto;
}

.mega-panel__columns {
	display: flex;
	flex: 1 1 auto;
	gap: 60px;
}

.mega-panel__col {
	min-width: 180px;
}

.mega-panel__promo {
	min-width: 200px;
	margin-left: auto;
}

.mega-panel__title {
	margin-bottom: 22px;
	font-size: var(--font-size-small);
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--color-grey);
}

.mega-panel__links {
	display: grid;
	gap: 12px;
}

.mega-panel__links a {
	font-size: var(--font-size-body);
	letter-spacing: 0.02em;
	line-height: 1.38;
}

.mega-panel__links a:hover,
.mega-panel__links a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.mega-overlay {
	position: fixed;
	inset: 0;
	top: var(--header-total);
	z-index: 90;
	background-color: rgb(0 0 0 / 8%);
	opacity: 0;
	transition: opacity 0.25s var(--ease);
}

.mega-overlay[hidden] {
	display: none !important;
}

.mega-overlay.is-open {
	opacity: 1;
}

/* -------------------------------------------------- Search drawer */
.search-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: var(--z-drawer);
	width: min(560px, 100%);
	padding: 24px var(--gutter) 40px;
	background-color: var(--color-white);
	color: var(--color-black);
	transform: translateX(100%);
	transition: transform 0.35s var(--ease);
	overflow-y: auto;
}

.search-drawer.is-open {
	transform: translateX(0);
}

.search-drawer[hidden] {
	display: block;
}

.drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 40px;
}

.drawer__title {
	font-weight: 500;
}

.drawer__close,
.mobile-menu__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-right: -12px;
	color: inherit;
}

.search-form__field {
	display: flex;
	align-items: center;
	border-bottom: 1px solid var(--color-black);
}

.search-form__field input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	padding: 18px 0;
	border: 0;
	font-size: var(--font-size-h3);
	line-height: 1.2;
	letter-spacing: 0.02em;
	background: transparent;
}

.search-form__field input[type="search"]::placeholder {
	color: var(--color-grey);
	opacity: 1;
}

.search-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--color-black);
}

.search-drawer__suggestions {
	margin-top: 42px;
}

.search-drawer__heading {
	margin-bottom: 18px;
	color: var(--color-grey);
	font-weight: 500;
}

.search-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.search-tags a {
	display: inline-flex;
	align-items: center;
	height: 32px;
	padding: 0 16px;
	border: 1px solid var(--color-lightgrey);
	font-size: var(--font-size-small);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.search-tags a:hover {
	border-color: var(--color-black);
}

/* -------------------------------------------------- Mobile menu */
.mobile-menu {
	position: fixed;
	inset: 0;
	z-index: var(--z-drawer);
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	background-color: var(--color-white);
	color: var(--color-black);
	transform: translateX(-100%);
	visibility: hidden;
	transition: transform 0.35s var(--ease), visibility 0.35s var(--ease);
	overflow: hidden;
}

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

.mobile-menu__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
	height: var(--header-height);
	padding: 0 var(--gutter);
	border-bottom: 1px solid var(--color-lightgrey);
}

.mobile-menu__logo-svg {
	width: 126px;
	height: 22px;
	fill: currentColor;
}

.mobile-menu__nav {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 10px var(--gutter) 30px;
	-webkit-overflow-scrolling: touch;
}

.mobile-menu__list > li {
	border-bottom: 1px solid var(--color-lightgrey);
}

.mobile-menu__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 18px 0;
	font-size: 1rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--color-black);
}

.mobile-menu__toggle-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
}

.mobile-menu__toggle-icon svg:last-child {
	display: none;
}

.mobile-menu__toggle[aria-expanded="true"] .mobile-menu__toggle-icon svg:first-child {
	display: none;
}

.mobile-menu__toggle[aria-expanded="true"] .mobile-menu__toggle-icon svg:last-child {
	display: block;
}

.mobile-menu__submenu {
	padding-bottom: 22px;
}

.mobile-menu__submenu[hidden] {
	display: none !important;
}

.mobile-menu__group-title {
	margin: 18px 0 8px;
	font-size: var(--font-size-small);
	line-height: 1.3;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--color-grey);
}

.mobile-menu__group {
	display: grid;
	gap: 12px;
}

.mobile-menu__group a,
.mobile-menu__link {
	font-size: var(--font-size-body);
	line-height: 1.38;
	letter-spacing: 0.02em;
}

.mobile-menu__link {
	display: block;
	padding: 18px 0;
	font-size: 1rem;
	font-weight: 500;
}

.mobile-menu__footer {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 22px var(--gutter) 30px;
	border-top: 1px solid var(--color-lightgrey);
}

.mobile-menu__utility {
	font-size: var(--font-size-body);
	letter-spacing: 0.02em;
}

/* -------------------------------------------------- Overlay */
.site-overlay {
	position: fixed;
	inset: 0;
	z-index: calc(var(--z-drawer) - 1);
	background-color: var(--color-backdrop);
	opacity: 0;
	transition: opacity 0.3s var(--ease);
}

.site-overlay[hidden] {
	display: none !important;
}

.site-overlay.is-open {
	opacity: 1;
}

/* -------------------------------------------------- Responsive */
@media (max-width: 1023px) {
	.site-header__inner {
		position: relative;
		grid-template-columns: auto 1fr auto;
		padding-right: 0;
	}

	.site-header__toggle {
		display: inline-flex;
		grid-column: 1;
	}

	.site-header__nav {
		display: none;
	}

	.site-header__logo {
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
	}

	.site-header__actions {
		grid-column: 3;
		justify-self: end;
	}

	.header-action {
		padding: 0 8px;
	}

	.header-action--search {
		width: 40px;
		margin-right: 0;
	}

	.header-action--account {
		width: 40px;
		margin-right: 0;
	}

	.header-action--cart {
		width: 52px;
		padding-right: 14px;
	}

	.header-action__count {
		top: 10px;
		right: 22px;
	}
}

@media (max-width: 767px) {
	.site-header__logo-svg {
		width: 108px;
		height: 19px;
	}

	.announcement-bar__text {
		font-size: 0.688rem;
	}
}
