/* ==========================================================================
   HDREY header: announcement bar (36px), tabs bar (60px black), centered logo
   header (106px desktop / 109px mobile), mega nav (>=1600px), drawer, search.
   Geometry measured against the reference at 1440 and 390.
   ========================================================================== */

/* --- Announcement / promo bar (always the first element) ------------------ */
.hd-announcement {
	position: relative;
	z-index: 103;
	background: #ffffff;
	color: #000000;
	border-bottom: 1px dashed #e1e1e1;
	overflow: hidden;
}
.hd-announcement__viewport {
	overflow: hidden;
	padding: 8px 0;
}
.hd-announcement__track {
	display: flex;
	align-items: center;
	width: max-content;
	animation: hd-announcement-scroll 30s linear infinite;
	will-change: transform;
}
.hd-announcement:hover .hd-announcement__track {
	animation-play-state: paused;
}
.hd-announcement__item {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: 0.02em;
}
.hd-announcement__item strong {
	font-weight: 700;
}
.hd-announcement__sep {
	display: block;
	width: 4px;
	height: 4px;
	margin: 0 40px;
	border-radius: 50%;
	background: #000;
	flex: 0 0 auto;
}
@keyframes hd-announcement-scroll {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
	.hd-announcement__track { animation: none; }
}

/* --- Header tabs bar (black, 60px, coloured pills) ------------------------ */
/* Smart sticky stack: tabs + header pin to the top together and translate out of
   view when the user scrolls down (shown again on any scroll up). */
.hd-sticky-stack {
	position: sticky;
	top: 0;
	z-index: 101;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}
