.woodcha-header-slot {
	/* Reserve the expanded height so collapsing navigation never moves the page. */
	background: var(--woodcha-section-background);
	height: 129px;
}

.woodcha-header {
	--woodcha-admin-offset: 0px;
	--woodcha-header-bottom: 129px;
	--woodcha-header-line: rgb(36 33 29 / 10%);
	--woodcha-header-motion: 250ms;
	background: var(--woodcha-section-background);
	border-bottom: 1px solid var(--woodcha-header-line);
	box-shadow: 0 6px 16px -8px rgb(36 33 29 / 0%);
	left: 0;
	position: fixed;
	right: 0;
	top: var(--woodcha-admin-offset);
	transition: box-shadow var(--woodcha-header-motion) ease;
	z-index: 100;
}

.admin-bar .woodcha-header { --woodcha-admin-offset: 32px; }

.woodcha-header.is-compact:not(.is-menu-open):not(.has-panel) {
	box-shadow: 0 6px 16px -8px rgb(36 33 29 / 10%);
}

.woodcha-header [hidden] { display: none; }

.woodcha-header__main {
	align-items: center;
	display: grid;
	gap: 32px;
	grid-template-columns: minmax(250px, 1fr) minmax(220px, 480px) minmax(48px, 1fr);
	height: 80px;
	position: relative;
	z-index: 4;
}

.woodcha-header__brand-group,
.woodcha-header__brand,
.woodcha-header__actions {
	align-items: center;
	display: flex;
}

.woodcha-header__brand {
	flex: none;
	gap: 10px;
	text-decoration: none;
}

/* WooCommerce's global image rule must not resize the brand on shop pages. */
.woodcha-header .woodcha-header__wordmark {
	flex: none;
	height: 27px;
	max-width: none;
	width: 154px;
}

.woodcha-header .woodcha-header__symbol {
	flex: none;
	height: 35px;
	max-width: none;
	width: 34px;
}

.woodcha-header__menu-toggle,
.woodcha-header__icon-link,
.woodcha-header__search button {
	align-items: center;
	background: none;
	border: 0;
	border-radius: 50%;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	flex: none;
	height: 42px;
	justify-content: center;
	padding: 0;
	position: relative;
	text-decoration: none;
	touch-action: manipulation;
	width: 42px;
	-webkit-tap-highlight-color: transparent;
}

.woodcha-header__menu-toggle {
	margin-right: 0;
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
	transition: width var(--woodcha-header-motion) ease, margin-right var(--woodcha-header-motion) ease,
		opacity var(--woodcha-header-motion) ease, visibility 0s linear var(--woodcha-header-motion);
	visibility: hidden;
	width: 0;
}

.woodcha-header.is-compact .woodcha-header__menu-toggle {
	margin-right: 12px;
	opacity: 1;
	pointer-events: auto;
	transition-delay: 0s;
	visibility: visible;
	width: 42px;
}

@media (hover: hover) and (pointer: fine) {
	.woodcha-header__icon-link:hover,
	.woodcha-header__menu-toggle:hover,
	.woodcha-header__search button:hover { background: rgb(99 38 52 / 8%); }
}

.woodcha-header__icon-link:active,
.woodcha-header__menu-toggle:active,
.woodcha-header__search button:active,
.woodcha-header__icon-link[aria-expanded="true"],
.woodcha-header__menu-toggle[aria-expanded="true"] { background: rgb(99 38 52 / 8%); }

.woodcha-header__icon-link svg,
.woodcha-header__menu-toggle svg,
.woodcha-header__search svg {
	fill: none;
	flex: none;
	height: 21px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.6;
	width: 21px;
}

.woodcha-header__menu-line { transition: transform 200ms ease, opacity 200ms ease; }
.woodcha-header__menu-toggle svg { max-width: none; }
.woodcha-header__menu-line:first-child { transform-origin: 12px 6px; }
.woodcha-header__menu-line:last-child { transform-origin: 12px 18px; }
.woodcha-header__menu-toggle[aria-expanded="true"] .woodcha-header__menu-line:first-child { transform: translateY(6px) rotate(45deg); }
.woodcha-header__menu-toggle[aria-expanded="true"] .woodcha-header__menu-line:nth-child(2) { opacity: 0; }
.woodcha-header__menu-toggle[aria-expanded="true"] .woodcha-header__menu-line:last-child { transform: translateY(-6px) rotate(-45deg); }

.woodcha-header__search {
	align-items: center;
	background: #fff;
	border: 1px solid rgb(36 33 29 / 13%);
	border-radius: 999px;
	display: flex;
	min-width: 0;
	padding: 2px 5px 2px 18px;
	position: relative;
}

