$namespace: re-checkbox;

.#{$namespace} {
  display: inline-block;
  position: relative;
  font-size: 0;
  cursor: pointer;

  &-input {
    position: absolute;
    opacity: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
  }

  &-inner {
    display: inline-block;
    position: relative;
    width: .16rem;
    height: .16rem;
    transition: all .3s;
    border: .02rem solid #B0B0B0;
    border-radius: .02rem;
    background-color: #fff;
  }

  &-icon {
    visibility: hidden;
    position: absolute;
    width: .06rem;
    height: .1rem;
    left: 20%;
    top: 40%;
    transform: rotate(45deg) scale(0) translate(-50%, -50%);
    transition: all .2s;
    border: .02rem solid #E84040;
    border-top: none;
    border-left: none;
  }

  &.#{$namespace}-checked {
    .#{$namespace} {
      &-icon {
        visibility: visible;
        transform: rotate(45deg) scale(1) translate(-50%, -50%);
      }
    }
  }

  &.#{$namespace}-disabled {
    cursor: not-allowed;
    color: rgba(0, 0, 0, .25);

    .#{$namespace} {
      &-inner {
        border-color: #f0f0f0 !important;
        background-color: #f5f5f5 !important;
      }

      &-icon {
        border-color: #cecece;
      }

      &-content {
        text-decoration: none !important;
      }
    }
  }

  &-wrap {
    display: inline-block;
    position: relative;
    cursor: pointer;

    .#{$namespace} {
      position: absolute;
      transform: translateY(-50%);
      top: 50%;
      left: 0;
    }

    &:hover {
      .#{$namespace}-content {
        text-decoration: underline;
      }
    }
  }

  &-content {
    padding-left: .24rem;
    display: inline-block;
  }

  &-wrap.#{$namespace}-reverse {
    .#{$namespace} {
      left: auto;
      right: 0;

      &-content {
        padding-left: 0;
        padding-right: .24rem;
      }
    }
  }

  &-wrap.#{$namespace}-disabled {
    cursor: not-allowed;
    color: rgba(0, 0, 0, .25);

    .#{$namespace}-content {
      text-decoration: none !important;
    }
  }
}