/**
 * Modal 模态框
 * @Author 瞿龙俊 - qulongjun@shine.design
 * @Date 2019/3/24 14:43
 */

.modal {
  .modal-content {
    @include shine-rounded {
      border-radius: $shine-border-radius;
    }

    .modal-header {
      .modal-title {
        font-weight: 500;
        font-size: 1.3rem;
        color: shine-base-color(label, 4);

        small {
          font-weight: 400;
          font-size: 0.9rem;
          color: shine-base-color(label, 2);
        }
      }

      .close {
        outline: none !important;
        color: shine-base-color(label, 2);

        @include shine-close-icon();
        @include shine-hover-transition();

        &:before {
          font-size: 1.3rem;
        }

        span {
          display: none;
        }

        &:hover {
          color: shine-brand-color();
        }
      }
    }
  }

  // Stick to bottom right
  &.modal-sticky-bottom-right {
    padding: 0 !important;
    max-width: 500px;
    height: auto;
    position: fixed;
    left: auto;
    top: auto;
    bottom: 25px;
    right: 25px;
    margin: 0;
    box-shadow: 0px 0px 60px -15px rgba(0, 0, 0, 0.2);

    @include shine-rounded {
      border-radius: $shine-border-radius;
    }

    @include shine-tablet-and-mobile {
      bottom: 10px;
      right: 10px;
    }

    @include shine-mobile {
      max-width: 90%;
    }

    .modal-dialog {
      position: static;
      max-width: 500px;
      width: auto;
      margin: 0;

      @include shine-rounded {
        border-radius: $shine-border-radius;
      }

      .modal-content {
        border: 0;
        @include shine-rounded {
          border-radius: $shine-border-radius;
        }
      }
    }
  }
}

.modal-open {
  overflow: auto !important;
  padding: 0 !important;
}

.modal-body {
  &.modal-body-fit {
    padding: 0;
  }

  &.modal-body-x-fit {
    padding-left: 0;
    padding-right: 0;
  }

  &.modal-body-y-fit {
    padding-top: 0;
    padding-bottom: 0;
  }
}

@include shine-media-above(xl) {
  .modal-dialog.modal-xl {
    max-width: shine-media-breakpoint(xl) - 100px;
  }
}
