/*
 * Header — custom utilities cluster ([gvbf-header-utilities]) and the search
 * modal. Layout/spacing/color only (font-independent). The header's overall
 * structure is configured in the Beaver Themer layout, not here.
 *
 * Matches the live header: a row of labeled icon buttons —
 * [Search] [Cart N] [Account] [color toggle] — where Search opens a modal
 * overlay rather than an inline search bar.
 */

/* --- Utilities cluster (right-aligned) --- */
.header-utilities {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 1.5rem;
	width: 100%;
}
.header-utilities > * {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	font: inherit;
	line-height: 1;
}
.header-utilities .gvbf-icon {
	display: inline-flex;
	line-height: 0;
}
.header-utilities .gvbf-icon svg {
	width: 20px;
	height: 20px;
	display: block;
}
.header-utilities .label {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	white-space: nowrap;
}
.gvbf-cart-count {
	font-weight: 700;
}

/* Search toggle styled as an outlined button (like live's "Search" pill) —
   brand-green border, 2px thick, 14px radius to match the site's buttons/photos. */
.header-utilities .header__search-toggle {
	border: var(--gvbf-border-width, 2px) solid var(--gvbf-primary, #00853d);
	border-radius: 14px;
	padding: 0.45rem 0.9rem;
	transition: border-color 0.2s ease, color 0.2s ease;
}
.header-utilities .header__search-toggle:hover,
.header-utilities .header__search-toggle:focus {
	border-color: var(--gvbf-color-green-dark, #004d26);
	color: var(--gvbf-color-green-dark, #004d26);
}

/* --- Search modal: full-screen, solid overlay (matches live) --- */
.search__modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	background: var(--surface, #fff); /* solid; follows light/dark scheme */
}
.search__modal.open {
	display: block;
}
.search__modal-inner {
	position: relative;
	min-height: 100%;
	padding: 1.5rem 2.5rem;
}
.search__modal-logo {
	position: absolute;
	top: 1.5rem;
	left: 2.5rem;
}
.search__modal-logo img {
	max-width: 220px;
	height: auto;
	display: block;
}
#search__close-btn {
	position: absolute;
	top: 1.5rem;
	right: 2.5rem;
	background: none;
	border: 0;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	color: inherit;
}
.search__modal .search-form {
	display: flex;
	gap: 1rem;
	justify-content: center;
	align-items: center;
	padding-top: 7rem;
}
.search__modal .search-field {
	width: 420px;
	max-width: 55vw;
	padding: 0.75rem 1rem;
	font-size: 1.1rem;
	border: 1px solid var(--gvbf-primary, #00853d);
}
.search__modal .search-submit {
	white-space: nowrap;
	padding: 0.75rem 1.25rem;
	border: 0;
	font-weight: 700;
	cursor: pointer;
	background: var(--gvbf-btn-bg, #ebf6e5);
	color: var(--gvbf-btn-text, #004d26);
}
.search__modal .search-submit:hover {
	background: var(--gvbf-btn-hover-bg, #7bc24e);
	color: var(--gvbf-btn-hover-text, #004d26);
}

/* --- Submenu carets: fixed distance from the item, decoupled from Link Spacing ---
 * BB reserves the arrow's space from the link's RIGHT padding (toggle width =
 * link_padding_right + 14, see the menu module's frontend.css.php), so BB's "Link
 * Spacing" both separates items AND pushes the arrow away from the text — entangled
 * by design. We decouple them: (1) shrink the grid columns to content + a fixed
 * column-gap = the arrow's distance from the text; (2) zero the link's right padding
 * so Link Spacing no longer feeds that gap. Net: the caret sits a FIXED distance
 * after the text, and BB's Link Spacing (now via the link's LEFT padding) controls
 * the space BETWEEN items, independently. Scoped to the Themer header's horizontal
 * menu, TOP-LEVEL items only (nested vertical submenus keep BB's right-aligned arrows).
 * Knobs: `column-gap` here = arrow distance; BB Menu → Style → Link Spacing = item gap. */
header[data-type="header"] .fl-menu-horizontal > .fl-has-submenu > .fl-has-submenu-container {
	grid-template-columns: max-content max-content;
	column-gap: 0.6rem;
}
header[data-type="header"] .fl-menu-horizontal > .fl-has-submenu > .fl-has-submenu-container > a {
	padding-right: 0 !important;
}

/* --- Flyout sub-menus: tighter spacing + readable text -----------------------
 * BB ships the dropdown links with very loose padding (measured 14px vertical /
 * 50px horizontal) and 16px text, so the flyouts feel sparse, the rows are tall,
 * and the long auto-generated genre list (17 items) runs off the bottom of the
 * screen. These rules apply ONLY to the header's flyout sub-menus — the top-level
 * bar is untouched (keep tuning that in the BB Menu module). All three values are
 * knobs: font-size = flyout text size, vertical padding = row spacing, horizontal
 * padding = item width. Tightening the rows also shortens the long lists so they
 * fit on screen. */
header[data-type="header"] .fl-menu .sub-menu a {
	padding: 8px 22px;      /* was 14px 50px */
	font-size: 1.0625rem;   /* ~17px; raise to 1.125rem (18px) for larger flyout text */
	line-height: 1.25;
}
