/*
 * Menubalk ([st_menubar]): balk, logo, menu, profiel en (tablet en kleiner) hamburger met flyout.
 * Maten en kleuren gelijk aan de oude Beaver Builder-header: 20px van de rand, max. 1260px breed,
 * 2px rand, 20px ronde hoeken, glas (wit 8% + blur), logo 60px.
 * Extra specifiek en met !important waar Beaver Builder en general.css knoppen en links anders opmaken.
 */

.st-menubar,
.st-menubar__panel {
	--st-menubar-accent: var(--fl-global-st-accent, #ad7fff);
	--st-menubar-border: var(--fl-global-st-border, rgba(255, 255, 255, 0.2));
	--st-menubar-ease: cubic-bezier(0.4, 0, 0.2, 1);
	--st-menubar-top: calc(20px + var(--wp-admin--admin-bar--height, 0px));
}

.st-menubar ul,
.st-menubar__panel ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ---------- De balk ---------- */

.st-menubar__bar {
	position: fixed;
	top: var(--st-menubar-top);
	left: 20px;
	right: 20px;
	z-index: 100;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 1260px;
	min-height: 84px;
	margin: 0 auto;
	padding: 10px 10px 10px 20px;
	border: 2px solid transparent; /* ruimte voor de rand; de zichtbare rand zit op ::before */
	border-radius: 20px;
	animation: st-menubar-in 0.8s var(--st-menubar-ease) both;
}

/*
 * Glas-achtergrond op een pseudo-element in plaats van op de balk zelf: een element met backdrop-filter wordt een
 * "backdrop root", en dan zou de profiel-dropdown (die in de balk zit maar eronder hangt) de pagina niet kunnen blurren.
 * De rand staat ook op het pseudo-element: een rand op de balk zelf ligt eronder en zou mee worden geblurd (onzichtbaar).
 */
.st-menubar__bar::before {
	content: "";
	position: absolute;
	inset: -2px;
	z-index: -1;
	box-sizing: border-box;
	border: 2px solid var(--st-menubar-border);
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.08);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	pointer-events: none;
}

