@import '../../style/mixins';
@import '../../style/themes/default';

@radioPrefixCls: fm-radio;
@listPrefixCls: fm-list;

.@{radioPrefixCls}-group {
  line-height: unset;
  display: flex;
  flex-direction: column;
}

.@{radioPrefixCls} {
  display: inline-block;
  position: relative;
  vertical-align: middle;
  width: @icon-size-xxs;
  height: @icon-size-xxs;

  &-focused {
    .@{radioPrefixCls}-inner {
      border-color: @brand-primary;
    }
  }

  &-inner {
    position: absolute;
    right: 0;
    width: @icon-size-xxs;
    height: @icon-size-xxs;
    box-sizing: border-box;
    transform: rotate(0deg);

    &::after {
      position: absolute;
      display: none;
      top: -2 * @hd;
      right: 7 * @hd;
      z-index: 999;
      width: 7 * @hd;
      height: 14 * @hd;
      border-style: solid;
      border-width: 0 1.5 * @hd 1.5 * @hd 0;
      content: '\0020';
      transform: rotate(45deg);
    }
  }

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

// 选中状态
.@{radioPrefixCls}-checked {
  .@{radioPrefixCls}-inner:after {
    display: block;
    border-color: @brand-primary;
  }
}

.@{radioPrefixCls}-disabled {
  .@{radioPrefixCls}-inner:after {
    border-color: fade(@black, 20%);
  }
}

.@{listPrefixCls} {
  & &-item {
    &.@{radioPrefixCls}-item {
      .@{listPrefixCls}-content {
        width: @icon-size-sm;
        height: @icon-size-sm;

        .@{radioPrefixCls} {
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          width: 100%;
          height: @list-item-height;

          &-inner {
            position: absolute;
            display: inline-block;
            right: @h-spacing-lg;
            top: 12 * @hd;
          }
        }
      }

      &.@{radioPrefixCls}-item-disabled {
        .@{listPrefixCls}-label {
          color: @color-text-disabled;
        }
      }
    }
  }
}

