/* -----------------------------------------------
Modal
----------------------------------------------- */

.b-modal-overlay {
  pointer-events: none;
  display: flex;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 500;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  opacity: 0;
  border: none;
  transition: opacity 0.15s linear;
  &.is-visible {
    pointer-events: all;
    opacity: 1;
    transition: opacity 0.15s linear;
  }
  &.is-overlapping {
    z-index: 700;
  }
}

.b-modal {
  visibility: hidden;
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
  opacity: 0;
  transform: translateY(-50px);
  transition: opacity 0.15s linear;
  & > * {
    pointer-events: none;
  }
  &.is-visible {
    visibility: visible;
    display: block;
    pointer-events: all;
    opacity: 1;
    transform: none;
    transition: opacity 0.15s linear;
    & > * {
      pointer-events: auto;
    }
  }
  &.is-overlapping {
    z-index: 1200;
    background: rgba(0, 0, 0, 0.4);
  }
}

.b-modal-header-title {
  font-size: 1.25rem;
  @media all and (max-width: 640px) {
    font-size: 1rem;
  }
}

.b-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(33, 37, 41, 0.125);
  border-radius: 0.4rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.5);
  outline: 0;
}

.b-modal-dialog {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 95%;
  max-width: 720px;
  min-height: calc(100vh - 3.5rem);
  margin: 1rem auto;
  border-radius: 5px;
  z-index: 1050;
  @media (max-width: 576px) {
    max-width: 500px;
    margin: 1.75rem auto;
  }
}

.b-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  border-bottom: 1px solid rgba(33, 37, 41, 0.125);
}

.b-modal-body {
  padding: 1rem;
}

.b-modal-close-btn {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  padding: 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 300;
  opacity: 0.5;
  cursor: pointer;
  transition: all 0.15s;
  &:focus {
    outline: none;
  }
  &:hover {
    opacity: 1;
  }
}

.b-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
  border-top: 1px solid #dee2e6;
  border-bottom-right-radius: calc(0.3rem - 1px);
  border-bottom-left-radius: calc(0.3rem - 1px);
}

@media (min-width: 1200px) {
  .b-modal-xl .b-modal-dialog {
    max-width: 1140px;
  }
}

@media (min-width: 992px) {
  .b-modal-lg .b-modal-dialog {
    max-width: 800px;
  }
}

@media (min-width: 576px) {
  .b-modal-sm .b-modal-dialog {
    max-width: 480px;
  }
}
