@charset "UTF-8";
@import "./common/var.css";
@import './mixins/button';

@component-namespace el {
  @b radio {
    color: var(--radio-color);
    position: relative;
    cursor: pointer;
    display: inline-block;
    white-space: nowrap;
    @utils-user-select none;

    & + .el-radio {
      margin-left: 15px;
    }

    @e input {
      white-space: nowrap;
      cursor: pointer;
      outline: none;
      display: inline-block;
      line-height: 1;
      position: relative;
      vertical-align: middle;

      @when disabled {
        .el-radio__inner {
          background-color: var(--radio-disabled-input-fill);
          border-color: var(--radio-disabled-input-border-color);
          cursor: not-allowed;

          &::after {
            cursor: not-allowed;
            background-color: var(--radio-disabled-icon-color);
          }

          & + .el-radio__label {
            cursor: not-allowed;
          }
        }
        &.is-checked {
          .el-radio__inner {
            background-color: var(--radio-disabled-checked-input-fill);
            border-color: var(--radio-disabled-checked-input-border-color);

            &::after {
              background-color: var(--radio-disabled-checked-icon-color);
            }
          }
        }
        & + .el-radio__label {
          color: var(--disabled-color-base);
          cursor: not-allowed;
        }
      }

      @when checked {
        .el-radio__inner {
          border-color: var(--radio-checked-input-border-color);
          background: var(--radio-checked-icon-color);

          &::after {
            transform: translate(-50%, -50%) scale(1);
          }
        }
      }

      @when focus {
        .el-radio__inner {
          border-color: var(--radio-input-border-color-hover);
        }
      }
    }
    @e inner {
      border: var(--radio-input-border);
      border-radius: var(--radio-input-border-radius);
      circle: var(--radio-input-width) var(--radio-input-fill);
      position: relative;
      cursor: pointer;
      display: inline-block;
      box-sizing: border-box;

      &:hover {
        border-color: var(--radio-input-border-color-hover);
      }

      &::after {
        circle: 6px var(--color-white);
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) scale(0);
        transition: transform .15s cubic-bezier(.71,-.46,.88,.6);
      }
    }

    @e original {
      opacity: 0;
      outline: none;
      position: absolute;
      z-index: -1;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      margin: 0;
    }

    @e label {
      font-size: var(--radio-font-size);
      padding-left: 5px;
    }
  }
}
