/* Happy Plants — custom header & primary nav (header.php) */

/* -------------------------------------------------------------------------
   Top announcement bar
   ------------------------------------------------------------------------- */

.hp-topbar__text {
	margin: 0;
	padding: 0;
	font-size: inherit;
	font-family: inherit;
	color: inherit;
	line-height: 1.3;
}

/* -------------------------------------------------------------------------
   Main header — grid: spacer | centered logo (14× paint) | search + utilities
   Row height follows content; items vertically centered (not bottom-aligned).
   ------------------------------------------------------------------------- */

.site-header,
.site-header .col-full,
#masthead,
.storefront-primary-navigation {
	padding: 0 !important;
	margin: 0 !important;
	min-height: 0 !important;
}

:root {
	--hp-admin-offset: 0px;
	/* Single-line bar; mobile may wrap — keep in sync with actual topbar padding */
	--hp-topbar-height: 30px;
	--hp-header-height: 86px;
	--hp-nav-height: 38px;
}

/*
 * style.css also targets `body .hp-topbar`; keep one authoritative rule here
 * (fixed stacking + promo text visible).
 */
body .hp-topbar {
	position: fixed !important;
	left: 0;
	right: 0;
	top: var(--hp-admin-offset) !important;
	z-index: 1210 !important;
	margin: 0 !important;
	width: 100%;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: var(--hp-topbar-height);
	background: var(--g) !important;
	text-align: center;
	font-family: var(--sans);
	font-size: 9px !important;
	color: rgba(255, 255, 255, 0.85) !important;
	padding: 5px 12px !important;
	letter-spacing: 0.04em;
}

.hp-header {
	background: var(--w);
	border-bottom: 0.5px solid var(--bd);
	overflow: visible;
	position: fixed !important;
	left: 0;
	right: 0;
	top: calc(var(--hp-admin-offset) + var(--hp-topbar-height)) !important;
	z-index: 1200 !important;
}

body.admin-bar {
	--hp-admin-offset: 32px;
}

@media (max-width: 782px) {
	body.admin-bar {
		--hp-admin-offset: 46px;
	}
}

.hp-nav {
	position: fixed;
	left: 0;
	right: 0;
	top: calc(var(--hp-admin-offset) + var(--hp-topbar-height) + var(--hp-header-height));
	z-index: 1190;
}

body {
	padding-top: calc(var(--hp-topbar-height) + var(--hp-header-height) + var(--hp-nav-height));
}

.hp-header__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	align-content: center;
	gap: 8px;
	max-width: 100%;
	min-height: min-content;
	padding: 4px 32px;
	box-sizing: border-box;
	overflow: visible;
}

.hp-header__left {
	min-width: 0;
	align-self: center;
}