.woodcha-header__search:focus-within {
	border-color: var(--woodcha-ume);
	box-shadow: 0 0 0 1px var(--woodcha-ume);
}

.woodcha-header__search input[type="search"] {
	background: none;
	border: 0;
	color: inherit;
	font-size: 14px;
	min-width: 0;
	outline: none;
	padding: 8px 0;
	width: 100%;
}

.woodcha-header__search input::placeholder { color: rgb(36 33 29 / 58%); opacity: 1; }
.woodcha-header__search button { height: 36px; width: 36px; }
.woodcha-header__search-results {
	background: var(--woodcha-surface);
	border: 1px solid var(--woodcha-line);
	border-radius: 18px;
	box-shadow: 0 16px 42px rgb(36 33 29 / 14%);
	left: 0;
	max-height: min(480px, 70vh);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 8px;
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 5;
}
.woodcha-header__search-status {
	color: rgb(36 33 29 / 65%);
	font-size: 13px;
	padding: 10px 10px 12px;
}
.woodcha-header__search-list { list-style: none; margin: 0; padding: 0; }
.woodcha-header__search-product {
	align-items: center;
	border-radius: 10px;
	display: grid;
	gap: 12px;
	grid-template-columns: 48px minmax(0, 1fr);
	padding: 9px;
	text-decoration: none;
}
.woodcha-header__search-product:hover,
.woodcha-header__search-product[aria-selected="true"] { background: var(--woodcha-paper); }
.woodcha-header .woodcha-header__search-product img {
	background: white;
	border-radius: 7px;
	height: 48px;
	object-fit: contain;
	width: 48px;
}
.woodcha-header__search-product > span { grid-column: 2; }
.woodcha-header__search-name { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; }
.woodcha-header__search-price { color: rgb(36 33 29 / 65%); display: block; font-size: 13px; margin-top: 3px; }
.woodcha-header__search-all {
	align-items: center;
	border-top: 1px solid var(--woodcha-line);
	display: flex;
	font-size: 14px;
	font-weight: 600;
	margin-top: 6px;
	padding: 14px 10px 8px;
	text-decoration: none;
}
.woodcha-header__actions { gap: 6px; justify-self: end; }
.woodcha-header__search-toggle,
.woodcha-header__back { display: none; }

.woodcha-header__cart {
	border-radius: var(--woodcha-radius-pill);
	font-size: 14px;
	font-weight: 600;
	gap: 8px;
	padding-inline: 10px;
	width: auto;
}

.woodcha-header__cart-icon {
	display: inline-flex;
	flex: none;
	height: 21px;
	position: relative;
	width: 21px;
}

.woodcha-header__cart-label { line-height: 1; }

.woodcha-header__cart-count {
	align-items: center;
	background: var(--woodcha-ume);
	border-radius: 50%;
	color: #fff;
	display: flex;
	font-size: 9px;
	font-weight: 700;
	height: 17px;
	justify-content: center;
	line-height: 1;
	min-width: 18px;
	padding-inline: 4px;
	position: absolute;
	right: -8px;
	top: -8px;
}

.woodcha-header__categories {
	display: grid;
	grid-template-rows: 1fr;
	opacity: 1;
	position: relative;
	transition: grid-template-rows var(--woodcha-header-motion) ease, opacity var(--woodcha-header-motion) ease, visibility 0s;
	visibility: visible;
	z-index: 2;
}

.woodcha-header__categories-clip {
	box-shadow: inset 0 1px 0 var(--woodcha-header-line);
	min-height: 0;
	overflow: hidden;
}

.woodcha-header.is-compact:not(.is-menu-open) .woodcha-header__categories {
	grid-template-rows: 0fr;
	opacity: 0;
	pointer-events: none;
	transition-delay: 0s, 0s, var(--woodcha-header-motion);
	visibility: hidden;
}

.woodcha-header__menu {
	align-items: center;
	display: flex;
	gap: clamp(24px, 4vw, 60px);
	justify-content: center;
	list-style: none;
	margin: 0;
	min-height: 48px;
	padding: 0;
}

.woodcha-header__menu a,
.woodcha-header__category-trigger {
	align-items: center;
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	font-size: 14px;
	font-weight: 600;
	gap: 9px;
	min-height: 48px;
	padding: 0 4px;
	position: relative;
	text-decoration: none;
}

.woodcha-header__category--grains { --category-accent: var(--woodcha-tea-leaf); }
.woodcha-header__category--fruit { --category-accent: var(--woodcha-persimmon); }
.woodcha-header__category--sweets { --category-accent: var(--woodcha-berry); }

