.sm-site-header .dropdown-menu.sm-mega-menu {
	left: 0 !important;
	right: 0 !important;
	margin-left: auto !important;
	margin-right: auto !important;
	top: 65px !important;
	inset: auto !important;
	/*max-width: 1120px !important;*/
	/*width: min(1120px, calc(100vw - 32px)) !important;*/
	width: 100vw;
	border: 0;
	border-radius: 0;
	box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.12);
	-webkit-box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.12);
	-moz-box-shadow: 0px 4px 4px -2px rgba(0, 0, 0, 0.12);
	padding: 22px 0;
	background: #fff;
	overflow: hidden;
	position: absolute;
	z-index: 1050;
}

/* Positioneer alleen het laatste menu item (overig) naar rechts */
.sm-site-header .navbar-nav > .nav-item:last-child .dropdown-menu.sm-mega-menu {
	left: auto !important;
	right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

li.nav-item a.nav-link {
	padding-top: 15px;
	padding-bottom: 15px;
}

.sm-site-header .dropdown.show > .dropdown-menu.sm-mega-menu {
	display: block;
}

.sm-site-header .dropdown.show > .dropdown-menu.show:not(.sm-mega-menu) {
	display: block;
}

.sm-site-header .sm-mega-heading .menu-label,
.sm-site-header .sm-mega-title span {
	text-decoration: none;
	display: flex;
	gap: 8px;
	font-family: var(--font-heading-family), sans-serif;
	color: rgba(15, 23, 42, 0.92);
	font-weight: var(--font-heading-weight-bold);
	font-size: 1.05rem;
	letter-spacing: .01em;
	text-transform: none;
}

.sm-site-header .sm-mega-heading {
	display: flex;
	align-items: center;
	gap: .6rem;
	position: relative;
	padding-bottom: 12px;
	margin-bottom: 12px;
}

.sm-site-header .sm-mega-heading::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 64px;
	height: 2px;
	background: #7db928;
}

.sm-site-header .sm-mega-heading i {
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0;
	background: rgba(125, 185, 40, 0.12);
	color: #7db928;
	box-shadow: none;
}

.sm-site-header .sm-mega-list {
	margin-top: 0;
	line-height: 1.75rem;
}

.sm-site-header .sm-mega-link {
	text-decoration: none;
	display: block;
	color: var(--text);
	transition: var(--transition);
	font-size: .94rem;
	padding: 6px 8px;
	border-radius: 0;
}

.sm-site-header .sm-mega-list li + li {
	margin-top: .35rem;
}

.sm-site-header .sm-mega-link:hover {
	color: var(--primary);
	background: rgba(15, 23, 42, 0.04);
}

.sm-site-header .sm-mega-col {
	position: relative;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	overflow: hidden;
}

.sm-site-header .sm-mega-widget-zone {
	border-left: 0;
	background: transparent;
}

.sm-site-header .dropdown-menu.sm-mega-menu .row.g-0 {
	--bs-gutter-x: 34px;
	--bs-gutter-y: 22px;
}

@media (min-width: 992px) {
	.sm-site-header .dropdown-menu.sm-mega-menu {
		--sm-mega-shift: 0px;
	}

	.sm-site-header .nav-item.dropdown.sm-mega,
	.sm-site-header .nav-item.dropdown.mega-menu,
	.sm-site-header .nav-item.dropdown:has(.sm-mega-menu) {
		position: static !important;
	}

	.sm-site-header .dropdown-menu.sm-mega-menu .col-md-8.col-lg-9 {
		flex: 0 0 auto;
		max-width: none;
	}

	.sm-site-header .sm-mega-col:not(:nth-last-child(1)) {
		border-right: 1px solid rgba(15, 23, 42, 0.08);
	}

	.sm-site-header .sm-mega-col {
		padding: 0 50px;
	}

	.sm-site-header .dropdown-menu.sm-mega-menu::after {
		content: "";
		position: absolute;
		top: 14px;
		right: 14px;
		bottom: 14px;
		width: clamp(200px, 24vw, 280px);
		border-radius: 0;
		background-size: cover;
		background-position: center;
		box-shadow: none;
		filter: saturate(.92) contrast(1.04);
		pointer-events: none;
		z-index: 0;
	}
}

