/*
 * [rodun_topheader] — vaste witte topbalk.
 * Alle styling namespaced onder .rodun-topheader.
 */

.rodun-topheader {
	--primary: var(--rodun-primary, #0a2a5e);
	--foreground: var(--rodun-fg, #0f1128);
	--muted-foreground: var(--rodun-muted, #64748b);
	--secondary: #f1f3f7;
	--border: var(--rodun-border, #e5e7eb);
	--rodun-site-max-width: 1200px;
	--rodun-site-padding-x: 30px;

	width: 100%;
	box-sizing: border-box;
}

.rodun-topheader__bar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	/* Hoog genoeg om boven Avada hero, page titles en sticky containers te liggen.
	 * Binnen deze stacking context zit ook de search-results dropdown (z 60). */
	z-index: 9999;
	background: transparent;
	border: 0;
	transition: transform 0.3s ease;
	pointer-events: none;
}

.rodun-topheader__site {
	width: 100%;
	max-width: var(--rodun-site-max-width);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--rodun-site-padding-x);
	padding-right: var(--rodun-site-padding-x);
	box-sizing: border-box;
	pointer-events: auto;
	background: #fff;
	border-bottom: 1px solid var(--border);
	overflow: visible;
}

/* Ingelogd: WP admin bar (32px / 46px mobiel) staat erbovenop */
.admin-bar .rodun-topheader__bar {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .rodun-topheader__bar {
		top: 46px;
	}
}

.rodun-topheader.is-hidden .rodun-topheader__bar {
	transform: translateY(-100%);
}

.rodun-topheader__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 48px;
	width: 100%;
	box-sizing: border-box;
	min-width: 0;
	overflow: visible;
}

.rodun-topheader__spacer {
	height: 48px;
	flex-shrink: 0;
}

/* Logo */
.rodun-topheader__logo {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
	text-decoration: none;
	color: inherit;
	min-width: 0;
}

.rodun-topheader__logo-img {
	height: 36px;
	width: auto;
	display: block;
	flex-shrink: 0;
}

.rodun-topheader__brand {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1;
}

.rodun-topheader__brand-name {
	font-weight: 700;
	color: var(--primary);
	font-size: 14px;
	line-height: 1;
}

.rodun-topheader__brand-tag {
	font-style: normal;
	font-size: 8px;
	color: var(--muted-foreground);
	white-space: nowrap;
	line-height: 1.1;
	margin-top: 3px;
}

/* Search */
.rodun-topheader__search {
	position: relative;
	flex: 1;
	min-width: 0;
	display: none;
}

.rodun-topheader__search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	color: var(--muted-foreground);
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rodun-topheader__search-icon svg {
	width: 16px;
	height: 16px;
}

.rodun-topheader__search-input {
	width: 100%;
	height: 36px;
	padding: 0 12px 0 40px;
	background: var(--secondary);
	border: 1px solid var(--border);
	border-radius: 4px;
	font-size: 14px;
	color: var(--foreground);
	font-family: inherit;
}

.rodun-topheader__search-input:focus {
	outline: none;
	border-color: var(--primary);
}

.rodun-topheader__results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 4px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 6px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
	max-height: 320px;
	overflow: auto;
	/* Hoog binnen de topheader-bar context (z 9999). Boven lang-dropdown (z 80)
	 * en boven elke andere kid van de bar. `isolation: isolate` voorkomt dat
	 * een Avada/Fusion stacking context buiten de bar plotseling claim doet
	 * op deze regio. */
	z-index: 200;
	isolation: isolate;
	/* Header-bar heeft pointer-events:none; expliciet auto zodat hits
	 * op de dropdown (die buiten de bar uitsteekt) gegarandeerd doorkomen. */
	pointer-events: auto;
}

.rodun-topheader__results a {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	text-decoration: none;
	color: var(--foreground);
	border-bottom: 1px solid var(--border);
	transition: background 0.15s ease;
	pointer-events: auto;
	cursor: pointer;
}

.rodun-topheader__results a:last-child {
	border-bottom: 0;
}

