@use "mixins/border-radius";
@use "variables";
@use "vendor/rfs";
@use "functions";

.toast {
  // Prevents from shrinking in IE11, when in a flex container
  // See https://github.com/twbs/bootstrap/issues/28341
  flex-basis: variables.$toast-max-width;
  max-width: variables.$toast-max-width;
  @include rfs.font-size(variables.$toast-font-size);
  color: variables.$toast-color;
  background-color: variables.$toast-background-color;
  background-clip: padding-box;
  border: variables.$toast-border-width solid variables.$toast-border-color;
  box-shadow: variables.$toast-box-shadow;
  opacity: 0;
  @include border-radius.border-radius(variables.$toast-border-radius);

  &:not(:last-child) {
    margin-bottom: variables.$toast-padding-x;
  }

  &.showing {
    opacity: 1;
  }

  &.show {
    display: block;
    opacity: 1;
  }

  &.hide {
    display: none;
  }
}

.toast-header {
  display: flex;
  align-items: center;
  padding: variables.$toast-padding-y variables.$toast-padding-x;
  color: variables.$toast-header-color;
  background-color: variables.$toast-header-background-color;
  background-clip: padding-box;
  border-bottom: variables.$toast-border-width solid variables.$toast-header-border-color;
  @include border-radius.border-top-radius(functions.subtract(variables.$toast-border-radius, variables.$toast-border-width));
}

.toast-body {
  padding: variables.$toast-padding-x; // apply to both vertical and horizontal
}
