@import '../../style/variables';

.#{$prefix}radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: $font-size;
  font-family: $font-family;
  margin-right: 8px;
  color: rgba(0, 0, 0, 0.75);

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

  &__inner {
    box-sizing: border-box;
    display: flex;
    width: 16px;
    height: 16px;
    border-radius: 100%;
    background-color: #fff;
    border: 1px solid $primary-color;
    align-items: center;
    justify-content: center;

    &:after {
      box-sizing: border-box;
      display: inline-block;
      content: '';
      width: 10px;
      height: 10px;
      border-radius: 100%;
      background-color: $primary-color;
      transition: all 200ms;
      transform: scale(0);
    }

    & + span {
      padding: 0 5px;
      line-height: 16px;
    }
  }

  &_checked {
    .#{$prefix}radio {
      &__inner:after {
        transform: scale(1);
      }
    }
  }

  &_disabled {
    .#{$prefix}radio {
      &__native {
        cursor: not-allowed;
      }

      &__inner {
        border-color: #d9d9d9;

        &:after {
          background-color: rgba(0, 0, 0, 0.2);
        }

        & + span {
          color: rgba(0, 0, 0, 0.25);
        }
      }
    }
  }

  &-group {
    display: inline-block;
  }
}
