@import "mixins/mixins";
@import "mixins/_button";
@import "common/var";

@include b(radio-button) {
  position: relative;
  display: inline-block;
  outline: none;
  background-color: $--radio-default-bg;
  @include e(inner) {
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    background: $--button-default-fill;
    border: $--radio-botton-border-base;  // PreValue: $--border-base
    font-weight: $--button-font-weight;
    border-left: 0;
    color: $--color-text-secondary;       // PreValue: $--button-default-color
    -webkit-appearance: none;
    text-align: center;
    box-sizing: border-box;
    outline: none;
    margin: 0;
    position: relative;
    cursor: pointer;
    transition: $--all-transition;

    @include button-size($--radio-botton-padding-vertical, $--radio-botton-padding-horizontal, $--button-font-size, 0);  // PreValue:$--button-padding-vertical $--button-padding-horizontal

    &:hover {
      border-color: $--radio-default-theme-color;
      color: $--radio-default-theme-hover-color;
      box-shadow: -1px 0 0 0 $--radio-default-theme-color;
    }

    & [class*="el-icon-"] {
      line-height: 0.9;

      & + span {
        margin-left: 5px;
      }
    }
  }

  &:first-child {
    .el-radio-button__inner {
      border-left: $--radio-botton-border-base;    // PreValue: $--border-base
      border-radius: $--border-radius-base 0 0 $--border-radius-base;
      box-shadow: none !important;
      &:hover{
        border-left-color: $--radio-default-theme-color;
      }
    }
  }

  @include e(orig-radio) {
    opacity: 0;
    outline: none;
    position: absolute;
    z-index: -1;

    &:checked {
      & + .el-radio-button__inner {
        color: $--radio-default-theme-color;                     // PreValue: $--radio-default-fill
        background-color: $--radio-default-theme-color-light;    // PreValue: $--radio-default-theme-color
        border-color: $--radio-default-theme-color;
        box-shadow: -1px 0 0 0 $--radio-default-theme-color;
      }
    }

    &:disabled {
      & + .el-radio-button__inner {
        color: $--button-default-disabled-color;
        cursor: not-allowed;
        background-image: none;
        background-color: $--button-disabled-bg-color;
        border-color: $--border-color-gray-light;     // PreValue: $--button-default-disabled-color
        box-shadow: none;
      }
      &:checked + .el-radio-button__inner {
        background-color: $--radio-disabled-fill;
      }
    }
  }

  &:last-child {
    .el-radio-button__inner {
      border-radius: 0 $--border-radius-base $--border-radius-base 0;
    }
  }

  &:first-child:last-child {
    .el-radio-button__inner {
      border-radius: $--border-radius-base;
    }
  }

  @include m(small) {
    & .el-radio-button__inner {
      @include button-size($--radio-botton-small-padding-vertical, $--radio-botton-small-padding-horizontal, $--button-small-font-size, 0);  // Prevalue: $--button-small-padding-horizontal
    }
  }
}
