$toggle-switch: (
  slider-bg: $base-light-grey-color,
  slider-before-bg: $base-white-color,
  slider-checked: $base-primary-blue,
);

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 15px;

  &__input {
    opacity: 0;
    width: 0;
    height: 0;
  }

  &__label {
    margin-right: 20px;
    line-height: 1;

    &-helper {
      @extend %title-helper-message;
    }
  }
}

.toggle-switch__slider {
  position: absolute;
  cursor: pointer;
  border-radius: 34px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: map-get($toggle-switch, 'slider-bg');
  transition: 0.25s;
}

.toggle-switch__slider::before {
  position: absolute;
  border-radius: 50%;
  content: '';
  width: 12px;
  height: 12px;
  left: 2px;
  bottom: 2px;
  background-color: map-get($toggle-switch, 'slider-before-bg');
  transition: 0.25s;
}

.toggle-switch__input:checked + .toggle-switch__slider {
  background-color: map-get($toggle-switch, 'slider-checked');
}

.toggle-switch__input:focus + .toggle-switch__slider {
  box-shadow: 0 0 1px map-get($toggle-switch, 'slider-checked');
}

.toggle-switch__input:checked + .toggle-switch__slider::before {
  transform: translateX(14px);
}
