@import '../../style/index.scss';

$radio: 'cp-ui-radio';

.#{$radio} {
  font-size: $font-size-normal;
  font-variant: tabular-nums;
  line-height: $line-height-normal;
  color: rgba(0, 0, 0, 0.65);
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  list-style: none;
  cursor: pointer;
  display: inline-block;



  &-select {
    font-size: $font-size-normal;
    font-variant: tabular-nums;
    color: rgba(0, 0, 0, 0.65);
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
    cursor: pointer;
    outline: none;
    display: inline-block;
    line-height: 1;
    position: relative;
    vertical-align: bottom;
    top: -0.09em;

    input {
      position: absolute;
      left: 0;
      z-index: 1;
      cursor: pointer;
      opacity: 0;
      top: 0;
      bottom: 0;
      right: 0;
      width: 100%;
      height: 100%;
    }
  }

  &-label {
    padding: 0 8px;
  }

  &-checked {

    .#{$radio}-select {
      &::after {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 2px;
        border: 1px solid $color-brand-normal;
        content: '';
        -webkit-animation: antCheckboxEffect 0.36s ease-in-out;
        animation: antCheckboxEffect 0.36s ease-in-out;
        -webkit-animation-fill-mode: both;
        animation-fill-mode: both;
        visibility: hidden;
      }
    }
  }

  &-disabled {
    cursor: not-allowed;

    .#{$radio}-select {
      cursor: not-allowed;
    }

  }

  input[type='radio'][disabled] {
    cursor: not-allowed;
  }
}