.hd-sticky-stack.is-hidden {
	transform: translateY(-100%);
}
@media (prefers-reduced-motion: reduce) {
	.hd-sticky-stack {
		transition: none;
	}
}
.hd-tabs {
	position: relative;
	top: auto;
	z-index: 101;
	background: #000;
	height: var(--tabs-height);
}
.hd-tabs__inner {
	display: flex;
	align-items: stretch;
	max-width: var(--g-container);
	margin: 0 auto;
	padding: 0 var(--container-pad);
	height: var(--tabs-height);
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.hd-tabs__inner::-webkit-scrollbar {
	display: none;
}
.hd-tabs__pill {
	display: flex;
	align-items: center;
	height: var(--tabs-height);
	flex: 0 0 auto;
	padding: 4px 10px;
	background: var(--tab-bg, #000);
	color: var(--tab-color, #fff);
	border-left: 1px solid var(--tabs-border-color, #fff);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: 0.145em;
	text-transform: uppercase;
	white-space: nowrap;
	transition: opacity 0.2s ease;
}
.hd-tabs__pill:first-child {
	border-left: 0;
}
/* Reference pill metrics: first two pills are 2px wider than the tracked text width. */
.hd-tabs__pill:nth-child(1),
.hd-tabs__pill:nth-child(2) {
	padding-left: 11px;
	padding-right: 11px;
}
.hd-tabs__pill:hover,
.hd-tabs__pill:focus-visible {
	color: var(--tab-color, #fff);
	opacity: 0.85;
}

/* --- Main header ---------------------------------------------------------- */
.hd-header {
	position: relative;
	top: auto;
	z-index: 100;
	background: var(--header-background);
	color: var(--header-text);
}
.hd-header__bar {
	border-bottom: 0;
}
.hd-header__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 464px minmax(0, 1fr);
	align-items: center;
	max-width: var(--g-container);
	margin: 0 auto;
	padding: 16px var(--container-pad);
	min-height: 0;
}
.hd-header__left {
	display: flex;
	align-items: center;
	justify-self: start;
}
.hd-header__logo {
	display: flex;
	align-items: center;
	justify-content: center;
}
.hd-logo {
	display: inline-flex;
}
.hd-logo img {
	width: 140px;
	height: 53.8px;
	object-fit: contain;
}
.hd-header__right {
	display: flex;
	align-items: center;
	justify-self: end;
	justify-content: flex-end;
	gap: 0;
	width: 100%;
}
.hd-header__utils {
	display: flex;
	align-items: center;
	margin-left: auto;
}
.hd-icon-btn--search {
	display: none;
}
.hd-icon-btn--cart {
	position: relative;
	gap: 0;
	padding: 15px 9px;
}
.hd-drawer-toggle {
	padding: 15px 12px 15px 0;
}
.hd-icon-btn--account {
	padding: 15px 9px;
}
.hd-icon-btn--wishlist {
	padding: 15px 12px;
}
.hd-cart-count {
	position: absolute;
	top: 6px;
	right: 4px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 8px;
	background: #000;
	color: #fff;
	font-size: 10px;
	line-height: 16px;
	text-align: center;
	font-weight: 600;
}
.hd-cart-count[data-count='0'] {
	display: none;
}

/* Inline search (desktop) */
.hd-search-form {
	position: relative;
	display: flex;
	align-items: center;
	width: 334px;
	height: 49.3px;
	flex: 0 0 auto;
	padding: 2px 4px;
	background: #fff;
	border: 1px solid #000;
	border-radius: 24px;
}
.hd-search-form__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 38px;
	width: 38px;
	height: 100%;
	color: #000;
}
.hd-search-form__input {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	height: 100%;
	padding: 8px 10px 8px 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	color: var(--color-form-text);
	font-size: 15px;
	font-weight: 300;
	line-height: 1.6;
	-webkit-appearance: none;
	appearance: none;
}
.hd-search-form__input::placeholder {
	color: #6b6b6b;
	opacity: 1;
}
.hd-search-form__input:focus {
	outline: none;
}
.hd-search-form__submit {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

/* --- Desktop nav + mega menu (reference shows it from 1600px up) ---------- */
.hd-nav {
	display: none;
}
@media (min-width: 1600px) {
	.hd-nav {
		display: block;
		position: relative;
		border-top: 1px solid var(--header-border-color);
	}
	.hd-nav__inner {
		max-width: var(--g-container);
		margin: 0 auto;
		padding: 0 var(--container-pad);
	}
	.hd-nav__list {
		display: flex;
		align-items: stretch;
		justify-content: center;
	}
	.hd-nav__item {
		position: static;
	}
	.hd-nav__link {
		display: flex;
		align-items: center;
		padding: 22px 12px;
		font-size: 12px;
		font-weight: 400;
		line-height: 1.6;
		letter-spacing: 0.1em;
		text-transform: uppercase;
		white-space: nowrap;
		color: var(--header-text);
	}
	.hd-nav__link:hover,
	.hd-nav__item.is-open .hd-nav__link {
		color: var(--g-main-2);
	}
	.hd-nav__item.is-open .hd-nav__link {
		text-decoration: underline;
		text-underline-offset: 6px;
	}
	.hd-icon-btn--search,
	.hd-drawer-toggle {
		display: none;
	}

	/* Mega panel */
	.hd-mega {
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		background: #fff;
		color: #000;
		box-shadow: 0 18px 30px rgba(0, 0, 0, 0.08);
		border-top: 1px solid var(--header-border-color);
		opacity: 0;
		visibility: hidden;
		transform: translateY(6px);
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
		z-index: 5;
	}
	.hd-nav__item.is-open .hd-mega {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}
	.hd-mega__inner {
		display: flex;
		gap: 40px;
		max-width: 1380px;
		margin: 0 auto;
		padding: 32px 30px 24px;
	}
	.hd-mega__cols {
		flex: 1 1 auto;
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 24px 30px;
	}
	.hd-mega__title {
		display: block;
		margin: 0 0 10px;
		font-size: 14px;
		font-weight: 400;
		line-height: 1.4;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: #000;
	}
	.hd-mega__title:hover {
		color: var(--g-main-2);
	}
	.hd-mega__links li {
		line-height: 1.4;
	}
	.hd-mega__links a {
		display: inline-block;
		padding: 4px 0;
		font-size: 14px;
		font-weight: 300;
		color: #333;
	}
	.hd-mega__links a:hover {
		color: #000;
		text-decoration: underline;
		text-underline-offset: 3px;
	}
	.hd-mega__feature {
		flex: 0 0 300px;
	}
	.hd-mega__feature-card {
		display: block;
	}
	.hd-mega__feature-media {
		display: block;
		position: relative;
		padding-top: 125%;
		overflow: hidden;
		background: #f4f4f4;
	}
	.hd-mega__feature-media img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
	.hd-mega__feature-label {
		display: block;
		margin-top: 12px;
		font-size: 14px;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		text-align: center;
	}
}

/* --- Overlay -------------------------------------------------------------- */
.hd-overlay {
	position: fixed;
	inset: 0;
	z-index: 1100;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity 0.3s ease;
}
.hd-overlay.is-visible {
	opacity: 1;
}
.hd-overlay[hidden] {
	display: none;
}

/* --- Left drawer ---------------------------------------------------------- */
#hd-drawer {
	position: fixed;
	inset: 0;
	z-index: 1200;
}
#hd-drawer[hidden] {
	display: none;
}
#hd-drawer .hd-drawer__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 400px;
	max-width: 88vw;
	background: #fff;
	color: #000;
	display: flex;
	flex-direction: column;
	transform: translateX(-100%);
	transition: transform 0.35s cubic-bezier(0.4, 0.1, 0.2, 1);
}
#hd-drawer.is-open .hd-drawer__panel {
	transform: translateX(0);
}
#hd-drawer .hd-drawer__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 16px;
	min-height: 48px;
	border-bottom: 1px solid #ececec;
}
#hd-drawer .hd-drawer__title {
	flex: 1 1 auto;
	font-size: 15px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
