/*-------------------------------------------------------------------------
  Header — Logo + Nav …… CTA + Cart
-------------------------------------------------------------------------*/

.wpw-header {
	position: relative;
	z-index: 100;
	background: var(--wpw-color-white);
	border-bottom: 1px solid color-mix(in srgb, var(--wpw-color-dark) 8%, transparent);
}

.wpw-header,
.wpw-header .wp-block-group {
	border-radius: 0;
}

.wpw-header__inner.wp-block-group,
.wpw-header .wpw-header__inner {
	display: grid !important;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	column-gap: clamp(1.25rem, 3vw, 2.5rem);
	row-gap: 0;
	width: min(100% - (var(--wpw-pad-inline) * 2), var(--wpw-wide-size));
	min-height: 5.75rem;
	margin-inline: auto;
	padding-block: 0.75rem;
	flex-wrap: nowrap;
}

.wpw-header__inner > * {
	align-self: center;
}

.wpw-header__inner > .wp-block-shortcode {
	margin: 0 !important;
	padding: 0 !important;
}

.wpw-header__brand {
	display: flex !important;
	align-items: center;
	min-width: 0;
	flex-shrink: 0;
	grid-column: 1;
	padding-right: 0;
}

.wpw-header__logo .custom-logo-link,
.wpw-header .wp-block-site-logo a {
	display: block;
	line-height: 0;
}

.wpw-header__logo img,
.wpw-header .wp-block-site-logo img {
	display: block;
	width: auto;
	height: clamp(3.75rem, 7.5vw, 5.25rem);
	max-width: min(160px, 38vw);
	object-fit: contain;
	object-position: left center;
}

.wpw-header__site-title,
.wpw-header .wp-block-site-title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--wpw-color-dark);
	text-decoration: none;
}

.wpw-header .wp-block-site-title a {
	color: inherit;
	text-decoration: none;
}

body.wp-custom-logo .wpw-header__site-title,
body.wp-custom-logo .wpw-header .wp-block-site-title {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Primary nav (classic WP menu)
-------------------------------------------------------------------------*/

.wpw-header .wpw-nav,
.wpw-header__inner > .wp-block-shortcode {
	grid-column: 2;
	justify-self: stretch;
	align-self: stretch;
	display: flex !important;
	align-items: center;
	min-width: 0;
	width: 100%;
	height: 100%;
	min-height: 0;
	margin: 0 !important;
	line-height: normal;
}

.wpw-nav {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	width: 100%;
	height: 100%;
	min-height: 0;
}

.wpw-nav > p:empty,
.wpw-nav > p:not([class]),
.wpw-nav br {
	display: none !important;
}

.wpw-nav__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.65rem;
	height: 2.65rem;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var(--wpw-color-dark);
	cursor: pointer;
}

.wpw-nav__toggle-bars,
.wpw-nav__toggle-bars::before,
.wpw-nav__toggle-bars::after {
	display: block;
	width: 1.35rem;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.wpw-nav__toggle-bars {
	position: relative;
}

.wpw-nav__toggle-bars::before,
.wpw-nav__toggle-bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.wpw-nav__toggle-bars::before {
	top: -6px;
}

.wpw-nav__toggle-bars::after {
	top: 6px;
}

.wpw-nav.is-open .wpw-nav__toggle-bars {
	background: transparent;
}

.wpw-nav.is-open .wpw-nav__toggle-bars::before {
	top: 0;
	transform: rotate(45deg);
}

.wpw-nav.is-open .wpw-nav__toggle-bars::after {
	top: 0;
	transform: rotate(-45deg);
}

.wpw-nav__panel {
	display: flex;
	align-items: center;
	width: 100%;
	height: 100%;
	min-height: 0;
	line-height: normal;
}

.wpw-nav__list {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: 2.75rem;
	min-height: 2.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
	gap: 0;
}

.wpw-nav__list > .menu-item {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	justify-content: center;
	align-items: center;
	min-width: 0;
	height: 100%;
	min-height: 0;
	margin: 0;
}

.wpw-nav__list > .menu-item > a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: 100%;
	min-height: 0;
	padding: 0.15rem 0 0;
	color: var(--wpw-color-dark);
	font-size: clamp(0.9rem, 1.05vw, 1rem);
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
}

.wpw-nav__list > .menu-item > a:hover,
.wpw-nav__list > .menu-item > a:focus-visible,
.wpw-nav__list > .menu-item.current-menu-item > a,
.wpw-nav__list > .menu-item.current-menu-ancestor > a,
.wpw-nav__list > .menu-item.current-menu-parent > a {
	color: var(--wpw-color-primary);
}