@keyframes st-menubar-in {
	from {
		opacity: 0;
		transform: translateY(-40px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.st-menubar__logo {
	display: block;
	flex-shrink: 0;
	line-height: 0;
}

.st-menubar__logo img {
	display: block;
	width: 60px;
	height: 60px;
	object-fit: contain;
}

.st-menubar__end {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
}

/* ---------- Desktop: horizontaal menu ---------- */

.st-menubar__list {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.st-menubar__list > li {
	position: relative;
}

.st-menubar__list a {
	display: block;
	padding: 14px;
	color: #fff !important;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none !important;
	white-space: nowrap;
}

.st-menubar__list a:hover,
.st-menubar__list a:focus-visible,
.st-menubar__list .current-menu-item > a,
.st-menubar__list .current-menu-ancestor > a {
	color: var(--st-menubar-accent) !important;
}

/* Submenu: dropdown in dezelfde stijl als het profielmenu. */
.st-menubar__list .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	min-width: 200px;
	padding: 8px !important;
	border: 2px solid rgb(120, 53, 238);
	border-radius: 16px;
	background: #1c1b4a;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.st-menubar__list li:hover > .sub-menu,
.st-menubar__list li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

.st-menubar__list .sub-menu a {
	padding: 10px 14px;
	border-radius: 10px;
}

.st-menubar__list .sub-menu a:hover,
.st-menubar__list .sub-menu a:focus-visible {
	background: rgba(255, 255, 255, 0.12);
}

/* Bewegend lijntje onder het actieve / gehoverde item (zie menubar.js). */
.st-menubar__indicator {
	position: absolute;
	left: 0;
	bottom: 4px;
	width: 0;
	height: 2px;
	border-radius: 2px;
	background: var(--st-menubar-accent);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.35s var(--st-menubar-ease), width 0.35s var(--st-menubar-ease), opacity 0.25s ease;
}

.st-menubar__indicator.is-visible {
	opacity: 1;
}

.st-menubar__indicator.st-no-transition {
	transition: opacity 0.25s ease;
}

/* ---------- Profiel in de balk (desktop) ---------- */

/* Geen position: relative: de dropdown hangt aan de balk zelf (die fixed is), zodat hij altijd 20px onder de balk begint. */
.st-menubar__profile {
	display: flex;
	align-items: center;
}

.st-menubar button.st-menubar__profile-toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 0;
	margin: 0;
	padding: 4px 8px 4px 4px !important;
	border: 0 !important;
	border-radius: 30px !important;
	background: transparent !important;
	box-shadow: none !important;
	color: #fff !important;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
}

.st-menubar button.st-menubar__profile-toggle:hover,
.st-menubar button.st-menubar__profile-toggle[aria-expanded="true"] {
	background: rgba(255, 255, 255, 0.1) !important;
}

.st-menubar button.st-menubar__profile-toggle:focus-visible,
.st-menubar__profile-menu a:focus-visible {
	box-shadow: 0 0 0 2px rgb(170, 120, 255) !important;
}

.st-menubar .st-menubar__avatar,
.st-menubar__panel .st-menubar__avatar {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50% !important;
	object-fit: cover;
}

.st-menubar__profile-arrow {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.st-menubar__profile-toggle[aria-expanded="true"] .st-menubar__profile-arrow {
	transform: rotate(180deg);
}

/* Zelfde rand en achtergrond als de balk; top/right gemeten vanaf de binnenkant van de balk, dus de 2px rand erbij. */
.st-menubar__profile-menu {
	position: absolute;
	top: calc(100% + 2px + 10px);
	right: -2px;
	z-index: 1000;
	min-width: 180px;
	padding: 8px;
	border: 2px solid var(--st-menubar-border);
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.08);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	text-align: left;
}

.st-menubar__profile-menu:not([hidden]) {
	display: flex;
	flex-direction: column;
}

.st-menubar__profile-menu[hidden] {
	display: none;
}

.st-menubar__profile-menu a {
	display: block;
	padding: 8px 14px;
	border-radius: 10px;
	color: #fff !important;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
	white-space: nowrap;
}

.st-menubar__profile-menu a:hover,
.st-menubar__profile-menu a:focus-visible {
	background: rgba(255, 255, 255, 0.12);
}

/* Uitloggen los van de rest, met een lijntje erboven (dropdown en flyout). */
.st-menubar__profile-item--logout,
.st-menubar__panel-link--logout {
	position: relative;
	margin-top: 6px;
}

.st-menubar__profile-item--logout::before,
.st-menubar__panel-link--logout::before {
	content: "";
	position: absolute;
	top: -4px;
	left: 8px;
	right: 8px;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* ---------- Hamburger ---------- */

.st-menubar button.st-menubar__toggle,
.st-menubar__panel button.st-menubar__close {
	position: relative;
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 12px !important;
	background: transparent !important;
	box-shadow: none !important;
	color: #fff !important;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.st-menubar__panel button.st-menubar__close {
	display: inline-flex;
}

.st-menubar button.st-menubar__toggle:hover,
.st-menubar__panel button.st-menubar__close:hover {
	background: rgba(255, 255, 255, 0.1) !important;
	color: var(--st-menubar-accent) !important;
}

.st-menubar button.st-menubar__toggle:focus-visible,
.st-menubar__panel button.st-menubar__close:focus-visible,
.st-menubar__panel a:focus-visible {
	box-shadow: 0 0 0 2px rgb(170, 120, 255) !important;
}

.st-menubar__burger {
	position: relative;
	display: block;
	width: 22px;
	height: 16px;
}

.st-menubar__burger > span {
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transition: transform 0.35s var(--st-menubar-ease), opacity 0.2s ease, top 0.35s var(--st-menubar-ease);
}

.st-menubar__burger > span:nth-child(1) { top: 0; }
.st-menubar__burger > span:nth-child(2) { top: 7px; }
.st-menubar__burger > span:nth-child(3) { top: 14px; }

/* Open: de buitenste lijnen schuiven naar het midden en draaien tot een X, de middelste verdwijnt. */
.is-active > .st-menubar__burger > span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.is-active > .st-menubar__burger > span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.is-active > .st-menubar__burger > span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

/* De X in de flyout wordt pas een X als het paneel binnenschuift. */
.st-menubar__close.is-active > .st-menubar__burger > span {
	transition-delay: 0.15s;
}

/* ---------- Flyout (wordt door menubar.js naar <body> verplaatst) ---------- */

.st-menubar__overlay {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.st-menubar__panel {
	position: fixed;
	top: var(--st-menubar-top);
	right: 20px;
	bottom: 20px;
	z-index: 9999;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: min(360px, calc(100vw - 40px));
	border: 2px solid var(--st-menubar-border);
	border-radius: 20px;
	background: linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)), rgba(12, 8, 36, 0.82);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	overflow: hidden;
	visibility: hidden;
	transform: translateX(calc(100% + 40px));
	transition: transform 0.45s var(--st-menubar-ease), visibility 0s linear 0.45s;
}

.st-menubar__overlay.is-open {
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

.st-menubar__panel.is-open {
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

/* Kop even hoog als de menubalk en dezelfde rechterpadding, zodat de X precies op de plek van de hamburger staat. */
.st-menubar__panel-head {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: space-between;
	min-height: 80px;
	padding: 0 10px 0 28px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.st-menubar__panel-title {
	color: rgba(255, 255, 255, 0.6);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* Menu en profiel scrollen samen als ze niet in het paneel passen; past het wel, dan staat het profiel onderin. */
.st-menubar__panel-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 14px 14px;
}

.st-menubar__panel-profile {
	margin-top: auto;
	padding-top: 24px;
}

.st-menubar__panel-user {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 14px 10px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.st-menubar__panel .st-menubar__panel-user .st-menubar__avatar {
	width: 48px;
	height: 48px;
}

.st-menubar__panel-user-name {
	overflow: hidden;
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.st-menubar__panel-links {
	display: flex;
	flex-direction: column;
}

.st-menubar__panel-links a {
	display: block;
	padding: 11px 14px;
	border-radius: 12px;
	color: rgba(255, 255, 255, 0.85) !important;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
}

.st-menubar__panel-links a:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--st-menubar-accent) !important;
}

.st-menubar__panel-list > li,
.st-menubar__panel-profile {
	opacity: 0;
	transform: translateX(24px);
	transition: opacity 0.3s ease, transform 0.4s var(--st-menubar-ease);
}

.st-menubar__panel.is-open .st-menubar__panel-profile {
	opacity: 1;
	transform: none;
	transition-delay: 0.3s;
}

.st-menubar__panel.is-open .st-menubar__panel-list > li {
	opacity: 1;
	transform: none;
	transition-delay: calc(0.12s + var(--st-menubar-i, 0) * 0.04s);
}

.st-menubar__panel-list a {
	display: block;
	padding: 14px;
	border-radius: 12px;
	color: #fff !important;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
}

.st-menubar__panel-list a:hover,
.st-menubar__panel-list .current-menu-item > a,
.st-menubar__panel-list .current-menu-ancestor > a {
	background: rgba(255, 255, 255, 0.08);
	color: var(--st-menubar-accent) !important;
}

.st-menubar__panel-list .sub-menu {
	margin: 0 0 6px 14px !important;
	padding-left: 10px !important;
	border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.st-menubar__panel-list .sub-menu a {
	padding: 10px 14px;
	font-size: 17px;
}

html.st-menubar-locked,
html.st-menubar-locked body {
	overflow: hidden;
}

/* ---------- Tablet en kleiner ---------- */

@media (max-width: 992px) {
	.st-menubar__nav {
		display: none;
	}

	.st-menubar button.st-menubar__toggle {
		display: inline-flex;
	}

	/* Het profiel staat dan onderin de flyout. */
	.st-menubar__profile {
		display: none;
	}
}

@media (min-width: 993px) {
	.st-menubar__overlay,
	.st-menubar__panel {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.st-menubar__bar {
		animation: none;
	}

	.st-menubar__panel,
	.st-menubar__overlay,
	.st-menubar__panel-list > li,
	.st-menubar__panel-profile,
	.st-menubar__burger > span,
	.st-menubar__indicator {
		transition-duration: 0.01s !important;
		transition-delay: 0s !important;
	}
}
