.ui-modal {
  transform: translate3d(0, 0, 0);
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-overflow-scrolling: touch;
  overflow: auto;
  z-index: $base-zindex-modal;
  will-change: opacity;

  &.radius {
    .ui-modal-dialog {
      border-radius: $base-modal-radius;
    }
  }

  &.round {
    .ui-modal-dialog {
      border-radius: $base-modal-round;
    }
  }

  > .ui-modal-wrapper {
    width: 100%;
    margin: auto 0;

    > .ui-modal-dialog {
      position: relative;
      margin: 60px auto;
      background: #fff;
      box-shadow: 0 7px 21px rgba(0, 0, 0, .2);
      overflow: hidden;
      z-index: $base-zindex-modal + 1;
      will-change: transform;

      &:focus {
        outline: none;
      }
    }
  }
  // fix popover-content position when using in Modal
  .ui-popover-content {
    position: absolute !important;
  }
}

.ui-modal-header {
  position: relative;
  height: 50px;
  border-bottom: 1px solid #e9e9e9;
  padding: 0 20px;

  .ui-modal-title {
    font-size: 16px;
    line-height: 50px;
  }

  .ui-modal-close {
    position: absolute;
    top: 0;
    right: 15px;
    font-size: 20px;
    line-height: 50px;
    color: #999;
    cursor: pointer;
    // transition: transform .2s ease;

    &:hover {
      color: #666;
      // transform: rotate(360deg);
    }
  }
}

.ui-modal-body {
  padding: 20px;
  // TODO
  // .ui-popover-content {
  //   position: absolute !important;
  // }
}

.ui-modal-footer {
  border-top: 1px solid #e9e9e9;
  padding: 10px 18px;
  text-align: right;

  button + button {
    margin-left: 10px;
  }
}

.ui-modal-body-overflow {
  overflow-y: hidden;
}