.woodcha-header__category-trigger::after,
.woodcha-header__shop-all::after {
	background: var(--category-accent, var(--woodcha-ume));
	bottom: 6px;
	content: "";
	height: 2px;
	left: 4px;
	position: absolute;
	right: 4px;
	transform: scaleX(0);
	transition: transform 180ms ease;
}

.woodcha-header__category-trigger:hover::after,
.woodcha-header__category-trigger[aria-expanded="true"]::after,
.woodcha-header__shop-all:hover::after { transform: scaleX(1); }

.woodcha-header__category-trigger svg {
	fill: none;
	height: 14px;
	stroke: currentColor;
	stroke-width: 1.4;
	transition: transform 180ms ease;
	width: 14px;
}

.woodcha-header__category-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.woodcha-header.has-panel .woodcha-header__category-trigger:not([aria-expanded="true"]) { color: rgb(36 33 29 / 48%); }
.woodcha-header__menu :focus-visible { outline-offset: -3px; }

.woodcha-header__panel {
	background: var(--woodcha-surface);
	border-top: 1px solid var(--woodcha-line);
	box-shadow: 0 20px 30px rgb(36 33 29 / 8%);
	left: 0;
	max-height: calc(100vh - var(--woodcha-header-bottom) - 16px);
	max-height: calc(100dvh - var(--woodcha-header-bottom) - 16px);
	overflow-y: auto;
	overscroll-behavior: contain;
	position: absolute;
	right: 0;
	top: 100%;
	z-index: 3;
}

.woodcha-header__panel.is-revealing { animation: woodcha-header-reveal 200ms ease both; }

.woodcha-header__panel-inner {
	align-items: start;
	display: grid;
	gap: clamp(24px, 3vw, 48px);
	grid-template-columns: minmax(180px, 0.9fr) minmax(360px, 1.7fr) minmax(160px, 0.8fr);
	padding-block: 32px 36px;
}

.woodcha-header__category-intro h2 {
	font-size: clamp(26px, 2.5vw, 34px);
	font-weight: 550;
	letter-spacing: -0.04em;
	line-height: 1.12;
}

.woodcha-header__category-intro p {
	color: rgb(36 33 29 / 65%);
	font-size: 14px;
	margin-top: 14px;
	max-width: 250px;
}

