/* Header, navigation, search panel, mobile drawer */
.fj-header { background: var(--fj-surface); border-bottom: 1px solid var(--fj-border); position: relative; z-index: 50; }
.fj-sticky-header .fj-header { position: sticky; top: 0; }
.admin-bar.fj-sticky-header .fj-header { top: 32px; }
.fj-header__inner { display: flex; align-items: center; gap: var(--fj-space-3); min-height: var(--fj-header-h); }
.fj-brand { flex: none; display: flex; align-items: center; }
.fj-brand img { max-height: 44px; width: auto; }
.fj-brand__text { display: inline-flex; align-items: center; gap: 10px; color: var(--fj-primary); font-family: var(--fj-font-heading); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; }
.fj-brand__text:hover { text-decoration: none; }
.fj-brand__mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--fj-secondary); color: #fff; font-size: 1.05rem; }

.fj-nav { margin-left: auto; display: flex; align-items: center; }
.fj-menu, .fj-menu ul { list-style: none; margin: 0; padding: 0; }
.fj-menu { display: flex; align-items: center; gap: 4px; }
.fj-menu li { position: relative; }
.fj-menu a { display: block; padding: 10px 14px; border-radius: 6px; color: var(--fj-text); font-weight: 600; font-size: 0.95rem; transition: color var(--fj-ease), background var(--fj-ease); }
.fj-menu a:hover, .fj-menu .current-menu-item > a, .fj-menu .current_page_item > a, .fj-menu .current-menu-ancestor > a { color: var(--fj-secondary); text-decoration: none; }
.fj-menu .current-menu-item > a, .fj-menu .current_page_item > a { background: color-mix(in srgb, var(--fj-secondary) 8%, transparent); }

/* Dropdowns */
.fj-menu .menu-item-has-children > a::after, .fj-menu .page_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); opacity: 0.6; }
.fj-menu .sub-menu { position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--fj-surface); border: 1px solid var(--fj-border); border-radius: var(--fj-radius); box-shadow: var(--fj-shadow-md); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: all var(--fj-ease); z-index: 20; }
.fj-menu li:hover > .sub-menu, .fj-menu li:focus-within > .sub-menu, .fj-menu li.is-open > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.fj-menu .sub-menu a { font-weight: 500; padding: 9px 12px; }
.fj-menu .sub-menu .sub-menu { top: 0; left: 100%; }
.fj-submenu-toggle { display: none; }

.fj-header__actions { display: flex; align-items: center; gap: 8px; }
.fj-header__cta .fj-btn { padding: 10px 18px; }
.fj-nav__cta { display: none; }
.fj-iconbtn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; border: 0; background: transparent; color: var(--fj-primary); cursor: pointer; transition: background var(--fj-ease); }
.fj-iconbtn:hover { background: color-mix(in srgb, var(--fj-primary) 7%, transparent); }
.fj-menu-toggle { display: none; }
.fj-menu-toggle__close { display: none; }
.fj-menu-toggle[aria-expanded="true"] .fj-menu-toggle__open { display: none; }
.fj-menu-toggle[aria-expanded="true"] .fj-menu-toggle__close { display: inline; }

.fj-search-panel { border-top: 1px solid var(--fj-border); background: var(--fj-surface); padding: 16px 0; }
.fj-search-panel[hidden] { display: none; }
.fj-search-panel .fj-searchbar { max-width: none; }

/* Dark header variant */
.fj-header--dark { background: var(--fj-primary); border-bottom-color: rgba(255, 255, 255, 0.08); }
.fj-header--dark .fj-brand__text, .fj-header--dark .fj-iconbtn { color: #fff; }
.fj-header--dark .fj-iconbtn:hover { background: rgba(255, 255, 255, 0.1); }
.fj-header--dark .fj-menu > li > a { color: #e2e8f0; }
.fj-header--dark .fj-menu > li > a:hover, .fj-header--dark .fj-menu .current-menu-item > a { color: var(--fj-accent); background: transparent; }
.fj-header--dark .fj-search-panel { background: var(--fj-primary); border-top-color: rgba(255, 255, 255, 0.08); }

.fj-nav-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, 0.55); z-index: 40; }
.fj-nav-backdrop[hidden] { display: none; }

/* ---- Customizer-driven header + top bar + mega menu ---- */
.fj-header { background: var(--fj-header-bg, var(--fj-surface)); }
.fj-header--dark { background: var(--fj-header-bg, var(--fj-primary)); }
.fj-header__inner { min-height: var(--fj-header-h, 72px); }
.fj-brand img { max-height: var(--fj-logo-h, 44px); }
.fj-menu a { font-size: var(--fj-nav-size, 15px); color: var(--fj-header-text, var(--fj-text)); }
.fj-header--dark .fj-menu > li > a { color: var(--fj-header-text, #e2e8f0); }
.fj-header--align-left .fj-nav { margin-left: var(--fj-space-3); }
.fj-header--align-left .fj-header__actions { margin-left: auto; }
.fj-header--align-center .fj-nav { margin-inline: auto; }

.fj-topbar { background: var(--fj-topbar-bg, #0b1220); color: var(--fj-topbar-text, #cbd5e1); font-size: 0.85rem; }
.fj-topbar__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 38px; flex-wrap: wrap; padding-block: 4px; }
.fj-topbar a { color: inherit; font-weight: 600; }
.fj-topbar a:hover { color: var(--fj-accent); text-decoration: none; }
.fj-topbar__left, .fj-topbar__right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fj-social--topbar { margin: 0; gap: 6px; }
.fj-social--topbar a { width: 28px; height: 28px; border: 0; }

/* Mega menu: top-level items with many children */
.fj-menu > li.fj-mega { position: static; }
.fj-menu > li.fj-mega > .sub-menu {
	left: 50%; right: auto; width: min(var(--fj-container, 1200px), calc(100vw - 32px));
	display: grid; grid-template-columns: repeat(var(--fj-mega-cols, 4), minmax(0, 1fr)); gap: 0 8px;
	padding: 16px; max-height: 72vh; overflow-y: auto; transform: translate(-50%, 6px);
}
.fj-menu > li.fj-mega:hover > .sub-menu, .fj-menu > li.fj-mega:focus-within > .sub-menu, .fj-menu > li.fj-mega.is-open > .sub-menu { transform: translate(-50%, 0); }
.fj-menu > li.fj-mega > .sub-menu > li > a { font-size: 0.95rem; line-height: 1.35; padding: 10px 12px; }
.fj-sticky-header .fj-header { z-index: 55; }
