:root {
    --flyout_header_height: 96px;
    --flyout_footer_height: 83px;

    //Nav Top level
    --main_menu_link_padding_top: 20px;
    --main_menu_link_padding_side: 20px;
    --main_menu_link_spacing: calc(var(--main_menu_link_padding_side) * 2);
    --main_menu_link_icon_padding: 24px;

    --main_menu_sub_link_padding_top: 8px;
    --main_menu_sub_link_padding_side: 0;

    --main_menu_sub_menu_padding: 24px 0;

    //Grid
    --main_menu_sub_gutter: 32px;
    --main_menu_sub_gutter_spacing: calc(var(--main_menu_sub_gutter) / 2);

    //Colours
    --main_menu_sub_menu_bg_color: @dark_color;
    --main_menu_sub_menu_text_color: #fff;
    --main_menu_sub_menu_highlight_color: @primary_color;
    --main_menu_top_level_highlight_color: @secondary_color;

    //Font
    --main_menu_font_size: 14;
    --main_menu_line_height: 14px;

    --main_menu_sub_menu_font_size: 14;
    --main_menu_sub_menu_line_height: 14px;

    //Icons
    --main_menu_icon_weight: @global_fa_font_weight;

    //Borders
    --main_menu_sub_menu_border_top: 1.5px solid @border_color_alt;
    --main_menu_sub_menu_border_bottom: none;
    --main_menu_sub_menu_shadow: 0 8px 8px -6px rgba(0,0,0,0.32);

    //Menu buttons
    --main_menu_button_width: 32px;
    --main_menu_button_height: 48px;
    --main_menu_button_padding: 12px 16px;

    //Animation
    --main_menu_sub_menu_anim: visibility 400ms linear, opacity 400ms linear;
}

.parentMobileLink {
    display: none !important;
}

/*
 * Secondary Navigation Menu
 */
.secondaryMenuNavigation {
    display: none;

    @media @flyout {
        display: block;
        clear: both;
        max-width: 100%;
    }
}


.flyoutButton  {
    position: relative;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    height: var(--main_menu_button_height);
    padding: var(--main_menu_button_padding);
    width: var(--main_menu_button_width);
    transition: all 200ms linear;

    &:hover {
        color: var(--primary_color);
    }

    @media @flyout {
        padding: 16px 0;
        height: 56px;
    }

    .innerButton {
        width: 100%;
        height: 100%;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    i {
        color: var(--text_color);
        transition: color 200ms linear;
		width: 25px;
		height: 16px;

		svg {
			width: 100%;
			height: 100%;
		}
    }

    i.openButton {
        display: inline-block;

        .flyoutActive & {
            display: none;
        }
    }

    i.closeButton {
        display: none;

        .flyoutActive & {
            display: inline-block;
        }
    }

}


/*
* Flyout
 */

.mainMenu {
	.rems(18);
	font-style: normal;
	line-height: 25.278px;

	.menuIcon {
		display: inline-block;
		position: relative;
		width: 8px;
		height: 8px;

		svg {
			width: 100%;
			height: auto;
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%)
		}
	}

	a:not(.button) {
		color: var(--flyout_link_color);
		font-style: normal;
		font-weight: 500;
		font-size: inherit;
		line-height: inherit;
		text-align: left;
		letter-spacing: initial;
		text-transform: none;
		display: block;

		&:hover, &:focus-visible, &:active {
			color: color-mix(in srgb, var(--highlight_color), var(--darken_mixin_color) 8%);
		}
	}

	@media @above_flyout {
		&.linksMenu {
			display: none;
		}

		.menuIcon {
			color: var(--menu_chevron_color) !important;
			margin-left: 7px;
		}

		& > .dropdownWrap > ul  {
			display: flex;
			width: ~"calc(100% + 43px)";
			margin: 0 -21.5px;

			& > li, & > mtc-menu {
				display: flex;
				align-items :center;
				padding: 0 21.5px;

				.secondaryMenuWrap & {
					position: relative;
					padding: 0 12.5px;
				}

				& > a {
					white-space: nowrap;
					display: flex;
					align-items: center;
					.rems(20);
					font-weight: 600;
					line-height: 25px;
					position: relative;

					.svgIcon {
						width: 8px;
						height: 8px;
						display: flex;
						align-items: center;
						justify-content: center;
						margin-left: 7px;

						svg {
							width: 100%;
							height: auto;
							max-width: 8px;
						}
					}
				}

				&.mobileOnly {
					display: none !important;

					@media @flyout {
						display: block !important;
					}
				}
			}
		}
	}

	@media @flyout {
		.rems(16);
		line-height: 1.1em;

		a {
			padding: 10px 0;

			&:not(.button) {
				color: var(--flyout_link_color_mobile);
			}

			.menuIcon {
				width: 0.5359em;
				height: 0.5359em;
				border-radius: 100%;
				background: var(--primary_color);
				color: #fff;
				position: relative;
				top: -0.1em;
				min-width: 12px;
				min-height: 12px;

				svg {
					width: 0.2em;
					height: 0.2em;
					min-width: 4.5px;
					min-height: 4.5px;
				}
			}

			&.isClickable.open {
				color: var(--highlight_color) !important;
			}
		}

		&.mainNavigationMenu {
			margin: 45px 0;
			.rems(28);
			line-height: 1em;

			& > .dropdownWrap {
				.dropdownWrap {
					.rems(16);
					line-height: 1.1em;
				}
			}
		}

		&.linksMenu {
			display: flex;
			margin: auto 0 45px;
		}
	}

	&.secondaryMenu {
		font-weight: 700;
		.rems(12);
		line-height: 12px;
	}
}