@media (min-width: 1400px) {
	.sm-site-header .dropdown-menu.sm-mega-menu {
		max-width: 1240px !important;
		width: min(1240px, calc(100vw - 32px)) !important;
	}
}

.sm-site-header .navbar-nav {
	gap: 1.5rem;
}

.nav-link {
	font-family: var(--font-body-family);
	font-weight: var(--font-body-weight-base);
}

.sm-site-header .sm-mega-toggle i {
	margin-left: .35rem;
	font-size: .85em;
}

/* TOPBAR */
.sm-topbar {
	color: var(--text);
	border-bottom: 1px solid var(--primary);
	padding: 5px 0;
}

.sm-topbar .sm-topbar-menu {
	display: flex;
	justify-content: flex-end;
	gap: 15px;
	list-style: none;
	margin: 0;
	padding: 5px 0;
}

.sm-topbar .sm-topbar-menu {
	color: var(--text);
	text-decoration: none;
}

.sm-topbar .sm-topbar-menu .sub-menu {
	display: none !important;
}

/* SEARCH BOX (compact dropdown) */
.sm-header-actions .sm-search-panel {
	position: absolute;
	top: calc(100% + 32px);
	right: 0;
	width: min(320px, 90vw);
	background: #fff;
	border: none;
	border-radius: 0 0 5px 5px;
	padding: 16px;
	box-shadow: 0 50px 30px rgba(0, 0, 0, 0.12);
	opacity: 0;
	transform: translateY(-8px);
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
	z-index: 50;
}

