nav > ul > [class*='ct-mega-menu'] > .sub-menu {
	display: grid;
	grid-template-columns: var(--grid-template-columns, 1fr);
	width: var(--mega-menu-width, var(--theme-container-width-base));
	max-width: var(--mega-menu-max-width, var(--theme-normal-container-max-width));
}

nav > ul > [class*='ct-mega-menu'] > .sub-menu {
	.menu-item {
		flex-direction: column;
		align-items: initial;
	}

	> li {
		min-width: 0;
		padding: var(--columns-padding, 20px 30px);

		[class*='children']:not(:first-child) {
			padding-top: 20px;
		}
	}
}

nav > ul > .ct-mega-menu-content-width,
nav > ul > .ct-mega-menu-custom-width {
	> .sub-menu > li {
		overflow: hidden;

		&:first-child {
			border-top-left-radius: inherit;
			border-bottom-left-radius: inherit;
		}

		&:last-child {
			border-top-right-radius: inherit;
			border-bottom-right-radius: inherit;
		}
	}
}

// position & width
nav > ul > .ct-mega-menu-content-width,
nav > ul > .ct-mega-menu-full-width {
	> .sub-menu {
		inset-inline: 0;
		margin-inline: auto;
	}
}

// full width
nav > ul > .ct-mega-menu-full-width {
	> .sub-menu {
		box-shadow: none;
		background-color: transparent;

		&:after {
			position: absolute;
			content: '';
			z-index: 0;
			width: 100vw;
			inset-block: 0;
			inset-inline-start: 50%;
			inset-inline-end: 0;
			margin-inline-start: -50vw;
			box-shadow: var(--theme-box-shadow);
			background-color: var(--dropdown-background-color, var(--theme-palette-color-4));
		}

		li {
			z-index: 2;
		}

		> li {
			&:first-child {
				padding-inline-start: 0;
			}

			&:last-child {
				padding-inline-end: 0;
			}
		}
	}
}

nav > ul > .ct-mega-menu-content-full {
	--mega-menu-width: calc(100vw - 60px);
	--mega-menu-max-width: 100%;
}

// custom width + centered dropdown
nav > ul > .ct-mega-menu-centered:not([data-submenu]) {
	justify-content: center;
}