.rodun-topheader__results a:hover,
.rodun-topheader__results a:focus-visible {
	background: rgba(241, 243, 247, 0.6);
	outline: none;
}

/*
 * Inner spans/img zouden via cascade pointer-events: auto erven, maar bij
 * Avada-installaties met universele `pointer-events: none` regels op
 * <span>/<img> (komt voor in Fusion CSS) is dit een veilig vangnet.
 */
.rodun-topheader__results a > * {
	pointer-events: auto;
}

.rodun-topheader__results-thumb {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 4px;
	background: #f5f5f5;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rodun-topheader__results-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	pointer-events: none; /* Klik altijd op de <a>, niet op de <img>. */
}

.rodun-topheader__results-body {
	flex: 1 1 auto;
	min-width: 0;
}

.rodun-topheader__results strong {
	display: block;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rodun-topheader__results-meta {
	display: block;
	font-size: 12px;
	color: var(--muted-foreground);
	margin-top: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rodun-topheader__results-empty {
	padding: 12px 14px;
	font-size: 14px;
	color: var(--muted-foreground);
}

/* Nav */
.rodun-topheader__nav {
	flex-shrink: 1;
	min-width: 0;
	display: none;
}

.rodun-topheader__nav .rodun-topnav,
.rodun-topheader__nav ul {
	display: flex;
	align-items: center;
	gap: 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rodun-topheader__nav .rodun-topnav a,
.rodun-topheader__nav ul a {
	font-size: 14px;
	font-weight: 500;
	color: rgba(15, 17, 40, 0.8);
	white-space: nowrap;
	text-decoration: none;
	transition: color 0.2s ease;
}

.rodun-topheader__nav .rodun-topnav a:hover,
.rodun-topheader__nav .rodun-topnav a:focus-visible,
.rodun-topheader__nav ul a:hover,
.rodun-topheader__nav ul a:focus-visible {
	color: var(--primary);
	outline: none;
}

/* Language */
.rodun-topheader__lang {
	position: relative;
	flex-shrink: 0;
}

.rodun-topheader__lang:not(.rodun-topheader__lang--mobile):hover,
.rodun-topheader__lang:not(.rodun-topheader__lang--mobile).is-open {
	z-index: 80;
}

/* Onzichtbare hover-zone onder de knop — vangt muis op vóór de lijst bereikt is */
.rodun-topheader__lang:not(.rodun-topheader__lang--mobile):hover::after,
.rodun-topheader__lang:not(.rodun-topheader__lang--mobile).is-open::after {
	content: '';
	position: absolute;
	top: 100%;
	left: -12px;
	right: -12px;
	height: 180px;
}

.rodun-topheader__lang-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 8px;
	background: transparent;
	border: 0;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	color: var(--foreground);
	cursor: pointer;
	font-family: inherit;
	line-height: 1;
}

.rodun-topheader__lang-btn:hover,
.rodun-topheader__lang-btn:focus-visible {
	color: var(--primary);
	outline: none;
}

.rodun-topheader__lang-icon,
.rodun-topheader__lang-chev {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--muted-foreground);
}

.rodun-topheader__lang-icon svg,
.rodun-topheader__lang-chev svg {
	width: 16px;
	height: 16px;
}

.rodun-topheader__lang-list {
	position: absolute;
	top: 100%;
	right: 0;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 6px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
	min-width: 128px;
	z-index: 80;
	display: none;
	pointer-events: auto;
}

/* Brug tussen knop en lijst */
.rodun-topheader__lang-list::before {
	content: '';
	position: absolute;
	top: -8px;
	left: -8px;
	right: -8px;
	height: 8px;
}

.rodun-topheader__lang:not(.rodun-topheader__lang--mobile).is-open > .rodun-topheader__lang-list {
	display: block;
}

@media (min-width: 1024px) and (hover: hover) {
	.rodun-topheader__lang:not(.rodun-topheader__lang--mobile):hover > .rodun-topheader__lang-list {
		display: block;
	}
}

.rodun-topheader__lang-option {
	display: block;
	width: 100%;
	padding: 8px 14px;
	background: transparent;
	border: 0;
	text-align: left;
	font-size: 14px;
	color: var(--foreground);
	cursor: pointer;
	font-family: inherit;
}

.rodun-topheader__lang-option:hover,
.rodun-topheader__lang-option:focus-visible {
	background: rgba(241, 243, 247, 0.5);
	outline: none;
}

.rodun-topheader__lang-option.is-active {
	color: var(--primary);
	font-weight: 500;
	background: rgba(241, 243, 247, 0.5);
}

.rodun-topheader__lang-muted {
	color: var(--muted-foreground);
	font-weight: 400;
}

/* Burger */
.rodun-topheader__burger {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0 -8px 0 auto;
	background: transparent;
	border: 0;
	border-radius: 4px;
	color: var(--foreground);
	cursor: pointer;
	flex-shrink: 0;
}

.rodun-topheader__burger svg {
	width: 24px;
	height: 24px;
}

.rodun-topheader__burger:hover,
.rodun-topheader__burger:focus-visible {
	color: var(--primary);
	outline: none;
}

.rodun-topheader__burger-close {
	display: none;
}

.rodun-topheader.is-mobile-open .rodun-topheader__burger-open {
	display: none;
}

.rodun-topheader.is-mobile-open .rodun-topheader__burger-close {
	display: flex;
}

/* Mobile panel */
.rodun-topheader__mobile[hidden] {
	display: none;
}

.rodun-topheader__mobile {
	position: fixed;
	inset: 0;
	z-index: 10000;
	pointer-events: none;
}

.admin-bar .rodun-topheader__mobile {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .rodun-topheader__mobile {
		top: 46px;
	}
}

.rodun-topheader.is-mobile-open .rodun-topheader__mobile {
	display: block;
	pointer-events: auto;
}

.rodun-topheader__mobile-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 17, 40, 0.4);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.rodun-topheader.is-mobile-open .rodun-topheader__mobile-overlay {
	opacity: 1;
}

