@import "./variables";

.#{$component-prefix}checkbox {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  font-size: $checkbox-font-size;
  cursor: pointer;
  user-select: none;

  &--disabled {
    cursor: not-allowed;
  }

  &--horizontal {
    margin-right: $checkbox-gap;

    &:last-child {
      margin-right: 0;
    }
  }

  &--vertical {
    margin-bottom: $checkbox-gap;

    &:last-child {
      margin-bottom: 0;
    }
  }

  &__icon {
    flex: none;
    height: 1em;
    font-size: $checkbox-icon-font-size;
    line-height: 1em;
    cursor: pointer;

    .#{$component-prefix}icon {
      box-sizing: border-box;
      display: block;
      width: 1.25em;
      height: 1.25em;
      font-size: 0.8em;
      line-height: 1.25;
      color: transparent;
      text-align: center;
      border: 1px solid $checkbox-border-color;
      transition-duration: $checkbox-transition-duration;
      transition-property: color, border-color, background-color;
    }

    &--round {
      .#{$component-prefix}icon {
        border-radius: 100%;
      }
    }

    &--checked {
      .#{$component-prefix}icon {
        color: $checkbox-checked-icon-color;
        background: $checkbox-checked-icon-border-color;
        border-color: $checkbox-checked-icon-border-color;
      }

      &.#{$component-prefix}checkbox__icon--disabled {
        .#{$component-prefix}icon {
          color: $checkbox-disabled-icon-color;
        }
      }
    }

    &--disabled {
      cursor: not-allowed;

      .#{$component-prefix}icon {
        background-color: $checkbox-disabled-icon-background-color;
        border-color: $checkbox-disabled-icon-border-color;
      }
    }
  }

  &__label {
    line-height: $checkbox-label-line-height;
    margin-left: $checkbox-label-margin;
    color: $checkbox-label-color;

    &--left {
      margin: 0 $checkbox-label-margin 0 0;
    }

    &--disabled {
      color: $checkbox-disabled-label-color;
    }
  }
}