.flyoutWrap {
	@media @above_flyout {
        width: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;

        .flyoutHeader, .flyoutFooter {
            display: none;
        }

		.mobileMenu {
			display: none;

			&.mainNavigationMenu {
				display: block;
			}
		}

		.mobileTitle {
            display: none;
        }
    }

	@media @flyout {
        position: fixed;
		top: 0;
		left: -24px;
		bottom: 0;
		height: 100vh;
		width: 50vw;
		max-width: 360px;
		background: var(--flyout_background_mobile);
		backdrop-filter: blur(10px);
		filter: drop-shadow(4px 4px 16px rgba(0,0,0,0.24));
		border-radius: 0 35px 35px 0;
		transform: translateX(-100%);
        transition: transform 600ms, opacity var(--flyout_transition_time), visibility var(--flyout_transition_time);
        overflow: hidden;
        padding: 0;
        color: var(--flyout_text_color_mobile);
		z-index: 9999999;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		display: flex;
		flex-direction: column;

        .flyoutInitialised & {
			transition: transform 600ms, opacity var(--flyout_transition_time) ease-in-out, visibility var(--flyout_transition_time) ease-in-out;
		}

		.flyoutActive & {
			transform: translateX(0);
			opacity: 1;
			visibility: visible;
			pointer-events: auto;
		}

        .flyoutHeader {
			position: relative;
			z-index: 2;
            border-bottom: none;
            flex: 0 0 92px;
            height: auto;
			padding: 32px 56px 32px 24px;
			border-bottom: 1px solid color-mix(in srgb, var(--fade_mixin_color), var(--flyout_text_color_mobile) 4%);

            .flyoutHeaderTop {
				display: flex;

				& > h2 {
					.rems(24);
					line-height: 1.2em;
					color: var(--flyout_text_color_mobile);
					margin: 0;
					width: 100%;
					padding: 0;
					flex: 1 1 100%;
					padding-right: 24px;
				}

                .flyoutButton {
					border: none;
					background: transparent;
					color: var(--flyout_text_color_mobile);
					position: absolute;
					top: 50%;
					right: 10px;
					width: 48px;
					height: 48px;
					margin: 0;
					padding: 0;
					transition: color 200ms linear;
					cursor: pointer;
					transform: translateY(-50%);

					i {
						width: 24px;
						height: 24px;
						display: flex;
						align-items: center;
						justify-content: center;
						position: absolute;
						top: 50%;
						left: 50%;
						transform: translate(-50%,-50%);
						margin: 0;
						color: inherit;

						svg {
							width: 100%;
							height: 100%;
						}
					}

					&:hover, &:active, &:focus-visible {
						color: var(--highlight_color);
					}
                }
            }
        }

		.flyoutBody {
			flex: 1 1 100%;
			padding: 24px 24px 48px 24px;
			overflow-y: auto;
			position: relative;
			z-index: 2;
		}
    }

	@media @mobile {
		width: 100%;
		max-width: 400px;
		left: 0;
	}
}

.flyoutBackground {
	display: none;

	@media @flyout {
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;
		height: auto;
		z-index: 0;
		display: flex;
		align-items: flex-end;
		opacity: 0.2;

		svg {
			width: 100%;
			height: auto;
		}
	}
}

.menuIcon {
	display: none !important;
}
