/**
 * Site header (logo, menu, mobile menu, cart count).
 * Markup: template-parts/header.php. On every page (this is the site header).
 *
 * Same brand colors/font as the product page (assets/css/product-page.css),
 * so the whole site feels like one design, not two.
 */

:root {
	--bp-header-height: 68px;
	--bp-header-height-mobile: 60px;
}

@font-face {
	font-family: "Outfit";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/outfit-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

#site-header.bp-header {
	--bp-header-ink: #0a2530;
	--bp-header-purple: #7152d4;
	--bp-header-purple-dark: #5f40c4;
	--bp-header-green: #015640;

	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 200;
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	background: #fff;
	border-bottom: 1px solid #eef1f3;
	font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	transition: box-shadow 0.2s;
}

#site-header.bp-header.bp-header--scrolled {
	box-shadow: 0 4px 16px rgba(10, 30, 40, 0.08);
}

.bp-header__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	box-sizing: border-box;
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px;
	height: var(--bp-header-height);
}

@media (max-width: 575px) {
	.bp-header__row {
		height: var(--bp-header-height-mobile);
		padding: 0 16px;
	}
}

/* ---------- Logo ---------- */

.bp-header__branding {
	display: flex;
	align-items: center;
	min-width: 0;
	flex: none;
}

.bp-header__branding .custom-logo-link {
	display: block;
	line-height: 0;
}

.bp-header__branding img.custom-logo {
	display: block;
	width: auto;
	height: 46px;
	max-height: 46px;
}

@media (max-width: 575px) {
	.bp-header__branding img.custom-logo {
		height: 38px;
		max-height: 38px;
	}
}

.bp-header__branding .site-title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
}

.bp-header__branding .site-title a {
	color: var(--bp-header-ink);
	text-decoration: none;
}

.bp-header__branding .site-description {
	display: none;
}

/* ---------- Desktop menu ---------- */

.bp-header .bp-header__nav {
	display: flex;
	align-items: center;
	min-width: 0;
}

.bp-header .bp-header__nav ul.menu {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bp-header .bp-header__nav ul.menu li {
	position: static;
	margin: 0;
}

.bp-header .bp-header__nav ul.menu li a {
	position: relative;
	display: flex;
	align-items: center;
	padding: 10px 14px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--bp-header-ink);
	text-decoration: none;
	white-space: nowrap;
}

.bp-header .bp-header__nav ul.menu li a::after {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 6px;
	height: 2px;
	border-radius: 1px;
	background: var(--bp-header-purple);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.2s ease;
}

.bp-header .bp-header__nav ul.menu li a:hover,
.bp-header .bp-header__nav ul.menu li a:focus-visible {
	color: var(--bp-header-purple);
}

.bp-header .bp-header__nav ul.menu li a:hover::after,
.bp-header .bp-header__nav ul.menu li a:focus-visible::after,
.bp-header .bp-header__nav ul.menu li.current-menu-item > a::after,
.bp-header .bp-header__nav ul.menu li.current_page_item > a::after {
	transform: scaleX(1);
}

.bp-header .bp-header__nav ul.menu li.current-menu-item > a,
.bp-header .bp-header__nav ul.menu li.current_page_item > a {
	color: var(--bp-header-purple);
}

.bp-header ul.menu li a:focus-visible {
	outline: 2px solid var(--bp-header-purple);
	outline-offset: -2px;
	border-radius: 4px;
}

/* ---------- Cart link (icon + count bubble) ---------- */

.bp-header__cart {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.bp-header__cart-icon {
	width: 19px;
	height: 19px;
	flex: none;
}

.bp-header__cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--bp-header-purple);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
}

.bp-header__cart-count[hidden] {
	display: none;
}

/* ---------- Mobile menu toggle ---------- */

.bp-header__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--bp-header-ink);
	cursor: pointer;
}

.bp-header__toggle:hover {
	background: #f4f2fc;
}

.bp-header__toggle:focus-visible {
	outline: 2px solid var(--bp-header-purple);
	outline-offset: 2px;
}

.bp-header__toggle-icon,
.bp-header__toggle-icon::before,
.bp-header__toggle-icon::after {
	display: block;
	width: 22px;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.bp-header__toggle-icon {
	position: relative;
}

.bp-header__toggle-icon::before,
.bp-header__toggle-icon::after {
	content: "";
	position: absolute;
	left: 0;
}

.bp-header__toggle-icon::before {
	top: -7px;
}

.bp-header__toggle-icon::after {
	top: 7px;
}

.bp-header__toggle[aria-expanded="true"] .bp-header__toggle-icon {
	background: transparent;
}

.bp-header__toggle[aria-expanded="true"] .bp-header__toggle-icon::before {
	top: 0;
	transform: rotate(45deg);
}

.bp-header__toggle[aria-expanded="true"] .bp-header__toggle-icon::after {
	top: 0;
	transform: rotate(-45deg);
}

/* ---------- Mobile menu panel ---------- */

.bp-header__mobile {
	max-width: 1180px;
	margin: 0 auto;
	padding: 4px 16px 14px;
	border-top: 1px solid #eef1f3;
}

.bp-header__mobile[hidden] {
	display: none;
}

.bp-header .bp-header__mobile-nav ul.menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bp-header .bp-header__mobile-nav ul.menu li {
	margin: 0;
	border-bottom: 1px solid #f2f2f5;
}

.bp-header .bp-header__mobile-nav ul.menu li:last-child {
	border-bottom: 0;
}

.bp-header .bp-header__mobile-nav ul.menu li a {
	display: flex;
	align-items: center;
	min-height: 50px;
	padding: 12px 6px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--bp-header-ink);
	text-decoration: none;
}

.bp-header .bp-header__mobile-nav ul.menu li a:focus-visible {
	outline: 2px solid var(--bp-header-purple);
	outline-offset: -2px;
	border-radius: 4px;
}

.bp-header .bp-header__mobile-nav ul.menu li.current-menu-item > a,
.bp-header .bp-header__mobile-nav ul.menu li.current_page_item > a {
	color: var(--bp-header-purple);
}

/* ---------- Breakpoint: switch from desktop menu to mobile toggle ---------- */

@media (max-width: 700px) {
	.bp-header .bp-header__nav {
		display: none;
	}

	.bp-header__toggle {
		display: inline-flex;
	}

	/* Stop the page scrolling behind the open mobile menu. */
	html.bp-header-menu-open {
		overflow: hidden;
	}
}

@media (min-width: 701px) {
	.bp-header__mobile {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	#site-header.bp-header,
	.bp-header .bp-header__nav ul.menu li a::after,
	.bp-header__toggle-icon,
	.bp-header__toggle-icon::before,
	.bp-header__toggle-icon::after {
		transition: none;
	}
}
