/**********
 * Switch *
 **********/
GtkSwitch {
  -GtkSwitch-slider-width: 24px;
  -GtkSwitch-slider-height: 24px;

  font: 1;
  font-weight: bold;
  outline-offset: -4px;
  transition: all 200ms ease-in;

  border: none;
  border-radius: 14px;
  color: transparent;

  background-color: if($variant == 'light', transparentize(black, 0.9), transparent);
  box-shadow: if($variant == 'light', (inset 0 0 0 1px transparentize(black, 0.8), 0px 1px $bottom_highlight), 0 0 0 1px transparentize(black, 0.7));

  &:insensitive {
    background-color: transparentize(black, 0.9);
  }

  &:backdrop {
    background-color: $backdrop_bg_color;
    transition: $backdrop_transition;

    &:insensitive { background-color: $insensitive_bg_color; }
  }


  &:active,
  &:checked {
    background-color: $selected_bg_color;

    &:backdrop {
      background-color: $backdrop_selected_bg_color;

      .slider,
      slider {
        &:backdrop {
          box-shadow:none;
          background-color:transparentize($bg_color, 0.1);
          border:none;
        }
      }
    }
  }

  // Handle
  .slider {
    padding:2px;
    border-radius: 50%;
    transition: $button_transition;
    background-color: if($variant == 'light', $bg_color, darken($bg_color, 5%));

    box-shadow: if($variant == 'light', (
                  0 2px 2px transparentize(black, 0.8),
                  0 1px 2px transparentize(black, 0.8)
                  ),(
                  none
                ));

    &:backdrop {
      box-shadow:none;
    }

    &:insensitive {
      box-shadow:none;
    }
  }

  // Trough
  .trough {

    &:active,
    &:checked {
      background-color: $selected_bg_color;

      &:backdrop {
        background-color: $backdrop_selected_bg_color;
      }
    }

  }
}
