@use '@lucca-front/scss/src/commons/config';
@use '@lucca-front/scss/src/commons/utils/media';
@use 'exports' as *;

.table {
	@layer components {
		@include vars;
	}

	@layer mods {
		&.mod-stickyColumn {
			@include stickyColumn;
		}

		@each $breakpoint, $value in config.$breakpoints {
			@include media.min($breakpoint) {
				&.mod-stickyColumn\@mediaMin#{$breakpoint} {
					@include stickyColumn;
				}
			}
		}

		&.mod-stickyColumn-shadow {
			@include shadow;
		}

		&[class*='mod-stickyColumn'] {
			.table-head-row-cell,
			.table-body-row-cell,
			.table-foot-row-cell {
				@for $i from 0 through 50 {
					&.mod-stickyColumn-leftOffset#{$i} {
						@include leftOffset($i);
					}

					&.mod-stickyColumn-rightOffset#{$i} {
						@include rightOffset($i);
					}
				}
			}
		}

		[class*='sticky'][class*='shadow-wrapper'] {
			@include wrapper;
		}

		&[class*='mod-stickyHeader'] {
			@include stickyHeaderCommon;

			@each $breakpoint, $value in config.$breakpoints {
				@include media.max($breakpoint) {
					&.mod-stickyColumn\@mediaMin#{$breakpoint} {
						@include stickyColumnBreakpoint;
					}
				}
			}
		}

		&.mod-stickyHeader {
			@include stickyHeader;
		}

		&.mod-stickyHeader-withBanner {
			@include stickyHeaderBanner;
		}
	}
}

.table-body-row,
.table-foot-row {
	@layer mods {
		&.mod-stickyHeader-shadow {
			@include stickyHeaderShadow;
		}
	}
}
