/* HyperGraphik Custom Menu — front-end styles
   All colors driven by CSS variables set inline (see hgcm-css-vars in <head>) */

.hgcm-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	background: var(--hgcm-bg, #0A0C18);
	z-index: 9999;
	transition: background 0.25s ease;
}

.hgcm-wrapper.hgcm-sticky {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
}

/* Fallback for when position:sticky is broken by an ancestor's overflow
   (a theme wrapper, a page-builder section/row, etc. set to anything
   other than overflow:visible). Uses position:fixed instead — JS adds
   matching padding-top to <body> so content doesn't jump underneath it. */
.hgcm-wrapper.hgcm-sticky-fixed {
	position: fixed;
	top: var(--hgcm-sticky-margin-top, 0px);
	left: var(--hgcm-sticky-margin-left, 0px);
	right: var(--hgcm-sticky-margin-right, 0px);
}

/* Transparent-on-load header */
.hgcm-wrapper.hgcm-transparent {
	background: transparent;
}

.hgcm-wrapper.hgcm-transparent.hgcm-scrolled {
	background: var(--hgcm-scrolled-bg, #0A0C18);
}

.hgcm-wrapper.hgcm-transparent .hgcm-menu > li > a,
.hgcm-wrapper.hgcm-transparent .hgcm-toggle-bar,
.hgcm-wrapper.hgcm-transparent .hgcm-icon-glyph,
.hgcm-wrapper.hgcm-transparent .hgcm-cart-count {
	transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.hgcm-wrapper.hgcm-transparent.hgcm-scrolled .hgcm-menu > li > a {
	color: var(--hgcm-scrolled-text, #fff);
}

.hgcm-wrapper.hgcm-transparent.hgcm-scrolled .hgcm-toggle-bar {
	background: var(--hgcm-scrolled-text, #fff);
}

.hgcm-wrapper.hgcm-transparent.hgcm-scrolled .hgcm-search-toggle,
.hgcm-wrapper.hgcm-transparent.hgcm-scrolled .hgcm-cart-link {
	color: var(--hgcm-scrolled-text, #fff);
}

/* Logo */
.hgcm-logo {
	display: flex;
	align-items: center;
	margin-right: 20px;
	flex-shrink: 0;
	padding-left: var(--hgcm-logo-padding-left, 0px);
	padding-right: var(--hgcm-logo-padding-right, 0px);
}

.hgcm-logo-img {
	width: 200px;
	height: 50px;
	object-fit: contain;
	display: block;
}

/* Toggle (hamburger) button — hidden by default, shown below breakpoint */
.hgcm-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	margin-left: auto;
}

.hgcm-toggle-bar {
	display: block;
	width: 26px;
	height: 2px;
	background: var(--hgcm-text, #fff);
	transition: transform 0.2s ease, opacity 0.2s ease, background 0.25s ease;
}

.hgcm-toggle[aria-expanded="true"] .hgcm-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.hgcm-toggle[aria-expanded="true"] .hgcm-toggle-bar:nth-child(2) {
	opacity: 0;
}
.hgcm-toggle[aria-expanded="true"] .hgcm-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Base nav / menu */
.hgcm-nav {
	flex: 1 1 auto;
	margin-left: 100px;
}

.hgcm-menu {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.hgcm-menu li {
	position: relative;
}

.hgcm-menu a {
	display: block;
	padding: 16px 18px;
	color: var(--hgcm-text, #fff);
	text-decoration: none;
	font-weight: 500;
	font-size: var(--hgcm-font-size, 15px);
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}

.hgcm-menu > li > a:hover,
.hgcm-menu > li > a:focus,
.hgcm-menu > li.current-menu-item > a {
	background: var(--hgcm-hover-bg, #FFAA00);
	color: var(--hgcm-hover-text, #0A0C18);
}

/* Chevron indicator for items with children */
.hgcm-menu li.menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-left: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	vertical-align: middle;
}

/* CTA button item — same shape as rounded button links (height, radius,
   centered alignment), but keeps its own distinct colors. */
.hgcm-menu li.hgcm-cta-item {
	margin-left: 8px;
	margin-top: 7px;
}

.hgcm-menu li.hgcm-cta-item > a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 35px;
	padding: 0 20px;
	border-radius: var(--hgcm-button-radius, 24px);
	background: var(--hgcm-cta-bg, #FFAA00);
	color: var(--hgcm-cta-text, #0A0C18);
}

.hgcm-menu li.hgcm-cta-item > a:hover,
.hgcm-menu li.hgcm-cta-item > a:focus {
	background: var(--hgcm-cta-hover-bg, #0A0C18);
	color: var(--hgcm-cta-hover-text, #fff);
}

/* Dropdown (sub-menu) — desktop */
.hgcm-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: var(--hgcm-dropdown-bg, #14172A);
	border-radius: 10px;
	box-shadow: 0 10px 24px rgba(0,0,0,0.25);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

/* Round the first/last item's own corners to match the container radius,
   rather than clipping the whole box with overflow:hidden — clipping
   would also cut off third-level nested flyout submenus, which are
   positioned outside this box (left: 100%) by design. */
.hgcm-menu .sub-menu > li:first-child > a {
	border-top-left-radius: 10px;
	border-top-right-radius: 10px;
}

.hgcm-menu .sub-menu > li:last-child > a {
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
}

.hgcm-menu .sub-menu .sub-menu {
	top: 0;
	left: 100%;
}

.hgcm-menu li.menu-item-has-children:hover > .sub-menu,
.hgcm-menu li.menu-item-has-children:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.hgcm-menu .sub-menu a {
	color: var(--hgcm-dropdown-text, #fff);
	padding: 12px 18px;
}

.hgcm-menu .sub-menu a:hover,
.hgcm-menu .sub-menu a:focus {
	background: var(--hgcm-dropdown-hover-bg, #FFAA00);
	color: var(--hgcm-dropdown-hover-text, #0A0C18);
}

/* Menu alignment (desktop) */
.hgcm-wrapper[data-align="center"] .hgcm-menu {
	justify-content: center;
}

.hgcm-wrapper[data-align="right"] .hgcm-menu {
	justify-content: flex-end;
}

/* Rounded button links — applies to top-level links only, and shares its
   exact shape (height, radius, centered alignment) with the CTA button
   above so both button types line up visually. Colors stay separate. */
.hgcm-wrapper[data-buttons="1"] .hgcm-menu > li:not(.hgcm-cta-item) {
	margin: 0 4px;
}

.hgcm-wrapper[data-buttons="1"] .hgcm-menu > li:not(.hgcm-cta-item) > a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 35px;
	padding: 0 20px;
	border-radius: var(--hgcm-button-radius, 24px);
	background: var(--hgcm-button-bg, #14172A);
	color: var(--hgcm-button-text, #fff);
}

.hgcm-wrapper[data-buttons="1"] .hgcm-menu > li:not(.hgcm-cta-item) > a:hover,
.hgcm-wrapper[data-buttons="1"] .hgcm-menu > li:not(.hgcm-cta-item) > a:focus,
.hgcm-wrapper[data-buttons="1"] .hgcm-menu > li.current-menu-item:not(.hgcm-cta-item) > a {
	background: var(--hgcm-button-hover-bg, #FFAA00);
	color: var(--hgcm-button-hover-text, #0A0C18);
}

/* Mega menu — full-width panel, sub-items reflow into columns */
.hgcm-menu li.hgcm-mega {
	position: static;
}

.hgcm-menu li.hgcm-mega > .sub-menu {
	left: 0;
	right: 0;
	width: 100%;
	padding: 20px 24px;
	column-gap: 24px;
}

.hgcm-menu li.hgcm-mega > .sub-menu > li {
	break-inside: avoid;
	margin-bottom: 4px;
}

.hgcm-menu li.hgcm-mega-cols-2 > .sub-menu { column-count: 2; }
.hgcm-menu li.hgcm-mega-cols-3 > .sub-menu { column-count: 3; }
.hgcm-menu li.hgcm-mega-cols-4 > .sub-menu { column-count: 4; }
.hgcm-menu li.hgcm-mega-cols-5 > .sub-menu { column-count: 5; }
.hgcm-menu li.hgcm-mega-cols-6 > .sub-menu { column-count: 6; }

/* Search icon + panel */
.hgcm-search-toggle,
.hgcm-cart-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: transparent;
	border: none;
	color: var(--hgcm-text, #fff);
	cursor: pointer;
	position: relative;
	text-decoration: none;
}

.hgcm-search-panel {
	position: absolute;
	top: 100%;
	right: 0;
	background: var(--hgcm-dropdown-bg, #14172A);
	padding: 16px;
	min-width: 280px;
	box-shadow: 0 10px 24px rgba(0,0,0,0.25);
	display: none;
}

.hgcm-search-panel.hgcm-search-open {
	display: block;
}

.hgcm-search-panel input[type="search"],
.hgcm-search-panel input[type="text"] {
	width: 100%;
	padding: 10px;
	box-sizing: border-box;
}

/* Icon glyphs — drawn entirely with CSS borders/pseudo-elements rather
   than inline <svg>. This is deliberate: shortcode/widget output is
   often run through wp_kses_post(), whose default allowed-tags list
   does NOT include <svg>/<path>, so an inline SVG icon gets silently
   deleted in some render contexts (Pagelayer shortcode widgets, text
   widgets, etc.) leaving an empty, clickable button with nothing
   visible inside it. A CSS-only shape can't be stripped that way. */
.hgcm-icon-glyph {
	position: relative;
	display: inline-block;
	color: inherit;
}

/* Magnifying glass */
.hgcm-icon-search {
	width: 13px;
	height: 13px;
	border: 2px solid currentColor;
	border-radius: 50%;
}

.hgcm-icon-search::after {
	content: "";
	position: absolute;
	width: 2px;
	height: 7px;
	background: currentColor;
	bottom: -7px;
	right: -2px;
	transform: rotate(-45deg);
	transform-origin: top;
}

/* Simple tote/cart bag: body + arched handle */
.hgcm-icon-cart {
	width: 16px;
	height: 12px;
	margin-top: 6px;
	border: 2px solid currentColor;
	border-top: none;
	border-radius: 0 0 2px 2px;
}

.hgcm-icon-cart::before {
	content: "";
	position: absolute;
	top: -8px;
	left: 2px;
	width: 8px;
	height: 8px;
	border: 2px solid currentColor;
	border-bottom: none;
	border-radius: 8px 8px 0 0;
}

/* Cart count badge */
.hgcm-cart-count {
	position: absolute;
	top: 2px;
	right: 2px;
	background: var(--hgcm-hover-bg, #FFAA00);
	color: var(--hgcm-hover-text, #0A0C18);
	font-size: 10px;
	line-height: 1;
	font-weight: 700;
	border-radius: 50%;
	min-width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2px;
}

.hgcm-notice {
	padding: 12px 18px;
	color: #b00;
	background: #fff3f3;
	font-size: 13px;
}

/* Backdrop for slide-in drawer styles */
.hgcm-backdrop {
	display: none;
}

/* -----------------------------------------------------------
   Dual-menu (per-device override): hide the inactive nav
   ----------------------------------------------------------- */
@media (min-width: 783px) {
	.hgcm-nav--mobile {
		display: none !important;
	}
}

@media (max-width: 782px) {
	.hgcm-nav--desktop {
		display: none !important;
	}
}

/* -----------------------------------------------------------
   Mobile layout — below the configurable breakpoint
   ----------------------------------------------------------- */
@media (max-width: 782px) {

	.hgcm-toggle {
		display: flex;
	}

	.hgcm-nav {
		margin-left: 0;
	}

	.hgcm-wrapper {
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		padding: 8px 16px;
	}

	.hgcm-search-toggle,
	.hgcm-cart-link {
		color: var(--hgcm-mobile-text, #fff);
	}

	/* Reset mega-menu column layout on mobile so items stack normally */
	.hgcm-menu li.hgcm-mega > .sub-menu {
		column-count: 1 !important;
		width: auto;
		padding: 0;
	}

	/* --- Accordion style (default) --- */
	.hgcm-wrapper[data-mobile-style="accordion"] .hgcm-nav {
		flex-basis: 100%;
		max-height: 0;
		overflow: hidden;
		background: var(--hgcm-mobile-bg, #0A0C18);
		transition: max-height 0.25s ease;
		position: static;
	}

	.hgcm-wrapper[data-mobile-style="accordion"].hgcm-mobile-open .hgcm-nav {
		max-height: 1400px;
	}

	/* QA fix: when Sticky Positioning Method is set to Fixed, the wrapper
	   itself is position:fixed but the accordion nav above was still
	   position:static (normal in-flow), so opening the accordion grew
	   the fixed wrapper's OWN box to contain it — visually ballooning
	   the entire fixed header bar to match the open menu's height
	   (reported as expanding to ~600px). Fixed mode specifically needs
	   the dropdown treated as an overlay panel instead: absolutely
	   positioned below the bar, with its own scroll if it's tall, so
	   the fixed bar's height never changes regardless of open/closed
	   state or how much content the menu has. */
	.hgcm-wrapper.hgcm-sticky-fixed[data-mobile-style="accordion"] .hgcm-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-height: 0;
	}

	.hgcm-wrapper.hgcm-sticky-fixed[data-mobile-style="accordion"].hgcm-mobile-open .hgcm-nav {
		max-height: 80vh;
		overflow-y: auto;
	}

	.hgcm-wrapper[data-mobile-style="accordion"] .hgcm-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		display: none;
		background: rgba(0,0,0,0.15);
	}

	.hgcm-wrapper[data-mobile-style="accordion"] .hgcm-menu li.hgcm-submenu-open > .sub-menu {
		display: block;
	}

	/* --- Slide-in drawer styles (left / right) --- */
	.hgcm-wrapper[data-mobile-style="drawer-left"] .hgcm-nav,
	.hgcm-wrapper[data-mobile-style="drawer-right"] .hgcm-nav {
		position: fixed;
		top: 0;
		bottom: 0;
		width: 280px;
		max-width: 85vw;
		overflow-y: auto;
		background: var(--hgcm-mobile-bg, #0A0C18);
		transition: transform 0.3s ease;
		z-index: 10001;
		padding-top: 60px;
	}

	.hgcm-wrapper[data-mobile-style="drawer-left"] .hgcm-nav {
		left: 0;
		transform: translateX(-100%);
	}

	.hgcm-wrapper[data-mobile-style="drawer-right"] .hgcm-nav {
		right: 0;
		transform: translateX(100%);
	}

	.hgcm-wrapper[data-mobile-style="drawer-left"].hgcm-mobile-open .hgcm-nav,
	.hgcm-wrapper[data-mobile-style="drawer-right"].hgcm-mobile-open .hgcm-nav {
		transform: translateX(0);
	}

	.hgcm-wrapper[data-mobile-style="drawer-left"] .hgcm-menu,
	.hgcm-wrapper[data-mobile-style="drawer-right"] .hgcm-menu {
		flex-direction: column;
		align-items: stretch;
	}

	.hgcm-wrapper[data-mobile-style="drawer-left"] .hgcm-menu .sub-menu,
	.hgcm-wrapper[data-mobile-style="drawer-right"] .hgcm-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		display: none;
		background: rgba(0,0,0,0.15);
	}

	.hgcm-wrapper[data-mobile-style="drawer-left"] .hgcm-menu li.hgcm-submenu-open > .sub-menu,
	.hgcm-wrapper[data-mobile-style="drawer-right"] .hgcm-menu li.hgcm-submenu-open > .sub-menu {
		display: block;
	}

	.hgcm-wrapper[data-mobile-style="drawer-left"].hgcm-mobile-open .hgcm-backdrop,
	.hgcm-wrapper[data-mobile-style="drawer-right"].hgcm-mobile-open .hgcm-backdrop {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0,0,0,0.5);
		z-index: 10000;
	}

	/* Shared mobile menu item look */
	.hgcm-menu {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
	}

	.hgcm-menu a {
		color: var(--hgcm-mobile-text, #fff);
		padding: 14px 20px;
		border-top: 1px solid rgba(255,255,255,0.08);
	}

	.hgcm-menu li.menu-item-has-children > a::after {
		float: right;
		margin-top: 6px;
	}

	.hgcm-menu li.hgcm-cta-item {
		margin: 10px 20px;
	}

	/* Rounded button links stack full-width on mobile with breathing room
	   between them instead of side-by-side pills. */
	.hgcm-wrapper[data-buttons="1"] .hgcm-menu > li:not(.hgcm-cta-item) {
		margin: 4px 20px;
	}

	.hgcm-wrapper[data-buttons="1"] .hgcm-menu > li:not(.hgcm-cta-item) > a {
		border-top: none;
	}

	/* Alignment is a desktop-only concept; mobile always stacks full-width. */
	.hgcm-wrapper[data-align] .hgcm-menu {
		justify-content: flex-start;
	}
}
