/*--------------------------------------------------------------
# B&S Media Mega Menu
# Built against megamenu.png. Desktop layout only for now:
# left col (label/title/CTA) - 2-col submenu grid - sidebar col.
--------------------------------------------------------------*/

/* The header template part still contains the old core Navigation block
   (menu 23851) next to both shortcodes; hide it now the mega menu is live. */
.header-desktop-view .wp-block-navigation,
.header-mobile-view .wp-block-navigation {
	display: none;
}

.bs-megamenu {
	display: none;
	position: relative;
	font-family: var(--wp--preset--font-family--outfit);
}

@media (min-width: 962px) {
	.bs-megamenu {
		display: block;
	}
}

.bs-megamenu__list {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: clamp(1rem, 2vw, 2.25rem);
	margin: 0;
	padding: 8px 0;
	list-style: none;
}

.bs-megamenu__item {
	position: static;
}

.bs-megamenu__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 0;
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
	font-size: 16px;
	font-weight: var(--wp--custom--font-weight--light, 300);
	line-height: 1;
	border-bottom: 1px solid transparent;
}

.bs-megamenu__link:hover {
	border-bottom-color: currentColor;
}

.bs-megamenu__link-text {
	position: relative;
}

.bs-megamenu__item.is-current .bs-megamenu__link-text::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -6px;
	height: 1px;
	background-color: currentColor;
}

.bs-megamenu__badge {
	font-size: 0.65rem;
	font-weight: var(--wp--custom--font-weight--semi-bold, 600);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--quaternary);
}

.bs-megamenu__chevron {
	display: inline-flex;
	width: 14px;
	height: 14px;
}

.bs-megamenu__chevron svg {
	width: 14px;
	height: 14px;
	transition: transform 0.2s ease-in-out;
}

.bs-megamenu__item--has-panel:hover .bs-megamenu__chevron svg,
.bs-megamenu__item--has-panel:focus-within .bs-megamenu__chevron svg {
	transform: rotate(180deg);
}

/* Panel: hidden by default, revealed on hover/focus of the parent item.
 * left:0/right:0 would only span the width of .bs-megamenu itself (the
 * nearest positioned ancestor), which is just the nav links, not the page.
 * Break out to full viewport width by centering off 50% instead. */
.bs-megamenu__panel {
	position: absolute;
	top: 100%;
	left: 50%;
	width: 100vw;
	z-index: 100;
	background-color: var(--wp--preset--color--background);
	border-top: 1px solid var(--wp--preset--color--septenary);
	box-shadow: 0 20px 40px -5px rgb(15 16 18 / 12%);
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%) translateY(-8px);
	transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out, visibility 0.2s;
}

.bs-megamenu__item--has-panel:hover .bs-megamenu__panel,
.bs-megamenu__item--has-panel:focus-within .bs-megamenu__panel {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.bs-megamenu__panel-inner {
	display: grid;
	grid-template-columns: 1fr 2fr 1fr;
	gap: clamp(2rem, 4vw, 4rem);
	max-width: var(--wp--style--global--wide-size, 1280px);
	min-height: 300px;
	margin: 0 auto;
	padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem);
}

/* Left column: label / title / CTA */
.bs-megamenu__col--intro {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.bs-megamenu__intro-label {
	font-size: 0.7rem;
	font-weight: var(--wp--custom--font-weight--regular, 400);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--tertiary);
	margin-bottom: 0.75rem;
}

.bs-megamenu__intro-title {
	font-family: var(--wp--preset--font-family--fraunces, var(--wp--preset--font-family--outfit));
	font-weight: 400;
	font-size: 36px;
	line-height: var(--wp--custom--typography--line-height--tiny, 1.15);
	margin: 0 0 1.25rem;
	color: var(--wp--preset--color--foreground);
}

.bs-megamenu__intro-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 15px;
	font-weight: var(--wp--custom--font-weight--regular, 400);
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
	line-height: 1.4;
}

.bs-megamenu__intro-cta-arrow {
	display: inline-flex;
}

.bs-megamenu__intro-cta-arrow svg {
	width: 14px;
	height: 14px;
}

.bs-megamenu__intro-url {
	margin-top: 0.5rem;
	font-family: var(--wp--preset--font-family--inconsolata, monospace);
	font-size: 0.75rem;
	color: var(--wp--preset--color--tertiary);
	opacity: 0.7;
}

/* Middle column: 2-col masonry grid of submenus */
.bs-megamenu__col--submenus {
	columns: 2;
	column-gap: clamp(2rem, 4vw, 4rem);
}

.bs-megamenu__submenu {
	break-inside: avoid;
	margin-bottom: 2rem;
}

.bs-megamenu__submenu-title,
.bs-megamenu__sidebar-title {
	font-size: 12px;
	font-weight: var(--wp--custom--font-weight--medium, 500);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--tertiary);
	opacity: 0.7;
	margin: 0 0 8px;
}

.bs-megamenu__submenu-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bs-megamenu__submenu-list li + li {
	margin-top: 4px;
}

.bs-megamenu__submenu-list a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
	font-size: 0.9rem;
}

.bs-megamenu__submenu-list a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.bs-megamenu__submenu-arrow {
	display: inline-flex;
}