/* Submenu — visual offset + invisible hover bridge */
.wpw-nav__list .sub-menu {
	display: none;
	position: absolute;
	top: calc(100% + 0.35rem);
	left: 50%;
	z-index: 120;
	min-width: 12rem;
	margin: 0;
	padding: 0.4rem 0;
	list-style: none;
	background: var(--wpw-color-white);
	border: 1px solid color-mix(in srgb, var(--wpw-color-dark) 10%, transparent);
	border-radius: 4px;
	box-shadow: 0 10px 28px color-mix(in srgb, var(--wpw-color-dark) 12%, transparent);
	transform: translateX(-50%);
}

.wpw-nav__list .sub-menu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -0.5rem;
	height: 0.5rem;
}

.wpw-nav__list .menu-item-has-children:hover > .sub-menu,
.wpw-nav__list .menu-item-has-children:focus-within > .sub-menu,
.wpw-nav__list .menu-item-has-children.is-open > .sub-menu {
	display: block;
}

.wpw-nav__list .sub-menu .menu-item {
	margin: 0;
}

.wpw-nav__list .sub-menu a {
	display: block;
	padding: 0.65rem 1rem;
	color: var(--wpw-color-dark);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
}

.wpw-nav__list .sub-menu a:hover,
.wpw-nav__list .sub-menu a:focus-visible,
.wpw-nav__list .sub-menu .current-menu-item > a {
	color: var(--wpw-color-primary);
	background: color-mix(in srgb, var(--wpw-color-primary) 6%, transparent);
}

.wpw-header__nav-cta {
	display: none;
	margin-top: var(--wpw-space-md);
	width: 100%;
}

/* Actions
-------------------------------------------------------------------------*/

.wpw-header__actions.wp-block-group,
.wpw-header .wpw-header__actions {
	display: flex !important;
	flex-direction: row;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: flex-end;
	gap: 0.85rem;
	grid-column: 3;
	align-self: stretch;
	height: 100%;
	min-height: 0;
	margin: 0 !important;
	padding: 0 !important;
	flex-shrink: 0;
}

.wpw-header__actions .wp-block-shortcode,
.wpw-header__actions .wp-block-html {
	display: flex !important;
	align-items: center;
	margin: 0 !important;
	padding: 0 !important;
	line-height: normal;
}

/* CTA
-------------------------------------------------------------------------*/

.wpw-header__cta-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	box-sizing: border-box;
	height: 2.75rem;
	min-height: 2.75rem;
	padding: 0.15rem 1.15rem 0;
	border-radius: 4px;
	background: var(--wpw-color-primary);
	color: var(--wpw-color-white);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
	transition: background-color 0.2s ease;
}

.wpw-header__cta-link:hover,
.wpw-header__cta-link:focus-visible {
	background: var(--wpw-color-dark);
	color: var(--wpw-color-white);
}

.wpw-header__cta-icon {
	display: inline-flex;
	line-height: 0;
	flex-shrink: 0;
}

.wpw-header__cta-icon svg {
	display: block;
}

.wpw-header__cta-label {
	display: inline-block;
}

/* Cart
-------------------------------------------------------------------------*/

.wpw-header__cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	flex-shrink: 0;
	color: var(--wpw-color-dark);
	text-decoration: none;
	border-radius: 4px;
	transition: color 0.2s ease;
}

.wpw-header__cart:hover,
.wpw-header__cart:focus-visible {
	color: var(--wpw-color-primary);
}

.wpw-header__cart-icon {
	display: flex;
	line-height: 0;
}

.wpw-header__cart-count {
	position: absolute;
	top: 0.1rem;
	right: 0.05rem;
	min-width: 1.15rem;
	height: 1.15rem;
	padding: 0 0.25rem;
	border-radius: 999px;
	background: var(--wpw-color-primary);
	color: var(--wpw-color-white);
	font-size: 0.65rem;
	font-weight: 700;
	line-height: 1.15rem;
	text-align: center;
}

.wpw-header .wp-block-woocommerce-mini-cart,
.wpw-header .wc-block-mini-cart,
.wpw-header .wp-block-woocommerce-customer-account,
.wpw-header .wp-block-buttons.wpw-header__cta {
	display: none !important;
}

/* Mobile / tablet
-------------------------------------------------------------------------*/

