@use "../variables";

.f-btn-group {
  display: inline-flex;
  vertical-align: middle;

  > button {
    flex: 0 1 auto;

    &:not(:first-child):not(:last-child):not(.dropdown-toggle) {
      border-radius: 0;
    }

    &:last-child:not(:first-child):not(.dropdown-toggle) {
      border-bottom-right-radius: 0;
      border-top-right-radius: 0;
      border-bottom-left-radius: variables.$input-border-radius;
      border-top-left-radius: variables.$input-border-radius;
    }

    &:first-child {
      margin-left: 0;
    }

    &:first-child:not(:last-child):not(.dropdown-toggle) {
      border-bottom-left-radius: 0;
      border-top-left-radius: 0;
      border-bottom-right-radius: variables.$input-border-radius;
      border-top-right-radius: variables.$input-border-radius;
    }
  }

  button + button,
  button + .f-btn-group,
  .f-btn-group + button,
  .f-btn-group + .f-btn-group,
  .f-btn-group-vertical button + button,
  .f-btn-group-vertical button + .f-btn-group,
  .f-btn-group-vertical .f-btn-group + button,
  .f-btn-group-vertical .f-btn-group + .f-btn-group {
    margin-right: -1px;
  }
}
