.toaster {
  position: fixed;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  top: 0;
  z-index: var(getCssVar(toaster-z-index));
  max-width: 50%;

  &.toast-bottom {
    flex-direction: column-reverse;
    top: unset;
    bottom: 0;

    .toast {
      margin-bottom: 5rem;

      &.toast-animated {
        margin-bottom: 1rem;
      }
    }
  }

  &.toaster-left {
    align-items: flex-start;
  }

  &.toaster-right {
    align-items: flex-end;
  }

  @include responsive('sm-down') {
    width: var(getCssVar(toaster-m-width));
    left: 50% !important;
    transform: translateX(-50%);
    max-width: unset;

    &.toaster-m-bottom {
      flex-direction: column-reverse;
      top: unset;
      bottom: var(getCssVar(toaster-m-offset));
      align-items: unset;

      .toast {
        margin-top: 0;
        margin-bottom: 5rem;

        &.toast-animated {
          margin-bottom: 0.75rem;
          margin-top: 0.75rem;
        }
      }
    }

    &.toaster-m-top {
      flex-direction: column;
      bottom: unset;
      top: var(getCssVar(toaster-m-offset)) !important;
      align-items: unset;

      .toast {
        margin-top: 5rem;
        margin-bottom: 0;

        &.toast-animated {
          margin-top: 0.75rem;
          margin-bottom: 0.75rem;
        }
      }
    }
  }

  .toast {
    display: flex;
    position: relative;
    pointer-events: auto;
    align-items: center;
    justify-items: center;
    padding: 1rem;
    margin-top: 5rem;
    transition-property: height, margin, opacity, padding, transform, box-shadow;
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.2;
    overflow: hidden;

    &.toast-loading {
      &::after {
        content: '';
        position: absolute;
        transition-duration: var(getCssVar(toast-loading-duration));
        transition-property: width;
        transition-timing-function: ease;
        border-bottom: var(getCssVar(toast-loading-border));
        width: 0%;
        left: 0;
        bottom: 0;
      }

      &.toast-load::after {
        width: 100%;
      }
    }

    .toast-trigger {
      margin-left: auto;
      padding-left: 0.5rem;
      display: flex;
      align-self: flex-start;
      cursor: pointer;
    }

    &.toast-animated {
      margin-top: 1rem;
      opacity: 1;
    }
  }
}
