@import '../variables';

.switch {
  position: relative;
  width: 4.5rem;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.switchLabel {
  display: block;
}

.switchControl {
  display: inline-block;
  appearance: none;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  width: 4.5rem;
  height: 1.5rem;
  line-height: 1.5rem;
  border: 0px solid $brand-white;
  border-radius: 2.1rem;
  background-color: #B5B5B5;

  &:focus {
    outline: none;
  }

  &:checked {
    background-color: color($brand-primary lightness(60%));

    &:before {
      border-color: #0288D1;
      right: -.2rem;
      background-color: $brand-primary;
      box-shadow: .3rem .6rem 1.8rem 0 rgba(0, 0, 0, 0.2);
    }
  }

  &:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 2.6rem;
    display: block;
    width: 2.1rem;
    height: 2.1rem;
    margin: -.3rem -.2rem;
    background: $brand-white;
    border-radius: 2.1rem;
    box-shadow: 0 .6rem 1.2rem 0 #B5B5B5;
    transition: all .3s;
  }
}