#hd-drawer .hd-drawer__back,
#hd-drawer .hd-drawer__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
}
#hd-drawer .hd-drawer__back[hidden] {
	display: none;
}
#hd-drawer .hd-drawer__nav {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 15px;
}
#hd-drawer .hd-drawer__list {
	padding: 0;
}
#hd-drawer .hd-drawer__item {
	border-bottom: 1px solid #f0f0f0;
}
#hd-drawer .hd-drawer__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 8px;
	font-size: 16px;
	font-weight: 300;
	line-height: 1.6;
}
#hd-drawer .hd-drawer__item--parent > .hd-drawer__link {
	cursor: pointer;
}
#hd-drawer .hd-drawer__chev {
	transition: transform 0.25s ease;
}
#hd-drawer .hd-drawer__item.is-open .hd-drawer__chev {
	transform: rotate(180deg);
}
#hd-drawer .hd-drawer__sub {
	padding: 4px 8px 16px 8px;
}
#hd-drawer .hd-drawer__subhead {
	display: block;
	margin: 10px 0 4px;
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
#hd-drawer .hd-drawer__sublist li a {
	display: block;
	padding: 6px 0;
	font-size: 15px;
	font-weight: 300;
	color: #333;
}
#hd-drawer .hd-drawer__sublist li a:hover {
	color: #000;
	text-decoration: underline;
}
#hd-drawer .hd-drawer__foot {
	padding: 16px 23px 24px;
	border-top: 1px solid #ececec;
}
#hd-drawer .hd-drawer__footlink {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	font-weight: 300;
}

/* --- Search overlay ------------------------------------------------------- */
.hd-search {
	position: fixed;
	left: 0;
	right: 0;
	top: 0;
	z-index: 1300;
	background: #fff;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
	transform: translateY(-100%);
	transition: transform 0.3s ease;
}
.hd-search[hidden] {
	display: none;
}
.hd-search.is-open {
	transform: translateY(0);
}
.hd-search__bar {
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: var(--g-container);
	margin: 0 auto;
	padding: 20px var(--container-pad);
}
.hd-search__form {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	gap: 12px;
}
.hd-search__input {
	flex: 1 1 auto;
	height: 50px;
	padding: 13px 15px;
	background: var(--g-input-bg);
	border: 0;
	border-radius: var(--g-input-radius);
	font-size: 16px;
}
.hd-search__submit {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 15px 30px;
	background: #000;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
.hd-search__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
}

/* --- Mobile header -------------------------------------------------------- */
@media (max-width: 991px) {
	.hd-header__inner {
		display: grid;
		grid-template-columns: auto 1fr auto;
		grid-template-areas:
			'left logo utils'
			'search search search';
		row-gap: 10px;
		align-items: center;
		padding: 16px var(--container-pad) 0;
		min-height: 0;
	}
	.hd-header__left {
		grid-area: left;
		flex: 0 0 auto;
		width: 64px;
	}
	.hd-header__logo {
		grid-area: logo;
		display: flex;
		justify-content: center;
	}
	.hd-logo img {
		width: 140px;
		height: 53.8px;
	}
	.hd-header__right {
		display: contents;
	}
	.hd-header__utils {
		grid-area: utils;
		justify-self: end;
		display: flex;
		align-items: center;
		margin-left: 0;
	}
	.hd-icon-btn--search {
		display: none;
	}
	.hd-search-form {
		grid-area: search;
		width: 100%;
		height: 49.3px;
		margin: 0;
	}
	.hd-search-form__input {
		font-size: 17px;
	}
	.hd-icon-btn {
		padding: 15px 0 15px 6px;
	}
	.hd-drawer-toggle {
		padding: 15px 0;
	}
	.hd-icon-btn--account,
	.hd-icon-btn--wishlist,
	.hd-icon-btn--cart {
		flex: 0 0 auto;
	}
	.hd-cart-count {
		top: 4px;
		right: -2px;
	}
}

/* While the navigation drawer is open the page chrome behind the backdrop is not
   part of the drawer: hide it visually too (it is already inert + aria-hidden in JS). */
html.hd-nav-open .hd-announcement,
html.hd-nav-open .hd-sticky-stack,
html.hd-nav-open #MainContent,
html.hd-nav-open .hd-footer,
html.hd-nav-open .skip-link {
	display: none !important;
}
