.switch {
  display: inline-block;
  cursor: pointer;
  .border-radius(5px);
  border: 1px solid;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  position: relative;
  text-align: left;
  overflow: hidden;
  line-height: 8px;
  .user-select(none);
  vertical-align: middle;
  min-width: 100px;
  .transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");

  &.switch-mini {
    min-width: 72px;

    > div > span,
    > div > label {
      padding-bottom: 4px;
      padding-top: 4px;
      font-size: 10px;
      line-height: 9px;
    }

    .switch-mini-icons {
      height: 1.20em;
      line-height: 9px;
      vertical-align: text-top;
      text-align: center;
      transform: scale(0.6);
      margin-top: -1px;
      margin-bottom: -1px;
    }
  }

  &.switch-small {
    min-width: 80px;

    > div > span,
    > div > label {
      padding-bottom: 3px;
      padding-top: 3px;
      font-size: 12px;
      line-height: 18px;
    }
  }

  &.switch-large {
    min-width: 120px;

    > div > span,
    > div > label {
      padding-bottom: 9px;
      padding-top: 9px;
      font-size: 16px;
      line-height: normal;
    }
  }

  &.switch-animate {

    > div {
      .transition(margin-left 0.5s);
    }
  }

  &.switch-on {

    > div {
      margin-left: 0%;

      > label {
        .border-right-radius(4px);
      }
    }
  }

  &.switch-off {

    > div {
      margin-left: -50%;

      > label {
        .border-left-radius(4px);
      }
    }
  }

  &.switch-disabled,
  &.switch-readonly {
    .opacity(50);
    cursor: default !important;

    > div > span,
    > div > label {
      cursor: default !important;
    }
  }

  &.switch-focused {
    border-color: rgba(82, 168, 236, .8);
    outline: 0;
    outline: thin dotted \9;
    .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)");
  }

  > div {
    display: inline-block;
    width: 150%;
    top: 0;
    .border-radius(4px);
    .translate3d(0, 0, 0);

    > span,
    > label {
      .box-sizing(border-box);
      cursor: pointer;
      display: inline-block !important;
      height: 100%;
      padding-bottom: 4px;
      padding-top: 4px;
      font-size: 14px;
      line-height: 20px;
    }

    > span {
      text-align: center;
      z-index: 1;
      width: 33.333333333%;

      &.switch-handle-on {
        .border-left-radius(4px);
      }

      &.switch-handle-off {
        .border-right-radius(4px);
      }

      &.switch-primary {
        .buttonBackground(@btnPrimaryBackgroundHighlight, @btnPrimaryBackground);
      }

      &.switch-info {
        .buttonBackground(@btnInfoBackgroundHighlight, @btnInfoBackground);
      }

      &.switch-success {
        .buttonBackground(@btnSuccessBackgroundHighlight, @btnSuccessBackground);
      }

      &.switch-warning {
        .buttonBackground(@btnWarningBackgroundHighlight, @btnWarningBackground);
      }

      &.switch-danger {
        .buttonBackground(@btnDangerBackgroundHighlight, @btnDangerBackground);
      }

      &.switch-default {
        .buttonBackground(@btnBackgroundHighlight, @btnBackground, @grayDark, 0 1px 1px rgba(255,255,255,.75));
      }
    }

    > label {
      text-align: center;
      margin-top: -1px;
      margin-bottom: -1px;
      z-index: 100;
      width: 33.333333333%;
      border-left: 1px solid @btnBorder;
      border-right: 1px solid @btnBorder;
      .buttonBackground(@btnBackground, @btnBackgroundHighlight, @grayDark);
    }
  }

  input[type='radio'],
  input[type='checkbox'] {
    position: absolute !important;
    top: 0;
    left: 0;
    z-index: -1;
  }
}