.rodun-topheader__mobile-panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(100%, 320px);
	background: #fff;
	box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
	transform: translateX(100%);
	transition: transform 0.3s ease;
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 16px 20px 24px;
	overflow-y: auto;
}

.rodun-topheader.is-mobile-open .rodun-topheader__mobile-panel {
	transform: translateX(0);
}

.rodun-topheader__mobile-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.rodun-topheader__mobile-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	color: var(--foreground);
}

.rodun-topheader__mobile-close svg {
	width: 24px;
	height: 24px;
}

.rodun-topheader__search--mobile {
	display: block;
	flex: 0 0 auto;
}

.rodun-topheader__nav--mobile {
	display: block;
}

.rodun-topheader__nav--mobile .rodun-topnav {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
}

.rodun-topheader__nav--mobile .rodun-topnav a {
	display: block;
	padding: 12px 0;
	border-bottom: 1px solid var(--border);
	white-space: normal;
}

.rodun-topheader__lang--mobile .rodun-topheader__lang-list {
	position: static;
	margin: 0;
	box-shadow: none;
	border: 0;
	padding: 0;
	display: block;
}

.rodun-topheader__lang--mobile .rodun-topheader__lang-list[hidden] {
	display: block;
}

.rodun-topheader__lang-list--stack .rodun-topheader__lang-option {
	border-bottom: 1px solid var(--border);
}

.rodun-topheader__mobile-lang-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted-foreground);
	margin-bottom: 8px;
}

/* Desktop */
@media (min-width: 1024px) {
	.rodun-topheader__search {
		display: block;
	}

	.rodun-topheader__nav--desktop {
		display: block;
	}

	.rodun-topheader__burger {
		display: none;
	}

	.rodun-topheader__lang--mobile {
		display: none;
	}
}

@media (max-width: 1023px) {
	.rodun-topheader__brand-tag {
		display: none;
	}

	.rodun-topheader__lang-btn {
		display: none;
	}

	.rodun-topheader__lang:not(.rodun-topheader__lang--mobile) > .rodun-topheader__lang-list {
		display: none !important;
	}

	.rodun-topheader__lang:not(.rodun-topheader__lang--mobile).is-open > .rodun-topheader__lang-list {
		display: none !important;
	}
}