.woodcha-header__category-all {
	align-items: center;
	display: inline-flex;
	font-size: 14px;
	font-weight: 650;
	margin-top: 24px;
	text-decoration-color: var(--category-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
}

.woodcha-header__product-links {
	align-content: start;
	display: grid;
	gap: 6px 24px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.woodcha-header__product-links a {
	display: block;
	font-size: 14px;
	line-height: 1.5;
	padding: 8px 0;
	text-decoration: none;
}

.woodcha-header__product-links a:hover {
	text-decoration: underline;
	text-decoration-color: var(--category-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

.woodcha-header__category-image {
	align-self: stretch;
	background: var(--woodcha-paper);
	border-radius: 14px;
	overflow: hidden;
}

.woodcha-header .woodcha-header__category-image img {
	height: 100%;
	max-height: 240px;
	min-height: 180px;
	object-fit: cover;
	width: 100%;
}

.woodcha-header__backdrop {
	animation: woodcha-header-backdrop 180ms ease both;
	background: rgb(36 33 29 / 38%);
	bottom: 0;
	left: 0;
	position: fixed;
	right: 0;
	top: var(--woodcha-header-bottom);
	z-index: 0;
}

html.woodcha-header-lock,
.woodcha-header-lock body { overflow: hidden; }

@keyframes woodcha-header-reveal {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes woodcha-header-backdrop {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (max-width: 1023px) {
	.woodcha-header-slot { height: 73px; }
	.woodcha-header {
		--woodcha-header-bottom: 73px;
		--woodcha-header-control-size: 44px;
		--woodcha-header-main-gap: 12px;
		--woodcha-header-action-gap: 6px;
		--woodcha-header-brand-width: 198px;
		--woodcha-header-brand-gap: 10px;
	}
	.woodcha-header__main {
		gap: var(--woodcha-header-main-gap);
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		height: 72px;
	}
	/* Balance the side tracks against the two right-hand controls, not the
	 * hamburger alone. Keep the brand in flow, including the no-JS search row. */
	.woodcha-header__brand-group { display: contents; }
	.woodcha-header__brand {
		gap: var(--woodcha-header-brand-gap);
		grid-column: 2;
		grid-row: 1;
		justify-self: center;
		width: min(var(--woodcha-header-brand-width), calc(var(--woodcha-shell) - 4 * var(--woodcha-header-control-size) - 2 * var(--woodcha-header-action-gap) - 2 * var(--woodcha-header-main-gap)));
	}
	.woodcha-header .woodcha-header__wordmark {
		height: auto;
		width: calc((100% - var(--woodcha-header-brand-gap)) * 154 / 188);
	}
	.woodcha-header .woodcha-header__symbol {
		height: auto;
		width: calc((100% - var(--woodcha-header-brand-gap)) * 34 / 188);
	}
	.woodcha-header__actions {
		gap: var(--woodcha-header-action-gap);
		grid-column: 3;
		grid-row: 1;
	}
	.woodcha-header__menu-toggle,
	.woodcha-header.is-compact .woodcha-header__menu-toggle {
		grid-column: 1;
		grid-row: 1;
		justify-self: start;
		margin-right: 0;
		opacity: 1;
		pointer-events: auto;
		transition: none;
		visibility: visible;
	}
	/* Equal, non-shrinking hit areas keep all mobile control backgrounds circular. */
	.woodcha-header__menu-toggle,
	.woodcha-header.is-compact .woodcha-header__menu-toggle,
	.woodcha-header__icon-link {
		border-radius: 50%;
		height: var(--woodcha-header-control-size);
		padding: 0;
		width: var(--woodcha-header-control-size);
	}
	.woodcha-header__cart-label { display: none; }
	.woodcha-header__search-toggle { display: inline-flex; }
	.woodcha-header__search {
		border-radius: 0;
		box-shadow: 0 14px 24px rgb(36 33 29 / 8%);
		display: none;
		left: calc((100% - 100vw) / 2);
		padding: 14px max(20px, calc((100vw - var(--woodcha-shell)) / 2));
		position: absolute;
		right: calc((100% - 100vw) / 2);
		top: 100%;
	}
	.woodcha-header.is-search-open .woodcha-header__search { display: flex; }
	.woodcha-header__search input[type="search"] { font-size: 16px; }
	.woodcha-header__search-results { border-radius: 0 0 16px 16px; top: 100%; }
	.woodcha-header .woodcha-header__categories {
		grid-template-rows: 0fr;
		opacity: 0;
		pointer-events: none;
		transition-delay: 0s, 0s, var(--woodcha-header-motion);
		visibility: hidden;
	}
	.woodcha-header.is-menu-open:not(.has-panel) .woodcha-header__categories {
		grid-template-rows: 1fr;
		opacity: 1;
		pointer-events: auto;
		transition-delay: 0s;
		visibility: visible;
	}
	.woodcha-header__navigation {
		max-height: calc(100vh - 100px - var(--woodcha-admin-offset));
		max-height: calc(100dvh - 100px - var(--woodcha-admin-offset));
		overflow-y: auto;
		overscroll-behavior: contain;
		padding-block: 12px 24px;
	}
	.woodcha-header__menu { align-items: stretch; flex-direction: column; gap: 0; }
	.woodcha-header__menu li + li { border-top: 1px solid var(--woodcha-line); }
	.woodcha-header__menu a,
	.woodcha-header__category-trigger {
		font-size: 18px;
		justify-content: space-between;
		min-height: 60px;
		padding: 12px 4px;
		width: 100%;
	}
	.woodcha-header__category-trigger svg { transform: rotate(-90deg); }
	.woodcha-header__category-trigger::after,
	.woodcha-header__shop-all::after { display: none; }
	.woodcha-header__panel-inner { gap: 20px; grid-template-columns: 1fr; padding-block: 20px 28px; }
	.woodcha-header__back {
		align-items: center;
		background: none;
		border: 0;
		color: inherit;
		cursor: pointer;
		display: inline-flex;
		font-size: 14px;
		gap: 10px;
		justify-self: start;
		min-height: 36px;
		padding: 4px 0;
	}
	.woodcha-header__category-intro h2 { font-size: 30px; }
	.woodcha-header__category-intro p,
	.woodcha-header__category-image { display: none; }
	.woodcha-header__category-all { margin-top: 14px; }
}

@media (max-width: 782px) {
	.admin-bar .woodcha-header { --woodcha-admin-offset: 46px; }
}

@media (prefers-reduced-motion: reduce) {
	.woodcha-header { --woodcha-header-motion: 0ms; }
}

@media (max-width: 540px) {
	.woodcha-header {
		--woodcha-header-main-gap: 6px;
		--woodcha-header-action-gap: 0px;
		--woodcha-header-brand-width: 155px;
		--woodcha-header-brand-gap: 8px;
	}
	.woodcha-header__product-links { gap: 2px; grid-template-columns: 1fr; }
	.woodcha-header__product-links a { font-size: 16px; padding-block: 10px; }
}

@media (max-width: 360px) {
	/* Keep 44px targets at 320px without squeezing the controls or overflowing. */
	.woodcha-header {
		--woodcha-header-brand-width: 139px;
		--woodcha-header-brand-gap: 6px;
	}
}
