@include export-module('checkbox-theme') {

  /*! checkbox theme */
  .e-checkbox-wrapper,
  .e-css.e-checkbox-wrapper {
    /* stylelint-disable property-no-vendor-prefix */
    -webkit-tap-highlight-color: transparent;
    @at-root {
      & .e-frame {
        background-color: $cbox-bgcolor;
        border-color: $cbox-border-color;

        &.e-check {
          background-color: $cbox-checkmark-bgcolor;
          border-color: $cbox-checkmark-border-color;
          color: $cbox-checkmark-color;
        }

        &.e-stop {
          background-color: $cbox-indeterminate-bgcolor;
          border-color: $cbox-indeterminate-border-color;
          color: $cbox-indeterminate-color;
        }
      }

      & .e-ripple-element {
        background: $cbox-checked-ripple-bgcolo;
      }

      & .e-ripple-check {
        & .e-ripple-element {
          background: $cbox-ripple-bgcolor;
        }
      }

      &:active {
        & .e-ripple-element {
          background: $cbox-ripple-bgcolor;
        }

        & .e-ripple-check {
          & .e-ripple-element {
            background: $cbox-checked-ripple-bgcolo;
          }
        }
      }

      & .e-label {
        color: $cbox-color;
      }

      & .e-checkbox {
        &:focus {
          +.e-frame {
            background-color: $cbox-focussed-bgcolor;
            border-color: $cbox-focussed-border-color;
            box-shadow: $cbox-focussed-box-shadow;

            &.e-check {
              background-color: $cbox-focussed-checkmark-bgcolor;
              border-color: $cbox-focussed-checkmark-border-color;
              box-shadow: $cbox-focussed-box-shadow;
              color: $cbox-focussed-checkmark-color;
            }

            &.e-stop {
              box-shadow: $cbox-focussed-box-shadow;
              color: $cbox-indeterminate-hover-color;
            }
          }
        }
      }

      & .e-checkbox {
        &:active {
          +.e-frame {
            background-color: $cbox-focussed-bgcolor;
            border-color: $cbox-focussed-border-color;
            box-shadow: $cbox-focussed-box-shadow;

            &.e-check {
              background-color: $cbox-focussed-checkmark-bgcolor;
              border-color: $cbox-focussed-checkmark-border-color;
              box-shadow: $cbox-focussed-box-shadow;
              color: $cbox-focussed-checkmark-color;
            }

            &.e-stop {
              box-shadow: $cbox-focussed-box-shadow;
              color: $cbox-indeterminate-hover-color;
            }
          }
        }
      }

      &:hover {
        & .e-frame {
          background-color: $cbox-hover-bgcolor;
          border-color: $cbox-hover-border-color;
          @if $skin-name == 'FluentUI' {
            font-size: $cbox-check-fontsize;

            &:not(.e-check):not(.e-stop) {
              color: $cbox-icon-color;
              @media (max-width: 768px)  {
                color: $cbox-bgcolor;
              }
            }

            &:not(.e-check),
            &:not(.e-stop)::before {
              content: $cbox-check-content;
            }
          }

          &.e-check {
            background-color: $cbox-checkmark-hover-bgcolor;
            border-color: $cbox-checkmark-hover-border-color;
            color: $cbox-checkmark-hover-color;
          }

          &.e-stop {
            @if $skin-name == 'bootstrap4' or $skin-name == 'tailwind' or $skin-name == 'bootstrap5' {
              background-color: $cbox-checkmark-hover-bgcolor;
              border-color: $cbox-checkmark-hover-border-color;
            }
            @else if $skin-name == 'FluentUI' {
              border-color: $cbox-checkmark-hover-border-color;
            }
            @else {
              color: $cbox-indeterminate-hover-color;
            }
          }
        }

        & .e-label {
          color: $cbox-hover-color;
        }
      }

      &.e-checkbox-disabled {
        & .e-frame {
          background-color: $cbox-disabled-bgcolor;
          border-color: $cbox-disabled-border-color;
          color: $cbox-disabled-color;

          &.e-check {
            background-color: $cbox-checkmark-disabled-bgcolor;
            @if $skin-name == 'bootstrap4' {
              border-color: transparent;
            }
            @else {
              border-color: $cbox-checkmark-disabled-border-color;
            }
            color: $cbox-checkmark-disabled-color;
          }

          &.e-stop {
            background-color: $cbox-indeterminate-disabled-bgcolor;
            @if $skin-name == 'bootstrap4' {
              border-color: transparent;
            }
            @else {
              border-color: $cbox-indeterminate-disabled-border-color;
            }
            color: $cbox-indeterminate-disabled-color;
          }
        }

        & .e-label {
          color: $cbox-disabled-color;
        }
      }

      &.e-focus {
        & .e-ripple-container {
          background-color: $cbox-key-focussed-bgcolor;

          &.e-ripple-check {
            background-color: $cbox-checked-ripple-bgcolo;
          }
        }

        & .e-frame {
          outline: $cbox-focus-outline;
          outline-offset: $cbox-focus-outline-offset;

          &.e-check {
            outline: $cbox-focus-outline;
            outline-offset: $cbox-focus-outline-offset;
          }
        }
      }

      .e-bigger .e-checkbox-wrapper,
      .e-bigger.e-checkbox-wrapper,
      .e-bigger .e-css.e-checkbox-wrapper,
      .e-bigger.e-css.e-checkbox-wrapper {
        &:hover {
          & .e-frame {
            @if $skin-name == 'FluentUI' {
              font-size: $cbox-bigger-check-fontsize;

              &:not(.e-check):not(.e-stop) {
                color: $cbox-icon-color;
              }
            }
          }
        }
      }

      .e-small .e-checkbox-wrapper,
      .e-small.e-checkbox-wrapper,
      .e-small .e-css.e-checkbox-wrapper,
      .e-small.e-css.e-checkbox-wrapper {
        &:hover {
          & .e-frame {
            @if $skin-name == 'FluentUI' {
              font-size: $cbox-small-check-fontsize;

              &:not(.e-check):not(.e-stop) {
                color: $cbox-icon-color;
              }
            }
          }
        }
      }

      .e-bigger.e-small .e-checkbox-wrapper,
      .e-bigger.e-small.e-checkbox-wrapper,
      .e-bigger.e-small .e-css.e-checkbox-wrapper,
      .e-bigger.e-small.e-css.e-checkbox-wrapper {
        &:hover {
          & .e-frame {
            @if $skin-name == 'FluentUI' {
              font-size: $cbox-bigger-small-check-fontsize;

              &:not(.e-check):not(.e-stop) {
                color: $cbox-icon-color;
              }
            }
          }
        }
      }
    }
  }
}
