.modal-box {
  &__container {
    @include make-container;
    @include make-container-max-widths;
  }

  &__row {
    @include make-row;
  }

  &__columns {
    @include make-col-ready;
    @include make-col(12);

    @include media-breakpoint-only(md) {
      @include make-col(10);
    }

    @include media-breakpoint-up(lg) {
      @include make-col(8);
    }
  }

  &__content {
    border: 0;
    border-radius: 0;
    box-shadow: 0 2px 10px 0 $black-transparent40;
  }

  &__header {
    position: relative;
    display: block;
    flex-shrink: 0;
    padding-left: 0;
    padding-right: 0;
    border-bottom: 0;

    &::after {
      content: '';
      position: absolute;
      display: block;
      height: 1px;
      left: 0;
      right: 0;
      bottom: 0;
      border-bottom: 1px solid $gray;

      @include media-breakpoint-down(sm) {
        left: -15px;
        right: -15px;
      }
    }

    .close {
      position: absolute;
      right: -.3125rem;
      top: .625rem;
      padding: 0;
      margin: 0;

      @include media-breakpoint-up(md) {
        right: .625rem;
      }
    }
  }

  &__body {
    min-height: 100%; // IE fix

    @include media-breakpoint-down(sm) {
      min-height: calc(100% - 72px);
    }

    .popup-actions {
      text-align: center;
      margin-right: -15px;

      .confirm-btn {
        @include media-breakpoint-up(md) {
          min-width: 160px;
        }

        @include media-breakpoint-down(sm) {
          width: 100%;
        }
      }
    }
  }

  &__inner-row {
    @include media-breakpoint-up(md) {
      @include make-row;
    }
  }

  &__btn-close {
    font-size: 1rem;
    color: $warm-grey;
  }

  &__inner-columns {
    @include make-col-ready;

    @include media-breakpoint-up(md) {
      @include make-col(8, 10);
    }

    @include media-breakpoint-up(lg) {
      @include make-col(6, 8);
    }
  }

  &_full {
    @include media-breakpoint-down(sm) {
      background: $white;

      .modal-box__container,
      .modal-box__row,
      .modal-box__columns,
      .modal-box__content {
        height: 100%;
      }

      .modal-box__container {
        margin-top: 0;
        margin-bottom: 0;
        max-width: none;
      }

      .modal-box__content {
        width: auto;
        box-shadow: none;
      }

      .modal-box__inner-row {
        @include make-row;
      }
    }

    @include media-breakpoint-only(sm) {
      .modal-box__inner-row {
        @include make-container-max-widths;
        margin: auto;
      }

      // IE11 fix
      .modal-box__body {
        align-self: center;
      }
    }
  }

  &_wide {
    .modal-box__columns {
      @include media-breakpoint-only(md) {
        @include make-col(12);
      }

      @include media-breakpoint-only(lg) {
        @include make-col(10);
      }
    }

    .modal-box__inner-columns {
      @include media-breakpoint-only(md) {
        @include make-col(10, 12);
      }

      @include media-breakpoint-only(lg) {
        @include make-col(8, 10);
      }
    }
  }

  &.modal-round {
    .modal-box__content {
      border-radius: .3rem;
    }
  }
}

.modal-open .modal {
  // Should be removed, if iOS9 bug occur in later versions https://github.com/twbs/bootstrap/issues/17695
  -webkit-overflow-scrolling: touch;
}

@include media-breakpoint-down(sm) {
  .modal-box {
    &.modal-round {
      .modal-box__header .close {
        right: .625rem;
      }

      .modal-body {
        padding: 0 1.5rem;
      }
    }
  }
}
