/* Hearty Eats Header — search and cart pieces. Colours match the header. */
.heh-icon-btn {
	--heh-ink: #1F2A1F;
	--heh-green: #1E4D2B;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--heh-ink);
	cursor: pointer;
	text-decoration: none;
	box-shadow: none;
	transition: background-color .15s ease, color .15s ease;
}
.heh-icon-btn:hover,
.heh-icon-btn:focus-visible,
.heh-search__toggle[aria-expanded="true"] {
	background: #F1EBDD;
	color: var(--heh-green);
}
.heh-icon-btn:focus-visible { outline: 2px solid #1E4D2B; outline-offset: 2px; }
.heh-svg { display: block; width: 22px; height: 22px; }

/* Cart badge */
.heh-cart__badge {
	position: absolute;
	top: -3px;
	right: -7px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: #E8862A;
	color: #fff;
	font: 600 11px/18px Poppins, system-ui, sans-serif;
	text-align: center;
	box-shadow: 0 0 0 2px #FBF7EF;
}

/* Search panel: drops down under the header, full width */
.heh-search { display: inline-flex; }
.heh-search__panel {
	position: fixed;
	left: 0;
	right: 0;
	top: var(--heh-top, 120px);
	z-index: 9990;
	background: #FBF7EF;
	border-bottom: 1px solid #ECE4D3;
	box-shadow: 0 18px 40px rgba(30, 77, 43, .12);
	padding: 18px 16px 20px;
}
.heh-search__panel[hidden] { display: none; }
.heh-search__inner { max-width: 760px; margin: 0 auto; line-height: 1.4; }
.heh-search__form {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0 6px 0 16px;
	background: #fff;
	border: 1.5px solid #D9CFBA;
	border-radius: 999px;
	color: #1E4D2B;
}
.heh-search__form:focus-within { border-color: #1E4D2B; }
.heh-search__input,
.heh-search__input[type="search"] {
	flex: 1;
	min-width: 0;
	height: 50px;
	margin: 0;
	padding: 0;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none;
	font: 400 16px Poppins, system-ui, sans-serif; /* 16px stops iOS zooming */
	color: #1F2A1F;
}
.heh-search__close { width: 38px; height: 38px; }
.heh-search__input::-webkit-search-cancel-button,
.heh-search__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.heh-search__results { list-style: none; margin: 10px 0 0; padding: 0; }
.heh-search__results:empty { display: none; }
.heh-search__results li { margin: 0; }
.heh-search__results a,
.heh-search__results .heh-search__msg {
	display: block;
	padding: 12px 18px;
	border-radius: 10px;
	font: 500 15px/1.4 Poppins, system-ui, sans-serif;
	color: #1F2A1F;
	text-decoration: none;
}
.heh-search__results a:hover,
.heh-search__results a:focus-visible,
.heh-search__results a[aria-selected="true"] { background: #1E4D2B; color: #fff; outline: none; }
.heh-search__results .heh-search__msg { color: #5E6A5E; font-weight: 400; }
.heh-search__results mark { background: none; color: inherit; font-weight: 700; }
.heh-search__all {
	display: inline-block;
	margin: 12px 0 0 18px;
	font: 600 14px Poppins, system-ui, sans-serif;
	color: #1E4D2B;
	text-decoration: none;
}
.heh-search__all:hover { text-decoration: underline; }
.heh-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Elementor shortcode wrappers should not add space around the icons */
.elementor-widget-shortcode .heh-search,
.elementor-widget-shortcode .heh-cart { vertical-align: middle; }
.elementor-location-header .elementor-widget-shortcode .elementor-shortcode { line-height: 0; }

@media (max-width: 767px) {
	.heh-icon-btn { width: 38px; height: 38px; }
	.heh-search__panel { padding: 14px 12px 16px; }
	.heh-search__input { height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
	.heh-icon-btn { transition: none; }
}

/* ------------------------------------------------------------------ */
/* Main menu [he_header_menu]                                          */
/* ------------------------------------------------------------------ */
.heh-nav { display: flex; justify-content: center; width: 100%; font-family: Poppins, system-ui, sans-serif; line-height: 1.4; }
.heh-nav ul { list-style: none; margin: 0; padding: 0; }
.heh-nav__list { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 4px; }
.heh-nav__item { position: relative; display: flex; align-items: center; margin: 0; }
.heh-nav__link,
.heh-nav__link:visited {
	display: block;
	padding: 10px 14px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	color: #1F2A1F;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: inset 0 -2px 0 transparent;
	transition: color .15s ease, box-shadow .15s ease;
}
.heh-nav__item.has-sub > .heh-nav__link { padding-right: 2px; }
.heh-nav__link:hover,
.heh-nav__item:focus-within > .heh-nav__link { color: #1E4D2B; }
.heh-nav__item.is-current > .heh-nav__link { color: #1E4D2B; box-shadow: inset 0 -2px 0 #1E4D2B; }
.heh-nav__sub-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 26px; height: 32px; margin: 0 6px 0 0; padding: 0;
	border: 0; border-radius: 6px; background: transparent; box-shadow: none;
	color: #1F2A1F; cursor: pointer;
}
.heh-nav__sub-toggle svg { display: block; transition: transform .15s ease; }
.heh-nav__sub-toggle:hover,
.heh-nav__sub-toggle:focus { background: transparent; color: #1E4D2B; }
.heh-nav__sub-toggle:focus-visible { outline: 2px solid #1E4D2B; outline-offset: 1px; }

/* Desktop dropdown */
.heh-nav__sub {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 9980;
	min-width: 230px;
	padding: 8px !important;
	background: #fff;
	border: 1px solid #ECE4D3;
	border-radius: 12px;
	box-shadow: 0 16px 36px rgba(30, 77, 43, .14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.heh-nav__item.has-sub:hover > .heh-nav__sub,
.heh-nav__item.is-sub-open > .heh-nav__sub { opacity: 1; visibility: visible; transform: translateY(0); }
.heh-nav__item.has-sub:hover > .heh-nav__sub-toggle svg,
.heh-nav__item.is-sub-open > .heh-nav__sub-toggle svg { transform: rotate(180deg); }
.heh-nav__sublink,
.heh-nav__sublink:visited {
	display: block;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 14.5px;
	font-weight: 500;
	line-height: 1.4;
	color: #1F2A1F;
	text-decoration: none;
	white-space: nowrap;
}
.heh-nav__sublink:hover,
.heh-nav__sublink:focus-visible { background: #1E4D2B; color: #fff; outline: none; }

/* Menu button (tablet and phone) */
.heh-nav__burger {
	display: none;
	align-items: center; justify-content: center;
	width: 42px; height: 42px; padding: 0; margin: 0;
	border: 0; border-radius: 10px;
	background: #F1EBDD; color: #1E4D2B; box-shadow: none; cursor: pointer;
}
.heh-nav__burger:hover, .heh-nav__burger:focus { background: #1E4D2B; color: #fff; }
.heh-nav__burger:focus-visible { outline: 2px solid #1E4D2B; outline-offset: 2px; }
.heh-nav__burger svg { display: block; width: 24px; height: 24px; }
.heh-nav__burger .heh-svg { display: none; }
.heh-nav.is-open .heh-nav__burger .heh-nav__icon-open { display: none; }
.heh-nav.is-open .heh-nav__burger .heh-svg { display: block; }

@media (max-width: 1024px) {
	.heh-nav { width: auto; justify-content: flex-end; }
	.heh-nav__burger { display: inline-flex; }
	.heh-nav__list {
		display: none;
		position: fixed;
		left: 0; right: 0;
		top: var(--heh-top, 110px);
		z-index: 9985;
		max-height: calc(100vh - var(--heh-top, 110px));
		overflow-y: auto;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 8px 16px 18px !important;
		background: #FBF7EF;
		border-top: 1px solid #ECE4D3;
		box-shadow: 0 18px 40px rgba(30, 77, 43, .14);
	}
	.heh-nav.is-open .heh-nav__list { display: flex; }
	.heh-nav__item { flex-wrap: wrap; border-bottom: 1px solid #ECE4D3; }
	.heh-nav__item:last-child { border-bottom: 0; }
	.heh-nav__link, .heh-nav__link:visited { flex: 1; padding: 15px 6px; font-size: 16px; box-shadow: none !important; }
	.heh-nav__item.is-current > .heh-nav__link { color: #1E4D2B; font-weight: 600; }
	.heh-nav__item.has-sub > .heh-nav__link { padding-right: 6px; }
	.heh-nav__sub-toggle { width: 44px; height: 44px; margin: 0; background: #F1EBDD; border-radius: 8px; }
	.heh-nav__sub {
		position: static;
		flex-basis: 100%;
		min-width: 0;
		display: none;
		margin: 0 0 12px !important;
		padding: 4px !important;
		border-radius: 10px;
		box-shadow: none;
		opacity: 1; visibility: visible; transform: none; transition: none;
	}
	.heh-nav__item.has-sub:not(.is-sub-open):hover > .heh-nav__sub { display: none; }
	.heh-nav__item.has-sub.is-sub-open > .heh-nav__sub { display: block; }
	.heh-nav__item.has-sub:not(.is-sub-open):hover > .heh-nav__sub-toggle svg { transform: none; }
	.heh-nav__item.is-sub-open > .heh-nav__sub-toggle svg { transform: rotate(180deg); }
	.heh-nav__sublink, .heh-nav__sublink:visited { padding: 13px 14px; font-size: 15px; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
	.heh-nav__sub, .heh-nav__sub-toggle svg, .heh-nav__link { transition: none; }
}

/* ------------------------------------------------------------------ */
/* Phone and tablet header layout (whenever the menu button shows):    */
/*   [account] [search]   Hearty Eats   [cart] [menu]                  */
/* The two sides are the same width, so the logo is exactly centred.   */
/* ------------------------------------------------------------------ */
@media (max-width: 1024px) {
	.heh-mainbar.e-con-boxed > .e-con-inner,
	.heh-mainbar.e-con-full {
		display: grid !important;
		grid-template-columns: 42px 42px minmax(0, 1fr) 42px 42px;
		grid-template-areas: "acct search logo cart menu";
		align-items: center;
		column-gap: 4px !important;
		row-gap: 0 !important;
	}
	.heh-mainbar .heh-icons { display: contents !important; }
	.heh-mainbar .heh-icons > .e-con-inner { display: contents !important; }
	.heh-mainbar .heh-w-account { grid-area: acct; justify-self: center; }
	.heh-mainbar .heh-w-search  { grid-area: search; justify-self: center; }
	.heh-mainbar .heh-logo      { grid-area: logo; justify-self: center; min-width: 0; max-width: 100%; text-align: center; }
	.heh-mainbar .heh-w-cart    { grid-area: cart; justify-self: center; }
	.heh-mainbar .heh-menu      { grid-area: menu; justify-self: end; }
	.heh-mainbar .heh-w-account,
	.heh-mainbar .heh-w-search,
	.heh-mainbar .heh-logo,
	.heh-mainbar .heh-w-cart,
	.heh-mainbar .heh-menu { width: auto !important; margin: 0 !important; order: 0 !important; }
	.heh-mainbar .heh-logo .elementor-heading-title { white-space: nowrap; text-align: center; }
	.heh-mainbar .heh-w-account .elementor-icon-wrapper { line-height: 0; }
	.heh-mainbar .heh-w-account .elementor-icon {
		display: inline-flex; align-items: center; justify-content: center;
		width: 40px; height: 40px; border-radius: 999px;
	}
	.heh-mainbar .heh-w-account .elementor-icon:hover { background: #F1EBDD; }
	.heh-mainbar .heh-menu .heh-nav { width: auto; }
}
@media (max-width: 379px) {
	.heh-mainbar.e-con-boxed > .e-con-inner,
	.heh-mainbar.e-con-full { grid-template-columns: 36px 36px minmax(0, 1fr) 36px 38px; column-gap: 2px !important; }
	.heh-mainbar .heh-icon-btn,
	.heh-mainbar .heh-w-account .elementor-icon { width: 36px; height: 36px; }
	.heh-mainbar .heh-nav__burger { width: 38px; height: 38px; }
	.heh-mainbar .heh-logo .elementor-heading-title { font-size: 20px !important; }
}
