.c-switch {
  $self: #{&};
  $label: #{$self}__label;
  $content: #{$self}__content;
  $toggle: #{$self}__toggle;

  $padding: 3px 0;
  $track-width: 34px;
  $track-height: 14px;
  $knob-size: 20px;

  @at-root {
    #{$self} {
      display: inline-block;
      position: relative;
      line-height: 1;
      @include no-select();

      &:hover,
      &:focus {
        #{$toggle} {
          &:before {
            box-shadow: 0 3px 1px -2px rgba(#000, 0.2),
            0 2px 2px 0 rgba(#000, 0.14),
            0 1px 5px 0 rgba(#000, 0.12),
            0 0 0 10px rgba(#000, 0.05);
          }
        }
      }

      &:active {
        #{$toggle} {
          &:before {
            box-shadow: 0 3px 1px -2px rgba(#000, 0.2),
            0 2px 2px 0 rgba(#000, 0.14),
            0 1px 5px 0 rgba(#000, 0.12),
            0 0 0 2px rgba($color-enabled, 0.1);
          }
        }
      }

      input[type="checkbox"],
      input[type="radio"] {
        display: none;
        opacity: 0;
      }

    }

    #{$label} {
      display: inline-flex;
      flex-flow: row nowrap;
      justify-content: flex-start;
      align-items: flex-start;
      padding: $padding;
      cursor: pointer;
      margin: 0;
      font-weight: 400;
      font-style: normal;
      line-height: 1;
    }

    #{$toggle} {
      display: inline-block;
      position: relative;
      z-index: 2;
      top: 3px;
      left: 0;
      width: $track-width;
      height: $track-height;
      border-radius: $track-height / 2;
      outline: none;
      background-color: $color-disabled;
      cursor: pointer;
      transition: background-color 90ms ease;

      // Knob
      &:before {
        content: '';
        display: block;
        position: absolute;
        z-index: 3;
        top: -3px;
        left: 0;
        width: $knob-size;
        height: $knob-size;
        transform: translateX(0px);
        border-radius: $knob-size / 2;
        border: 2px solid $color-disabled;
        background-color: #fff;
        transition: transform 0.1s nth($g-transition, 2),
        background-color 0.1s nth($g-transition, 2),
        box-shadow 0.1s nth($g-transition, 2);
      }
    }

    #{$content} {
      display: block;
      margin-top: 1px;
      margin-left: 10px;
    }

    // Active state
    #{$self}.is-active {
      #{$toggle} {
        background-color: $color-enabled;

        &:before {
          transform: translateX($track-width - $knob-size);
          border-color: $color-enabled;
        }
      }
    }

  }

}
