.ant-modal-mask {
  background-color: transparent;
}

.ant-modal-wrap {
  background-color: rgba(0, 0, 0, 0.5);
}

.igloo-modal-limit-height {
  .ant-modal-body {
    max-height: calc(~'100vh' - 340px);
    overflow: auto;
  }
}

.igloo-modal-no-limit-height {
  padding-bottom: 100px !important;
}

.igloo-modal {
  top: 100px;
  padding: 0;

  .igloo-modal-footer-button {
    min-width: 159px;

    &:not(:first-child) {
      margin-left: 16px !important;
    }
  }

  .ant-btn-link {
    min-width: unset;
  }

  .ant-modal-content {
    filter: drop-shadow(0px 1px 4px rgba(0, 0, 0, 0.4));
    box-shadow: none;
    padding: 0;

    & > .ant-modal-header {
      padding: 16px 24px 15px 24px;
      border-bottom: 1px solid @divider-color;

      .ant-modal-title {
        font-style: normal;
        font-weight: 500;
        font-size: 20px;
        line-height: 28px;
      }
    }

    & > .ant-modal-body {
      line-height: 24px;
      padding: 24px;

      .igloo-page-container {
        padding: 0;
      }
    }

    & > .ant-modal-footer {
      display: flex;
      justify-content: flex-end;
      padding: 16px 24px;
      border-top: 1px solid @divider-color;
    }

    .ant-modal-close {
      right: 24px;
      color: #666;
      width: 24px;
      height: 24px;

      &:hover {
        background-color: transparent;
        color: #818181;
      }

      &:active {
        background-color: transparent;
        color: #515151;
      }

      .ant-modal-close-x {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-end;
      }
    }
  }
}

.igloo-modal-no-footer.igloo-modal-limit-height {
  .ant-modal-body {
    max-height: calc(~'100vh' - 260px);
  }
}

.igloo-modal-no-footer {
  .ant-modal-body {
    .ant-modal-confirm-btns {
      display: none;
    }
  }
}

@media screen and (max-width: 768px) {
  .igloo-modal-limit-height {
    .ant-modal-body {
      max-height: calc(~'100vh' - 300px);
    }
  }

  .igloo-modal-no-limit-height {
    padding-bottom: 50px !important;
  }

  .igloo-modal {
    top: 50px;
    width: calc(~'100%' - 32px);
    margin: 0 auto;

    .ant-modal-header {
      padding: 16px;

      .ant-modal-title {
        font-size: 16px;
      }
    }

    .ant-modal-content .ant-modal-close {
      right: 16px;
    }

    .ant-modal-body {
      padding: 24px 16px;
    }

    .ant-modal-footer {
      padding: 16px;
      justify-content: stretch;
    }

    .igloo-modal-footer-btns {
      width: 100%;
      display: flex;
      flex-direction: column-reverse;

      .igloo-modal-footer-button {
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;

        & + .igloo-modal-footer-button {
          margin-bottom: 12px;
        }
      }
    }
  }

  .igloo-modal-no-footer.igloo-modal-limit-height {
    .ant-modal-body {
      max-height: calc(~'100vh' - 160px);
    }
  }

  .igloo-modal-no-footer {
    .ant-modal-body {
      .ant-modal-confirm-btns {
        display: none;
      }
    }
  }
}

@media screen and (min-width: 1200px) {
  .igloo-modal {
    width: 760px;
  }
}

@media screen and (min-width: 992px) and (max-width: 1200px) {
  .igloo-modal {
    width: 660px;
  }
}

@media screen and (min-width: 768px) and (max-width: 992px) {
  .igloo-modal {
    width: 512px;
  }
}
