/**Variable**/

.vhb-switch {
  display: inline-block;
  color: $vhb-font-color;
  vertical-align: middle;
  padding: 0.4em;
  user-select: none;
  text-align: center;
  &.is--animat {
    .vhb-switch--button {
      transition: border-color .3s, background-color .3s;
    }
    .vhb-switch--icon {
      transition: all 0.3s;
    }
  }
  &.is--on {
    .vhb-switch--button {
      padding-right: 1.7em;
      background-color: $vhb-switch-open-background-color;
    }
    .vhb-switch--icon {
      left: 100%;
      transform: translateX(-1.4em);
    }
  }
  &.is--off {
    .vhb-switch--button {
      padding-left: 1.7em;
      background-color: $vhb-switch-close-background-color;
    }
    .vhb-switch--icon {
      left: 0.2em;
      transform: translateX(0);
    }
  }
  &.is--on .vhb-switch--label-off,
  &.is--off .vhb-switch--label-on {
    height: 0;
    visibility: hidden;
    overflow: hidden;
  }
  &.is--on,
  &.is--off {
    .vhb-switch--label {
      opacity: 1;
    }
  }
  &:not(.is--disabled) {
    .vhb-switch--button {
      cursor: pointer;
      &:focus {
        box-shadow: 0 0 0.4em 0 $vhb-primary-color;
      }
    }
  }
  &.is--disabled {
    .vhb-switch--button {
      cursor: no-drop;
    }
    &.is--on {
      .vhb-switch--button {
        background-color: lighten($vhb-primary-color, 20%);
      }
    }
    &.is--off {
      .vhb-switch--button {
        background-color: $vhb-switch-disabled-background-color;
      }
    }
  }
  .vhb-switch--button {
    display: block;
    position: relative;
    height: 1.6em;
    line-height: 1;
    min-width: 3.2em;
    padding: 0 0.6em;
    border-radius: 1em;
    border: 0;
    outline: 0;
  }
  .vhb-switch--label {
    opacity: 0;
    display: block;
    color: $vhb-switch-font-color;
    font-size: 0.8em;
  }
  .vhb-switch--icon {
    position: absolute;
    top: 0.2em;
    left: 0;
    width: 1.2em;
    height: 1.2em;
    border-radius: 50%;
    background-color: $vhb-switch-icon-background-color;
  }
  .vhb-switch--label-icon {
    margin-right: 0.25em;
  }
}

.vhb-switch {
  font-size: $vhb-font-size;
  &.size--medium {
    font-size: $vhb-font-size-medium;
  }
  &.size--small {
    font-size: $vhb-font-size-small;
  }
  &.size--mini {
    font-size: $vhb-font-size-mini;
  }
}
