/* stylelint-disable declaration-block0no-duplicate-properties */
.toggle-switch {
  align-items: center;
  display: flex;
  justify-content: center;
  position: relative;

  &.inside {
    margin: 2em auto;
  }

  &.outside {
    margin: 2em;
  }

  &.none {
    justify-content: flex-start;
  }

  .input-row & {
    margin: 0;
    justify-content: space-between;
  }

  &__label {
    align-items: center;
    display: flex;
    margin: {
      top: 0;
      right: 1em;
      bottom: 0;
    }
  }

  &__status {
    color: $white;
    font-size: 0.75em;
    font-weight: 600;
    left: 50%;
    opacity: 0;
    position: absolute;
    text-transform: uppercase;
    top: 50%;
    transform: scale(1) translate3d(-50%, -50%, 0);
    transition: opacity 0.2s;
    user-select: none;

    &.on {
      opacity: 1;
    }

    &--first {
      left: 27%;
    }

    &--second {
      color: palette(gray);
      left: 73%;
    }
  }

  &__btn {
    @include pop();

    color: palette(gray, dark);
    background: none;
    border: none;
    padding: 0 2em;
    transition: opacity 0.2s;
    transition: all 0.4s cubic-bezier(0.3, 0, 0, 1.3);

    &:hover {
      color: palette(gray, x-dark);
    }

    &.off {
      opacity: 0.75;
    }

    &:first-child {
      text-align: right;
    }

    &:last-child {
      text-align: left;
    }
  }

  &__container {
    background: palette(gray, xx-light);
    border-radius: 40px;
    border: 1px solid palette(gray, light);
    box-shadow: 0 1px 1px rgba(black, 0.2) inset;
    display: flex;
    flex: 0 62px;
    position: relative;
    height: 32px;
    transition: background 0.2s;

    &.push-right {
      margin-left: auto;
    }

    &.on {
      background: palette(blue, x-dark);
    }

    .toggle-switch__indicator {
      @include pop();

      background-image: linear-gradient($white, palette(gray, xx-light));
      border-radius: 100%;
      border: 1px solid palette(gray, x-light);
      box-shadow: 0 1px 1px rgba(black, 0.2);
      height: 20px;
      padding: 0;
      position: absolute;
      transition: all 0.4s cubic-bezier(0.3, 0, 0, 1.3);
      width: 20px;
      top: 50%;
      transform: translate(0, -50%);

      &.show,
      &.is-selected {
        transform: translate(28px, -50%);
      }

      // @include gmq(palm) {
      //   &.show,
      //   &.is-selected {
      //     transform: translate(28px, -50%);
      //   }
      // }
    }
  }
}
