.quick-settings {
  padding: $base_padding * 3 !important;
  border-radius: $base_radius + $base_padding * 3 !important;
  margin-top: 8px !important;

  .icon-button, .button {
    min-height: 22px;
    min-width: 22px;
    padding: $base_padding * 1.5;

    > StIcon { icon-size: $base_icon_size !important; }
  }
}

.quick-settings-grid {
  spacing-rows: $base_padding * 2;
  spacing-columns: $base_padding * 2;
}

.quick-toggle {
  border-radius: $base_radius;
  min-width: if($compact == 'false', 12em, 11em) !important;
  max-width: if($compact == 'false', 12em, 11em) !important;
  min-height: 22px + $base_padding * 3 !important;
  border: none;
  background-color: $button !important;

  &:hover {
    background-color: $divider !important;
  }

  &:active {
    background-color: rgba($text, 0.15) !important;
  }

  &:checked {
    background-color: $primary !important;
    color: on($primary);

    &:hover {
      background-color: mix($text, $primary, 6%) !important;
      color: on($primary);
    }

    &:active {
      background-color: mix($text, $primary, 15%) !important;
      color: on($primary);
    }
  }

  > StBoxLayout {
    spacing: $base_padding;
    padding: 0 $base_padding * 2;
  }

  &.button {
    padding: 0;
  }

  &:ltr > StBoxLayout { padding-left: $base_padding * 2.5; }
  &:rtl > StBoxLayout { padding-right: $base_padding * 2.5; }

  .quick-toggle-label { font-weight: bold; }

  .quick-toggle-icon,
  .quick-toggle-arrow { icon-size: $base_icon_size !important; }
}

.quick-menu-toggle {
  &:ltr > StBoxLayout { padding-right: 0; }
  &:rtl > StBoxLayout { padding-left: 0; }

  .quick-toggle-arrow {
    background-color: $button !important;
    padding: $base_padding $base_padding * 1.75;
    icon-size: $base_icon_size !important;

    &:active {
      background-color: $divider !important;
    }

    &:ltr { border-radius: 0 $base_radius $base_radius 0; }
    &:rtl { border-radius: $base_radius 0 0 $base_radius; }
  }
}

.quick-slider {
  padding: 0 $base_padding;

  & > StBoxLayout { spacing: $base_padding; }

  .slider-bin {
    &:focus { @include button(focus); }
    min-height: 16px; // slider size
    padding: $base_padding;
    border-radius: $circular_radius;
  }

  .quick-toggle-icon, .quick-toggle-arrow {
    icon-size: $base_icon_size !important;
  }

  .icon-button {
    background-color: transparent;
    color: $text !important;

    &:hover {
      background-color: $fill;
    }

    &:active {
      background-color: $divider;
    }
  }
}

.quick-toggle-menu {
  border-radius: $base_radius !important;
  padding: $base_padding * 2 !important;
  margin: $base_padding * 2 10px + $base_padding * 3 0 !important;

  @if $sidebar == 'styled' {
    background-color: $primary !important;
    color: on($primary, secondary) !important;

    .popup-separator-menu-item-separator {
      padding: 0 !important;
      margin: 0 !important;
      background-color: on($primary, divider) !important;
    }
  } @else {
    background-color: $popover !important;
    color: $text !important;
  }

  .popup-menu-item {
    min-height: 20px;
    padding: $base_padding;
    spacing: $base_padding;
    border-radius: $base_radius !important;

    @if $sidebar == 'styled' {
      color: on($primary, secondary) !important;

      &:focus, &.hover, &.selected {
        color: on($primary) !important;
        background-color: on($primary, divider) !important;
      }

      &:active, &.selected:active {
        color: on($primary) !important;
        background-color: on($primary, track) !important;
      }
    } @else {
      color: $text-secondary !important;

      &:focus, &:hover, &.selected {
        color: $text !important;
        background-color: rgba($text, 0.1) !important;
      }

      &:active {
        color: $text !important;
        background-color: rgba($text, 0.2) !important;
      }
    }

    > StIcon { -st-icon-style: symbolic; }
  }

  .header {
    spacing-rows: 0.5 * $base_padding;
    spacing-columns: $base_padding * 2;
    padding-bottom: 2 * $base_padding;

    .icon {
      icon-size: $base_icon_size * 1.5; // a non-standard symbolic size but ok
      border-radius: $base_radius;
      padding: 1.5 * $base_padding;
      background-color: on($popover, divider) !important;

      &.active {
        background-color: on($primary) !important;
        color: $primary;
      }
    }

    .title {
      @extend %title_3;
    }

    .subtitle {
      @extend %caption_heading;
    }
  }
}

.quick-settings-system-item {
  > StBoxLayout { spacing: 2 * $base_padding; }

  .icon-button {
    > StIcon {
      -st-icon-style: symbolic;
      icon-size: $base_icon_size !important;
    }
  }

  .power-item {
    min-height: 0 !important;
    min-width: 0 !important;
    background-color: $fill;

    &:insensitive {
      @include button(normal);
      background-color: transparent;
    }
  }
}

.nm-network-item {
  .wireless-secure-icon { icon-size: 0.5 * $base_icon_size; }
}