.bs-megamenu__submenu-arrow svg {
	width: 14px;
	height: 14px;
}

/* Right column: "Ook interessant" sidebar */
.bs-megamenu__col--sidebar {
	border-left: 1px solid var(--wp--preset--color--septenary);
	padding-left: clamp(1.5rem, 3vw, 2.5rem);
}

.bs-megamenu__sidebar-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bs-megamenu__sidebar-list li + li {
	margin-top: 0.65rem;
}

.bs-megamenu__sidebar-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
	font-size: 0.9rem;
}

.bs-megamenu__sidebar-arrow {
	display: inline-flex;
	opacity: 0.6;
	transition: transform 0.15s ease-in-out;
}

.bs-megamenu__sidebar-arrow svg {
	width: 14px;
	height: 14px;
}

.bs-megamenu__sidebar-list a:hover .bs-megamenu__sidebar-arrow {
	transform: translateX(3px);
}

/*--------------------------------------------------------------
# Mobile drawer (below 962px — the mega menu itself is display:none there)
--------------------------------------------------------------*/

.bs-mobile-menu__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	background: none;
	border: 0;
	color: var(--wp--preset--color--foreground);
	cursor: pointer;
}

@media (min-width: 962px) {
	.bs-mobile-menu__toggle {
		display: none;
	}
}

.bs-mobile-menu__toggle-icon {
	display: inline-flex;
}

.bs-mobile-menu__toggle-icon svg {
	width: 24px;
	height: 24px;
}

.bs-mobile-menu__drawer {
	position: fixed;
	inset: 0;
	z-index: 1000;
	visibility: hidden;
	pointer-events: none;
	/* Delay switching to hidden until the backdrop fade / panel slide
	   (0.3s, the longer of the two) have finished playing on close. */
	transition: visibility 0s linear 0.3s;
}

.bs-mobile-menu__drawer.is-open {
	visibility: visible;
	pointer-events: auto;
	/* On open, become visible immediately instead of waiting. */
	transition-delay: 0s;
}

@media (min-width: 962px) {
	.bs-mobile-menu__drawer {
		display: none;
	}
}

.bs-mobile-menu__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgb(15 16 18 / 50%);
	opacity: 0;
	transition: opacity 0.25s ease-in-out;
}

.bs-mobile-menu__drawer.is-open .bs-mobile-menu__backdrop {
	opacity: 1;
}

.bs-mobile-menu__panel {
	position: absolute;
	top: 0;
	left: 0;
	box-sizing: border-box;
	height: 100%;
	width: min(85vw, 360px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background-color: var(--wp--preset--color--background);
	box-shadow: 20px 0 40px -5px rgb(15 16 18 / 15%);
	padding: 24px 20px 40px;
	transform: translateX(-100%);
	transition: transform 0.3s ease-in-out;
	font-family: var(--wp--preset--font-family--outfit);
}

.bs-mobile-menu__drawer.is-open .bs-mobile-menu__panel {
	transform: translateX(0);
}

.bs-mobile-menu__close {
	display: inline-flex;
	width: 32px;
	height: 32px;
	align-items: center;
	justify-content: center;
	margin: 0 0 16px auto;
	padding: 0;
	background: none;
	border: 0;
	color: var(--wp--preset--color--foreground);
	cursor: pointer;
}

.bs-mobile-menu__close svg {
	width: 22px;
	height: 22px;
}

.bs-mobile-menu__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bs-mobile-menu__item {
	border-bottom: 1px solid var(--wp--preset--color--septenary);
}

.bs-mobile-menu__link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 0;
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
	font-size: 16px;
}

.bs-mobile-menu__item.is-current .bs-mobile-menu__link {
	font-weight: var(--wp--custom--font-weight--semi-bold, 600);
}

.bs-mobile-menu__details {
	padding: 0;
}

.bs-mobile-menu__summary {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 0;
	font-size: 16px;
	color: var(--wp--preset--color--foreground);
	cursor: pointer;
	list-style: none;
}

.bs-mobile-menu__summary::-webkit-details-marker {
	display: none;
}

.bs-mobile-menu__chevron {
	display: inline-flex;
	width: 14px;
	height: 14px;
	margin-left: auto;
}

.bs-mobile-menu__chevron svg {
	width: 14px;
	height: 14px;
	transition: transform 0.2s ease-in-out;
}

.bs-mobile-menu__details[open] .bs-mobile-menu__chevron svg {
	transform: rotate(180deg);
}

.bs-mobile-menu__submenu {
	margin-top: 16px;
	padding: 0 0 16px;
}

.bs-mobile-menu__group {
	margin-bottom: 24px;
}

.bs-mobile-menu__group-title {
	font-size: 12px;
	font-weight: var(--wp--custom--font-weight--medium, 500);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--tertiary);
	opacity: 0.7;
	margin: 0 0 8px;
}

.bs-mobile-menu__sublist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bs-mobile-menu__sublist li + li {
	margin-top: 4px;
}

.bs-mobile-menu__sublist a {
	display: block;
	padding: 4px 0;
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
	font-size: 0.9rem;
}

.bs-mobile-menu__sublist a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Scroll lock while the drawer is open (toggled by megamenu.js). */
html.bs-mobile-menu-open {
	overflow: hidden;
}
