@import '../../style/vars';

$radio-size: 20px;
$radio-touch-size: 48px;

.usj-radio {
  width: auto;
  margin: 16px 8px 16px 0;
  display: inline-flex;
  position: relative;

  &:not(.usj-disabled) {
    cursor: pointer;

    .usj-radio-label {
      cursor: pointer;
    }
  }

  .usj-radio-container {
    width: $radio-size;
    height: $radio-size;
    position: relative;
    border-radius: 50%;
    border: 2px solid rgba(#000, 0.54);
    transition: $swift-ease-out;

    &:before {
      width: $radio-touch-size;
      height: $radio-touch-size;
      position: absolute;
      top: 50%;
      left: 50%;
      border-radius: 50%;
      transform: translate(-50%, -50%);
      transition: $swift-ease-in;
      content: ' ';
    }

    &:after {
      background: $usj-theme-orange;
      position: absolute;
      top: 3px;
      right: 3px;
      bottom: 3px;
      left: 3px;
      border-radius: 50%;
      opacity: 0;
      transform: scale3D(0.38, 0.38, 1);
      transition: $swift-ease-in;
      content: ' ';
    }

    input {
      position: absolute;
      left: -999em;
    }
  }

  .usj-radio-label {
    height: $radio-size;
    padding-left: 8px;
    line-height: $radio-size;
  }
}

.usj-radio.usj-checked {
  .usj-radio-container {
    border-color: $usj-theme-orange;

    &:after {
      opacity: 1;
      transform: scale3D(1, 1, 1);
      transition: $swift-ease-out;
    }
  }
}
