.sui-o-modal {
  z-index: $sui-z-index-o-modal;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;

  &:not(.as--open) {
    *,
    *::after,
    *::before {
      pointer-events: none !important;
    }
  }

  &::before {
    content: '';
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba($sui-color-brand-denim-700, .9);
    opacity: 0;
    transition: opacity .5s;
  }

  // -------------------------
  //    Open state
  // -------------------------
  &.as--open {
    pointer-events: auto;

    &::before {
      opacity: 1;
    }
  }

  &.as--open &__content {
    transform: translate(0);
    opacity: 1;
  }

  // -------------------------
  //    Content
  // -------------------------
  &__content {
    z-index: 2;
    position: relative;
    background: $sui-color-brand-denim-100;
    display: flex;
    flex-direction: column;
    box-shadow: 0 rem(1) rem(8) rgba(0, 0, 0, .2);
    border-radius: $sui-border-radius-md;
    max-height: 90vh;
    width: $sui-o-modal-size-md;
    max-width: 100%;
    margin: $sui-space-md;
    overflow: auto;
    transform: translateY(15%);
    opacity: 0;
    transition: transform .4s $sui-curve-easeInOutCubic, opacity .3s;
  }

  // -------------------------
  //    Sizes
  // -------------------------
  &.as--size-xxs &__content {
    width: $sui-o-modal-size-xxs;
  }

  &.as--size-xs &__content {
    width: $sui-o-modal-size-xs;
  }

  &.as--size-sm &__content {
    width: $sui-o-modal-size-sm;
  }

  &.as--size-lg &__content {
    width: $sui-o-modal-size-lg;
  }

  &.as--size-xl &__content {
    width: $sui-o-modal-size-xl;
  }

  &.as--size-xxl &__content {
    width: $sui-o-modal-size-xxl;
  }

  // -------------------------
  //    Fullscreen
  // -------------------------
  &.as--fullscreen::before {
    display: none;
  }

  &.as--fullscreen &__content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: none;
    width: auto;
    padding: $sui-space-md;
    margin: 0;
    border-radius: 0;
  }

  // -------------------------
  //    Header
  // -------------------------
  &__header {
    z-index: 2;
    position: relative;
    flex: none;
    display: flex;
    flex-wrap: nowrap;
    background: $sui-color-brand-denim-100;
    box-shadow: 0 $sui-space-md*0.5 $sui-space-md $sui-color-brand-denim-100;
  }

  &__close {
    font-size: $sui-font-size-xl;
    font-family: $sui-font-family-secondary;
    padding: 0 $sui-space-md;
    font-weight: 300;
    order: 1;
    margin-left: auto;
    opacity: .4;
    transition: .2s;

    &:hover,
    &:focus {
      opacity: 1;
    }
  }

  &__title {
    font-weight: 300;
    margin: 0;
    font-size: $sui-font-size-ml;
    padding: $sui-space-md $sui-space-md 0 $sui-space-md;
  }

  // -------------------------
  //    Body
  // -------------------------
  &__body {
    z-index: 1;
    flex-grow: 1;
    position: relative;
    padding: $sui-space-md;
    overflow: auto;

    & > :first-child {
      margin-top: 0;
    }

    & > :last-child {
      margin-bottom: 0;
    }
  }

  // -------------------------
  //    Footer
  // -------------------------
  &__footer {
    z-index: 2;
    flex: none;
    overflow: hidden;
    margin-top: auto;
    padding: $sui-space-xs $sui-space-md $sui-space-md $sui-space-md;
    background: $sui-color-brand-denim-100;
    box-shadow: 0 (-1)*$sui-space-md*0.5 $sui-space-md $sui-color-brand-denim-100;
  }
}
