/* =========================================================================
   Handknitted — Header
   ========================================================================= */

.site-header {
	background: var(--hk-bg);
	/* design: 1px cyan hairline under the header (Rectangle 19 on every frame) */
	border-bottom: 1px solid var(--hk-brand);
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: clamp(1rem, 3vw, 2.5rem);
	min-height: 88px;
	/* The header spans the full viewport (design: logo ~60px from the left
	   edge, cart ~40px from the right) — only the gutter insets it. */
	max-width: none;
}

/* ---- Branding / logo ---------------------------------------------------- */
.site-branding {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}
.site-branding .custom-logo-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}
.site-branding img,
.site-branding .custom-logo {
	display: block;
	width: auto;
	height: 46px;
	max-width: 280px;
}

/* ---- Primary navigation ------------------------------------------------- */
.main-navigation {
	/* Nav hugs the logo (left-of-centre), matching the design; the utilities
	   cluster is pushed to the far right via margin-left:auto below. */
	flex: 0 1 auto;
	display: flex;
	justify-content: flex-start;
	margin-left: clamp(0.25rem, 1.4vw, 1.25rem);
}

.hk-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: clamp(1.1rem, 2vw, 2rem);
}
.hk-menu li { position: relative; }

.hk-menu a {
	display: inline-block;
	padding: 0.5rem 0.25rem;
	color: var(--hk-ink);
	/* Per design spec: Nexa Regular, 12px, line-height 100%, letter-spacing 0 */
	font-family: "Nexa", var(--hk-font);
	font-size: 12px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease;
}
.hk-menu a:hover,
.hk-menu a:focus,
.hk-menu .current-menu-item > a,
.hk-menu .current_page_item > a {
	color: var(--hk-brand);
	text-decoration: none;
}

/* Sub-menus (dropdowns) */
.hk-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0.5rem 0;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	background: #fff;
	border: 1px solid var(--hk-line);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(17, 20, 24, 0.1);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	z-index: 50;
}
.hk-menu li:hover > .sub-menu,
.hk-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.hk-menu .sub-menu a {
	display: block;
	padding: 0.5rem 1.1rem;
	font-weight: 400;
}
.hk-menu .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	margin-left: 0.4em;
	border: 4px solid transparent;
	border-top-color: currentColor;
	transform: translateY(2px);
}

/* ---- Utilities (right cluster) ----------------------------------------- */
.site-utilities {
	flex: 0 0 auto;
	margin-left: auto; /* push the cluster to the right edge */
	display: flex;
	/* Design: search / currency / language / cart sit on the "floor" —
	   bottom-aligned with the Stores line of the contact block. */
	align-items: flex-end;
	gap: clamp(0.6rem, 1.4vw, 1.25rem);
	color: var(--hk-brand);
}
/* Optical alignment: the buttons carry bottom padding, so pull them down
   until the icon glyphs / text baselines land on the Stores line. */
.site-utilities > .hk-iconbtn,
.site-utilities > .hk-switcher { margin-bottom: -7px; }

/* Three stacked lines per the design's Menu component:
   Opening hours / ☎ phone / Stores — all small, regular weight, cyan. */
.hk-contact {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	line-height: 1.35;
	font-size: 0.75rem;      /* 12px */
	font-weight: 400;
	/* Design: ~90px of air between the contact block and the search icon. */
	margin-right: clamp(0.25rem, 4.5vw, 4.5rem);
	color: var(--hk-brand);
}
.hk-contact__phone {
	display: inline-block;
	position: relative;
	color: var(--hk-brand);
	font-weight: 400;
	text-decoration: none;
}
/* The phone icon hangs in the left margin so all three text lines
   (Opening hours / number / Stores) share the same left edge. */
.hk-contact__phone .hk-icon--phone {
	position: absolute;
	left: -17px;
	top: 50%;
	transform: translateY(-50%);
}
.hk-contact__phone:hover { text-decoration: none; color: var(--hk-brand-dark); }
.hk-contact__hours,
.hk-contact__stores {
	color: var(--hk-brand);
	text-decoration: none;
}
a.hk-contact__hours:hover,
a.hk-contact__stores:hover { text-decoration: underline; }

/* Icon buttons (search, cart) */
.hk-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 0;
	padding: 0.4rem;
	color: var(--hk-ink); /* design: search + cart glyphs are dark ink, not cyan */
	cursor: pointer;
	border-radius: 8px;
	position: relative;
	line-height: 0;
}
.hk-iconbtn:hover,
.hk-iconbtn:focus-visible { color: var(--hk-brand-dark); background: rgba(0, 165, 206, 0.08); text-decoration: none; }

.hk-icon { display: block; }

/* Currency / language switchers */
.hk-switcher { position: relative; }
.hk-switcher__menu {
	list-style: none;
	margin: 0;
	padding: 0.35rem 0;
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	min-width: 110px;
	background: #fff;
	border: 1px solid var(--hk-line);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(17, 20, 24, 0.1);
	z-index: 60;
}
.hk-switcher__menu[hidden] { display: none; }
.hk-switcher__menu a {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 0.9rem;
	color: var(--hk-brand);
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	white-space: nowrap;
}
.hk-switcher__menu a:hover {
	background: rgba(0, 165, 206, 0.08);
	color: var(--hk-brand-dark);
	text-decoration: none;
}
/* WCML injects a loading spinner while switching */
.hk-switcher .wcml-spinner { position: absolute; top: 50%; right: -22px; transform: translateY(-50%); }

