@import '../../core/stylesheets/variables.scss';

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

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

  .md-radio-container {
    width: $radio-size;
    height: $radio-size;
    position: relative;
    border-radius: 50%;
    border: 2px solid rgba(#000, .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 {
      position: absolute;
      top: 3px;
      right: 3px;
      bottom: 3px;
      left: 3px;
      border-radius: 50%;
      opacity: 0;
      transform: scale3D(.38, .38, 1);
      transition: $swift-ease-in;
      content: " ";
    }

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

    .md-ink-ripple {
      top: -16px;
      right: -16px;
      bottom: -16px;
      left: -16px;
      border-radius: 50%;
      color: rgba(#000, .54);

      .md-ripple {
        width: $radio-touch-size !important;
        height: $radio-touch-size !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
      }
    }
  }

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

.md-radio.md-checked {
  .md-radio-container {
    &:after {
      opacity: 1;
      transform: scale3D(1, 1, 1);
      transition: $swift-ease-out;
    }
  }
}
