.group-bys {
  .dropdown__selected {
    @extend %ellipsis;
  }
}

.group-bys__content {
  max-height: inherit;
  display: flex;
  flex-direction: column;
}

.group-bys__none {
  padding: 16px 20px;

  &--scrollable {
    overflow-y: scroll;
  }
}

.group-bys__none-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
}

.group-bys__none-description {
  font-size: 13px;
}

.group-bys__items {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  gap: 16px;

  &--scrollable {
    overflow-y: scroll;
  }
}

.group-bys__item {
  position: relative;
  padding: 0 16px;

  @include rounded($rounded);
  @include flex-align-items(10px);

  &.group-bys__item--loading {
    &::before {
      content: '';
      margin: 0 4px;

      @include loading(14px);
    }
  }
}

.group-bys__remove {
  font-size: 20px;
  color: $color-neutral-900;
  justify-content: center;
  width: 22px;

  @include flex-align-items;

  &:hover {
    text-decoration: none;
    color: $color-neutral-500;
  }

  .group-bys__item--loading & {
    display: none;
  }
}

.group-bys__description {
  flex: 0 0 58px;
  width: 58px;
  margin-right: 2px;

  span {
    padding-left: 12px;
  }
}

.group-bys__field {
  margin-right: 10px;
  flex: 0 0 120px;

  .dropdown,
  .dropdown__selected {
    width: 120px;
  }
}

.group-bys__order {
  display: flex;
}

.group-bys__order-item {
  justify-content: center;
  flex-wrap: nowrap;
  height: 32px;
  color: $color-neutral-900;
  font-weight: 600;
  width: 80px;
  font-size: 14px;

  @include rounded($rounded);
  @include flex-align-items(5px);

  &:not(:last-child) {
    margin-right: 10px;
  }

  > div {
    font-weight: 600;

    &:not(:last-child) {
      margin-right: 8px;
    }
  }

  &:hover {
    background-color: $color-neutral-100;
    text-decoration: none;

    .group-bys__order--disabled & {
      cursor: inherit;
      background-color: transparent;
    }
  }

  &.active {
    background-color: $color-primary-100;

    .group-bys__order--disabled & {
      background-color: $color-neutral-100;
    }
  }
}

.group-bys__add {
  @include absolute(calc(100% + 4px), auto, auto, 0);
}