.sm-header-actions .sm-search-panel.is-open {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.sm-header-actions .sm-search-inner {
	padding: 0;
}

/* Product styling mega menu */
.dropdown-menu.sm-mega-menu ul.products li.product {
	width: 100% !important;
	box-shadow: none !important;
	border: none !important;
	font-size: 1rem !important;
	padding: 0px !important;
	margin: 0px !important;
}

.dropdown-menu.sm-mega-menu ul.products li.product:hover {
	box-shadow: none !important;
	transform: none !important;
}

.dropdown-menu.sm-mega-menu ul.products li.product .sm-direct-checkout,
.dropdown-menu.sm-mega-menu ul.products li.product .price {
	display: none;
}

/* Algolia suggestions styling */
.sm-search-panel .aa-suggestion,
.sm-search-panel .aa-Item {
	border-radius: 10px;
	padding: 10px 12px;
	transition: background-color .15s ease;
}

.sm-search-panel .aa-suggestion:hover,
.sm-search-panel .aa-Item:hover,
.sm-search-panel .aa-Item[aria-selected="true"] {
	background: rgba(0, 0, 0, .04);
}

.aa-dropdown-menu .aa-suggestion em {
	color: var(--primary);
	background: var(--contrast-bg);
}

span.woocommerce-Price-amount.amount, span.woocommerce-Price-currencySymbol {
	font-weight: 600;
}

/* Force Algolia results to behave as normal content inside our panel */
.sm-search-panel .aa-dropdown-menu,
.sm-search-panel .aa-Panel,
.sm-search-panel .aa-PanelLayout,
.sm-search-panel .aa-PanelLayoutBody,
.sm-search-panel .aa-PanelLayoutSection {
	position: static !important;
	inset: auto !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	bottom: auto !important;
	transform: none !important;
	width: 100% !important;
	max-width: 100% !important;
	box-shadow: none !important;
	border: 0 !important;
	background: transparent;
}

.aa-suggestion .suggestion-meta {
	font-size: 0;
	line-height: 0;
}

/* zet font-size terug voor de echte waardes */
.aa-suggestion .suggestion-meta .sku,
.aa-suggestion .suggestion-meta .woocommerce-Price-amount,
.aa-suggestion .suggestion-meta .woocommerce-Price-currencySymbol,
.aa-suggestion .suggestion-meta bdi {
	font-size: 14px;
	line-height: 1.2;
}

/* zet thumbnail, titelblok en meta op 1 regel */
.sm-search-panel .aa-suggestion .suggestion-link {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* titelblok mag alle ruimte pakken */
.sm-search-panel .aa-suggestion .suggestion-post-attributes {
	flex: 1;
	min-width: 0;
}

/* prijs rechts uitlijnen */
.sm-search-panel .aa-suggestion .suggestion-meta {
	margin-left: auto;
	white-space: nowrap;
}

/* haal default p-marge weg in de meta */
.sm-search-panel .aa-suggestion .suggestion-meta p {
	margin: 0;
}

.sm-dropdown {
	border-radius: 0;
}

.flex-menu {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

@media (max-width: 992px) {
	.flex-menu {
		flex-direction: row-reverse;
	}

	#smPrimaryNav {
		flex-basis: 100%;
		flex-grow: 1;
		align-items: center;
		padding: 20px;
	}

	#smPrimaryNavDesk {
		display: none;
	}

	.sm-site-header .dropdown-menu.sm-mega-menu {
		position: static;
		left: 0;
		right: 0;
		top: auto;
		transform: none;
		max-width: none;
		width: 100% !important;
		border-radius: 0;
		box-shadow: none;
		padding: 16px;
	}
}

/* Only apply hover behavior on screens larger than 992px */
@media (min-width: 992px) {
	#smPrimaryNav {
		display: none;
	}

	#smPrimaryNavDesk {
		display: block;
	}

	.flex-menu {
		gap: 20px;
	}

	.nav-item.dropdown > .dropdown-menu {
		display: block;
		margin-top: 0;
		transform: translateY(-10px);
		transition: opacity .2s ease, transform .2s ease;
		z-index: 1050;
		pointer-events: none;
		opacity: 0;
	}

	.nav-item.dropdown:hover > .dropdown-menu {
		display: block;
		transform: translateY(0%);
		transition: opacity .2s ease, transform .2s ease;
		pointer-events: auto;
		opacity: 1;
	}

	.sm-site-header .nav-item.dropdown > .dropdown-menu.sm-mega-menu {
		left: 50% !important;
		right: auto !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		transform: translate(-50%, -10px) !important;
	}

	.sm-site-header .nav-item.dropdown:hover > .dropdown-menu.sm-mega-menu {
		transform: translate(-50%, 0) !important;
	}

	.sm-site-header .dropdown.show > .dropdown-menu.sm-mega-menu {
		opacity: 1;
		pointer-events: auto;
		transform: translate(-50%, 0) !important;
	}

	.sm-site-header .nav-item.dropdown:not(.sm-mega):not(.mega-menu) {
		position: relative;
	}

	.sm-site-header .nav-item.dropdown:not(.sm-mega):not(.mega-menu) > .dropdown-menu:not(.sm-mega-menu) {
		left: 50% !important;
		right: auto !important;
		transform: translate(-50%, -10px) !important;
	}

	.sm-site-header .nav-item.dropdown:not(.sm-mega):not(.mega-menu):hover > .dropdown-menu:not(.sm-mega-menu) {
		transform: translate(-50%, 0) !important;
	}

	.sm-site-header .navbar-nav > .nav-item.dropdown:not(.sm-mega):not(.mega-menu) > .dropdown-menu:not(.sm-mega-menu) {
		left: auto !important;
		right: 0 !important;
		transform: translate(0, -10px) !important;
	}

	.sm-site-header .navbar-nav > .nav-item.dropdown:not(.sm-mega):not(.mega-menu):hover > .dropdown-menu:not(.sm-mega-menu) {
		transform: translate(0, 0) !important;
	}

	.nav-item.dropdown > .dropdown-menu::before {
		content: "";
		position: absolute;
		top: -20px; /* This covers the gap created by translateY and navbar padding */
		left: 0;
		right: 0;
		height: 50px;
		background: transparent;
		display: block;
	}

	/* 3. Disable pointer events for the Bootstrap toggle on desktop */
	/* This prevents the "click" from interfering with the hover */
	.sm-mega-toggle {
		pointer-events: auto;
	}

	/* If you really want to ensure the "click" does nothing on desktop */
	/* we use this instead of pointer-events: none */
	.nav-item.dropdown:hover > .sm-mega-toggle {
		cursor: pointer;
	}

	.sm-mega-menu {
		padding-top: 10px; /* Invisible bridge between link and menu */
	}
}
