@import '../base.scss';

.ss-switch {
  display: inline-flex;
  align-items: center;
  position: relative;
  font-size: 14px;
  line-height: 20px;
  height: 20px;
  vertical-align: middle;
  cursor: pointer;
}

.ss-switch_core {
  margin: 0;
  display: inline-block;
  position: relative;
  width: 36px;
  height: 20px;
  border: 0;
  outline: none;
  border-radius: 100px;
  box-sizing: border-box;
  background: $mc;
  transition: border-color .3s,background-color .3s;
  vertical-align: middle;
}

.ss-switch_core_dis {
  border: 0;
  background: $borderDark;
}

.ss-switch_core::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  border-radius: 100%;
  transition: all .3s;
  width: 12px;
  height: 12px;
  background-color: #fff;
}

.is-checked .ss-switch_core:after {
  left: 100%;
  margin-left: -18px;
}

.ss-switch_label {
  line-height: 1;
  font-size: 14px;
  display: inline-block;
  color: #C2C2C2;
}

.ss-switch_label-left {
  margin-right: 10px;
}

.ss-switch_label-right {
  margin-left: 10px;
}

.ss-disabled {
  cursor: not-allowed;
  .ss-switch_core{
    opacity: 0.5;
  }
}
.ss-switch--big {
  font-size: 16px;
  line-height: 24px;
  height: 24px;
  .ss-switch_core {
    width: 44px;
    height: 24px;
  }
  .ss-switch_core::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
  }
  .ss-switch_label {
    font-size: 16px;
  }
  &.is-checked .ss-switch_core::after {
    left: 100%;
    margin-left: -22px;
  }
}
.ss-switch--small {
  font-size: 12px;
  line-height: 16px;
  height: 16px;
  .ss-switch_core {
    width: 28px;
    height: 16px;
  }
  .ss-switch_core::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 4px;
    width: 10px;
    height: 10px;
  }
  .ss-switch_label {
    font-size: 12px;
  }
  &.is-checked .ss-switch_core::after {
    left: 100%;
    margin-left: -14px;
  }
}