.hk-switcher__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	background: none;
	border: 0;
	padding: 0.4rem 0.3rem;
	color: var(--hk-brand);
	font: inherit;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	border-radius: 8px;
}
.hk-switcher__btn:hover { color: var(--hk-brand-dark); }
.hk-switcher__symbol { font-weight: 700; }
.hk-caret {
	width: 0;
	height: 0;
	border: 4px solid transparent;
	border-top-color: currentColor;
	margin-top: 3px;
}

/* Cart count badge */
.hk-cart { color: var(--hk-ink); }
.hk-cart:hover { color: var(--hk-brand); }
.hk-cart__count {
	position: absolute;
	top: -2px;
	right: -4px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--hk-brand-btn);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
}

/* Search panel (toggled) */
.hk-search-panel {
	border-bottom: 1px solid var(--hk-line);
	background: #fafbfc;
}
.hk-search-panel[hidden] { display: none; }
.hk-search-panel form {
	max-width: var(--hk-content-width);
	margin-inline: auto;
	padding: 1rem var(--hk-gutter);
	display: flex;
	gap: 0.5rem;
}
.hk-search-panel input[type="search"] {
	flex: 1 1 auto;
	padding: 0.7rem 1rem;
	border: 1px solid var(--hk-line);
	border-radius: 999px;
	font: inherit;
}
.hk-search-panel input[type="search"]:focus {
	outline: none;
	border-color: var(--hk-brand);
}

/* ---- Mobile menu toggle (hidden on desktop) ----------------------------- */
.hk-menu-toggle {
	display: none;
	background: none;
	border: 0;
	padding: 0.5rem;
	cursor: pointer;
	color: var(--hk-ink);
}
.hk-menu-toggle__bars,
.hk-menu-toggle__bars span {
	display: block;
}
.hk-menu-toggle__bars {
	width: 24px;
	height: 18px;
	position: relative;
}
.hk-menu-toggle__bars span {
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}
.hk-menu-toggle__bars span:nth-child(1) { top: 0; }
.hk-menu-toggle__bars span:nth-child(2) { top: 8px; }
.hk-menu-toggle__bars span:nth-child(3) { top: 16px; }
.hk-menu-toggle[aria-expanded="true"] .hk-menu-toggle__bars span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.hk-menu-toggle[aria-expanded="true"] .hk-menu-toggle__bars span:nth-child(2) { opacity: 0; }
.hk-menu-toggle[aria-expanded="true"] .hk-menu-toggle__bars span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

/* =========================================================================
   Responsive
   ========================================================================= */

/* Tablet: tighten the nav, drop the opening-hours line first */
@media (max-width: 1100px) {
	.hk-menu { gap: 1rem; }
}

@media (max-width: 980px) {
	.hk-contact__hours,
	.hk-contact__stores { display: none; }
}

/* Mobile: collapse nav into a toggled panel. The nav element becomes
   display:contents so its two children join the header row directly —
   the hamburger sits IN the top row (logo left, icons right) and the
   menu list drops to a full-width row of its own below. */
@media (max-width: 860px) {
	.site-header__inner {
		flex-wrap: wrap;
		min-height: 64px;
		padding-block: 0.6rem;
		gap: 0.5rem;
	}
	.main-navigation { display: contents; }

	.site-branding { order: 1; margin-right: auto; }
	.site-branding img,
	.site-branding .custom-logo { height: 38px; }

	.site-utilities { order: 2; align-items: center; gap: 0.5rem; }
	.site-utilities > .hk-iconbtn,
	.site-utilities > .hk-switcher { margin-bottom: 0; }

	.hk-menu-toggle { display: inline-flex; order: 3; margin-right: -0.5rem; }

	.hk-menu {
		order: 4;
		flex-basis: 100%;
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 0.25rem 0 0.75rem;
		border-top: 1px solid var(--hk-line);
	}
	.main-navigation.is-open .hk-menu { display: flex; }

	.hk-menu li { border-bottom: 1px solid var(--hk-line); }
	.hk-menu li:last-child { border-bottom: 0; }
	.hk-menu a { padding: 0.85rem 0.25rem; font-size: 1rem; }

	/* Sub-menus stack inline on mobile */
	.hk-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		padding: 0 0 0 1rem;
		min-width: 0;
	}
	.hk-menu .menu-item-has-children > a::after { float: right; }
}

/* Phones: only logo / search / cart / burger fit comfortably — drop the
   contact block and the (not yet functional) currency + language switchers. */
@media (max-width: 640px) {
	.hk-contact,
	.hk-currency,
	.hk-language { display: none; }
	.site-branding img,
	.site-branding .custom-logo { height: 34px; }
	.site-utilities { gap: 0.25rem; }
}
