@use "../tokens/variables";

/* Widgets - Table - Bulk Actions */
////
/// @group Widgets-Table-Bulk_Actions
/// Widgets - Table - Bulk Actions

///
.table {
	// Add this selector to fix the horizontal align of checkbox enclosed on a container
	div span [data-checkbox] {
		display: inline-block;
		vertical-align: middle;
	}

	[data-checkbox] {
		--osui-checkbox-size: #{variables.$token-scale-400};

		display: block;

		&:checked:after {
			// physical sides: these borders draw the check glyph under the platform's
			// physical rotate transform — a checkmark must not mirror in RTL
			border: variables.$token-border-size-050 solid var(--color-text-inverse);
			border-top: variables.$token-border-size-0 !important;
			border-right: variables.$token-border-size-0 !important;
			display: block;
			height: variables.$token-scale-050;
			left: variables.$token-scale-100; // physical: positions the rotated glyph
			top: 5px;
			width: 7px;
		}
	}

	.checkbox-intermediate {
		&:before {
			background-color: var(--color-primary);
			border: variables.$token-border-size-025 solid var(--color-primary);
		}

		&:after {
			background-color: var(--color-text-inverse);
			content: '';
			height: 2px;
			left: 50%;
			position: absolute;
			top: 50%;
			transform: translateY(-50%) translateX(-50%);
			width: variables.$token-scale-200;

			// Service Studio Preview
			& {
				-servicestudio-border-width: 1px !important;
				-servicestudio-left: 8px !important;
				-servicestudio-top: 7px !important;
			}
		}
	}
}