.hp-header__logo {
	justify-self: center;
	align-self: center;
	line-height: 0;
	overflow: visible;
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hp-header__logo-link {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	overflow: visible;
}

.hp-header__logo-img {
	height: auto;
	width: clamp(280px, 36vw, 560px);
	display: block;
	max-height: 78px;
	max-width: 100%;
	object-fit: contain;
}

/* Right cluster: single line — nowrap; search shrinks before links (nowrap + minmax grid) */
.hp-header__right {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	min-width: 0;
	max-width: 100%;
	justify-self: end;
	align-self: center;
	overflow-x: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.hp-header__search--inline {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 280px;
	display: flex;
	align-items: center;
}

/* design-reference.html .search — icon + field; stays first (left) in .hp-header__right */
.hp-header__search-field {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	max-width: 280px;
	display: flex;
	align-items: center;
	gap: 8px;
	background: #f5f5f3;
	border-radius: 2px !important;
	padding: 7px 10px;
	border: none;
	box-sizing: border-box;
}

/* design-reference.html .si — !important beats style.css global * { border-radius: 0 } */
.hp-header__search-mglass {
	width: 11px;
	height: 11px;
	border: 1.2px solid var(--mu);
	border-radius: 50% !important;
	position: relative;
	flex-shrink: 0;
}

.hp-header__search-mglass::after {
	content: "";
	position: absolute;
	width: 3px;
	height: 1.2px;
	background: var(--mu);
	bottom: -3px;
	right: -2px;
	transform: rotate(45deg);
}

.hp-header__search-field .hp-product-search,
.hp-header__search-field .woocommerce-product-search {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	min-width: 0;
	margin: 0;
	padding: 0;
	background: transparent;
	border: none;
	box-shadow: none;
	position: relative;
}

.hp-header__search-field .hp-product-search .search-field,
.hp-header__search-field .woocommerce-product-search .search-field {
	flex: 1 1 auto;
	min-width: 0;
	border: none !important;
	background: none !important;
	box-shadow: none !important;
	outline: none;
	font-family: var(--sans);
	font-size: 11px !important;
	color: var(--t) !important;
	padding: 0 !important;
	width: 100%;
	line-height: 1.3;
}

.hp-header__search-field .hp-product-search .search-field:focus {
	outline: none;
}

.hp-header__search-field .hp-product-search__submit {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.hp-header__link {
	flex-shrink: 0;
	font-family: var(--sans);
	font-size: 11px;
	font-weight: 400;
	color: var(--mu);
	text-decoration: none;
	white-space: nowrap;
}

.hp-header__link:hover,
.hp-header__link:focus-visible {
	color: var(--t);
}

.hp-header__cart {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--t) !important;
	font-weight: 500 !important;
}

.hp-header__cart-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 16px;
	min-height: 16px;
	padding: 0 5px;
	font-size: 10px;
	font-weight: 500;
	line-height: 1;
	font-family: var(--sans);
	color: var(--w);
	background: var(--gold);
	border-radius: 999px !important;
}

/* -------------------------------------------------------------------------
   Secondary row — primary navigation: left-aligned, height from content
   ------------------------------------------------------------------------- */

.hp-nav {
	width: 100%;
	background: var(--w);
	border-bottom: 0.5px solid var(--bd);
	padding: 4px 32px;
	box-sizing: border-box;
	overflow: hidden;
}

.hp-nav .hp-nav__menu {
	display: flex;
	justify-content: flex-start;
	align-items: center;
	width: 100%;
	min-height: 0;
}

.hp-nav ul.hp-nav__list,
.hp-nav .hp-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	margin: 0;
	padding: 0;
	list-style: none;
	gap: 0;
}

.hp-nav .hp-nav__list > li {
	position: relative;
}

.hp-nav .hp-nav__list .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: auto;
	transform: none;
	z-index: 400;
	min-width: 200px;
	margin: 0;
	padding: 8px 0;
	list-style: none;
	background: var(--w);
	border: 0.5px solid var(--bd);
	text-align: left;
}

.hp-nav .hp-nav__list li:hover > .sub-menu,
.hp-nav .hp-nav__list li:focus-within > .sub-menu {
	display: block;
}

.hp-nav .hp-nav__list .sub-menu a {
	padding: 8px 14px;
	font-size: 11px;
	color: #555;
	border-bottom: none;
	display: block;
}

.hp-nav .hp-nav__list .sub-menu a:hover {
	color: #1c3a28;
}

.hp-nav .hp-nav__list .sub-menu .sub-menu {
	top: 0;
	left: 100%;
	right: auto;
}

.hp-nav .hp-nav__list > li > a {
	font-family: var(--sans);
	font-size: 11px;
	font-weight: 400;
	line-height: 1.2;
	color: #555;
	padding: 9px 12px;
	letter-spacing: 0.02em;
	text-decoration: none;
	border-bottom: 1.5px solid transparent;
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	vertical-align: middle;
}

.hp-nav .hp-nav__list > li.current-menu-item > a,
.hp-nav .hp-nav__list > li.current-menu-ancestor > a,
.hp-nav .hp-nav__list > li.current_page_item > a {
	color: #1c3a28;
	border-bottom-color: #1c3a28;
	font-weight: 500;
}

.hp-nav .hp-nav__list > li > a:hover {
	color: #1c3a28;
}
