.ct-sidebar {
	position: relative;
	z-index: 1;
	color: var(--widgetsFontColor);

	@include media-breakpoint-down (md) {
		margin-top: 60px;
	}

	.widget-title {
		color: var(--widgetsTitleColor);

		&:not(:empty) {
			margin: 0 0 20px 0;
		}
	}

	a {
		color: var(--linkInitialColor);

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

	// widgets spacing
	.ct-widget {
		&:not(:last-child) {
			margin-bottom: var(--sidebarWidgetsSpacing);
		}
	}

	// sticky sidebar
	&[data-sticky] {
		@include media-breakpoint-up (lg) {
			position: sticky;
			top: var(--sidebarOffset);
		}
	}
}

aside {

	// type 2
	&[data-type="type-2"] .ct-sidebar {
		&:not([data-widgets="separated"]) {
			padding: var(--sidebarInnerSpacing);
			background: var(--sidebarBackgroundColor);
			border: var(--sidebarBorderSize) solid var(--sidebarBorderColor);
			box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.01);
		}

		&[data-widgets="separated"] {
			.ct-widget {
				padding: var(--sidebarInnerSpacing);
				background: var(--sidebarBackgroundColor);
				border: var(--sidebarBorderSize) solid var(--sidebarBorderColor);
				box-shadow: 0px 12px 18px -6px rgba(34, 56, 101, 0.02);
			}
		}
	}

	// type 3
	&[data-type="type-3"] {
		@include media-breakpoint-up (lg) {
			position: relative;

			&:after {
				position: absolute;
				content: '';
				top: 0;
				width: var(--sidebarDividerSize);
				height: 100%;
				background: var(--sidebarDividerColor);
			}
		}
	}

	// type 4
	&[data-type="type-4"] {
		@include media-breakpoint-down (md) {
			.ct-sidebar {
				padding: var(--sidebarInnerSpacing);
				background: var(--sidebarBackgroundColor);
			}
		}

		@include media-breakpoint-up (lg) {
			position: relative;

			&:after {
				position: absolute;
				content: '';
				top: 0;
				height: 100%;
				background: var(--sidebarBackgroundColor);
			}
		}
	}
}


// type 3 helper
@include media-breakpoint-up (lg) {
	[data-sidebar="right"] {
		[data-type="type-3"],
		[data-type="type-4"] {
			padding-left: var(--sidebarInnerSpacing);

			&:after {
				left: 0;
			}
		}

		[data-type="type-4"] {
			&:after {
				right: calc(-50vw + (5000% / var(--sidebarWidthNoUnit)));
			}
		}
	}

	[data-sidebar="left"] {
		[data-type="type-3"],
		[data-type="type-4"] {
			padding-right: var(--sidebarInnerSpacing);

			&:after {
				right: 0;
			}
		}

		[data-type="type-4"] {
			&:after {
				left: calc(-50vw + (5000% / var(--sidebarWidthNoUnit)));
			}
		}
	}
}


body {
	&.main-content-area-boundless {
		[data-sidebar] > aside {
			@include media-breakpoint-up (lg) {
				padding-top: var(--contentAreaSpacing);
				padding-bottom: var(--contentAreaSpacing);
			}
		}
	}

	&:not(.main-content-area-boundless) {
		aside[data-type="type-3"],
		aside[data-type="type-4"] {
			@include media-breakpoint-up (lg) {
				&:after {
					top: calc( var(--contentAreaSpacing) * -1 );
					height: calc( 100% + var(--contentAreaSpacing) * 2);
				}
			}
		}
	}
}