@media (max-width: 991px) {
	.wpw-header__inner.wp-block-group,
	.wpw-header .wpw-header__inner {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: space-between;
		column-gap: 0.65rem;
		row-gap: 0;
		min-height: 4.5rem;
		padding-block: 0.45rem;
	}

	.wpw-header__brand {
		flex: 1 1 auto;
		order: 1;
		min-width: 0;
		padding-right: 0.35rem;
	}

	.wpw-header__logo img,
	.wpw-header .wp-block-site-logo img {
		height: clamp(2.75rem, 12vw, 3.5rem);
		max-width: min(132px, 42vw);
	}

	/* Cart first, then hamburger — one horizontal row */
	.wpw-header__actions.wp-block-group,
	.wpw-header .wpw-header__actions {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: flex-end;
		order: 2;
		flex: 0 0 auto;
		gap: 0.15rem;
		height: auto !important;
		min-height: 0;
		align-self: center !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	/* CTA lives in the open menu on mobile — hide wrapper in the top bar */
	.wpw-header__actions > .wp-block-shortcode:first-child {
		display: none !important;
	}

	.wpw-header__actions .wpw-header__cta-link {
		display: none !important;
	}

	.wpw-header .wpw-nav,
	.wpw-header__inner > .wp-block-shortcode {
		order: 3;
		flex: 0 0 auto;
		display: flex !important;
		align-items: center !important;
		justify-content: flex-end;
		width: auto !important;
		height: auto !important;
		min-height: 0;
		margin: 0 !important;
		padding: 0 !important;
		align-self: center !important;
	}

	.wpw-nav {
		justify-content: flex-end;
		width: auto;
		height: auto;
		min-height: 0;
	}

	.wpw-nav__toggle {
		display: inline-flex;
		width: 2.75rem;
		height: 2.75rem;
	}

	.wpw-header__cart {
		width: 2.75rem;
		height: 2.75rem;
	}

	.wpw-nav__panel {
		display: none;
		position: absolute;
		top: calc(100% + 0.35rem);
		right: 0;
		left: auto;
		z-index: 130;
		width: min(100vw - (var(--wpw-pad-inline) * 2), 22rem);
		height: auto;
		padding: 1rem 1.1rem 1.25rem;
		background: var(--wpw-color-white);
		border: 1px solid color-mix(in srgb, var(--wpw-color-dark) 10%, transparent);
		border-radius: 6px;
		box-shadow: 0 16px 40px color-mix(in srgb, var(--wpw-color-dark) 14%, transparent);
	}

	.wpw-nav.is-open .wpw-nav__panel {
		display: block;
	}

	.wpw-nav__list {
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0.15rem;
		height: auto;
		min-height: 0;
	}

	.wpw-nav__list > .menu-item {
		flex: none;
		display: block;
		justify-content: flex-start;
		height: auto;
		min-height: 0;
	}

	.wpw-nav__list > .menu-item > a {
		display: block;
		height: auto;
		min-height: 0;
		padding: 0.85rem 0.25rem;
		font-size: 1rem;
		line-height: 1.2;
		white-space: normal;
	}

	.wpw-nav__list .sub-menu {
		position: static;
		display: none;
		min-width: 0;
		margin: 0 0 0.35rem;
		padding: 0 0 0 0.75rem;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		transform: none;
		background: transparent;
	}

	.wpw-nav__list .sub-menu::before {
		display: none;
	}

	.wpw-nav__list .menu-item-has-children.is-open > .sub-menu {
		display: block;
	}

	.wpw-nav__list .menu-item-has-children:hover > .sub-menu {
		display: none;
	}

	.wpw-nav__list .menu-item-has-children.is-open:hover > .sub-menu,
	.wpw-nav__list .menu-item-has-children.is-open > .sub-menu {
		display: block;
	}

	.wpw-nav__list .sub-menu a {
		padding: 0.55rem 0.25rem;
		white-space: normal;
	}

	.wpw-header__nav-cta {
		display: block;
	}

	.wpw-header__nav-cta .wpw-header__cta-link {
		width: 100%;
	}
}

@media (min-width: 992px) {
	.wpw-nav__toggle {
		display: none !important;
	}

	.wpw-nav__panel {
		display: flex !important;
		align-items: center;
		position: static;
		width: 100%;
		height: 100%;
		padding: 0;
		border: 0;
		box-shadow: none;
		background: transparent;
	}

	.wpw-header__nav-cta {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wpw-nav__toggle-bars,
	.wpw-nav__toggle-bars::before,
	.wpw-nav__toggle-bars::after,
	.wpw-header__cta-link {
		transition: none;
	}
}
