.modal {
  &-opened {
    overflow: hidden;
  }

  position: fixed;
  background-color: rgba(0, 0, 0, 0.65);
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  z-index: 9999;
  overflow-y: auto;

  @include breakpoint(mobile) {
    z-index: 100000;
  }

  &__body {
    width: 100%;
    max-width: 30rem;
    margin: 5rem auto;

    background-color: $white;
    border-radius: $radius;

    &--no-content-padding {
      .modal__content {
        padding: 0;
      }
    }

    &--wide {
      max-width: 50rem;
    }

    @include breakpoint(mobile) {
      min-height: 100vh;
      margin: 0;
      border-radius: 0;
    }
  }

  &__header {
    padding: .5rem 1rem;
    font-size: 20px;
    font-weight: bold;
    line-height: 1.5;
    border-bottom: 1px solid #eee;

    &.invisible-header {
      border: none;
      font-size: unset;
      font-weight: unset;
      padding-top: 12px !important;
      h3 {
        margin-top: 0;
        line-height: 1.5;
        margin-bottom: 0;
      }
      p {
        margin-top: .25rem;
        font-size: 14px;
        opacity: .6;
        margin-bottom: 0;
      }
      & + .modal__content {
        padding-top: 6px !important;
      }
    }

    @include breakpoint(mobile) {
      position: relative;

      .modal--right {
        position: absolute;
        top: 0;
        padding: 6px 1rem 0 1rem;
        right: 0;
        background-color: white;
      }
    }

    &-buttons {
      font-weight: normal;
    }
  }

  &__close {
    opacity: .5;
    cursor: pointer;
    &:hover {
      opacity: .8;
    }
  }

  &--right {
    float: right;
  }

  &__content {
    padding: 1rem;
  }

  &__footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    text-align: right;

    .button {
      display: inline-block !important;
      margin-left: 4px !important;
    }
    .footer-confirm {
      margin: 0;
      padding: 0;
      display: flex;
      align-items: center;

      @include breakpoint(mobile) {
        display: block;
        &__message {
          padding-right: 0;
          padding-bottom: 10px;
        }
      }

      &__buttons {
        flex-shrink: 0;

        &--left {
          margin-right: auto;
          flex-grow: 1;
          text-align: left;
        }
      }

      &__message {
        margin-right: auto;
        &.__right {
          flex-grow: 1;
          padding-right: 10px;
          text-align: right;
        }
      }
    }
  }
}

.modal-transition {
  &-enter, &-leave-to {
    opacity: 0;

    .modal__body {
      opacity: 0;
      transform: scaleX(.8) scaleY(.7);
    }
  }

  &-enter-active, &-leave-active {
    transition: opacity 0.25s ease-out;

    .modal__body {
      transition: all .25s cubic-bezier(.665,1.65,0,.845);
    }
  }
}

.button-clear {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
