::ng-deep .ngxePopover {
  &.popover {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1060;
    display: block;
    max-width: 276px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
      "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
      "Segoe UI Symbol";
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
    text-align: start;
    text-decoration: none;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    word-break: normal;
    word-spacing: normal;
    white-space: normal;
    line-break: auto;
    font-size: 0.875rem;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.3rem;

    .arrow {
      position: absolute;
      display: block;
      width: 1rem;
      height: 0.5rem;
      margin: 0 0.3rem;

      &::before,
      &::after {
        position: absolute;
        display: block;
        content: "";
        border-color: transparent;
        border-style: solid;
      }
    }

    .popover-header {
      padding: 0.5rem 0.75rem;
      margin-bottom: 0;
      font-size: 1rem;
      color: inherit;
      background-color: #f7f7f7;
      border-bottom: 1px solid #ebebeb;
      border-top-left-radius: calc(0.3rem - 1px);
      border-top-right-radius: calc(0.3rem - 1px);

      &:empty {
        display: none;
      }
    }

    .popover-body {
      padding: 0.5rem 0.75rem;
      color: #212529;
    }

    &.bs-popover-top {
      margin-bottom: 0.5rem;

      .arrow {
        bottom: calc((0.5rem + 1px) * -1);
      }

      .arrow::before,
      .arrow::after {
        border-width: 0.5rem 0.5rem 0;
      }

      .arrow::before {
        bottom: 0;
        border-top-color: rgba(0, 0, 0, 0.25);
      }

      .arrow::after {
        bottom: 1px;
        border-top-color: #fff;
      }
    }

    &.bs-popover-right {
      margin-left: 0.5rem;

      .arrow {
        left: calc((0.5rem + 1px) * -1);
        width: 0.5rem;
        height: 1rem;
        margin: 0.3rem 0;
      }

      .arrow::before,
      .arrow::after {
        border-width: 0.5rem 0.5rem 0.5rem 0;
      }

      .arrow::before {
        left: 0;
        border-right-color: rgba(0, 0, 0, 0.25);
      }

      .arrow::after {
        left: 1px;
        border-right-color: #fff;
      }
    }

    &.bs-popover-bottom {
      margin-top: 0.5rem;

      .arrow {
        left: 45% !important;
        top: calc((0.5rem + 1px) * -1);
      }

      .arrow::before,
      .arrow::after {
        border-width: 0 0.5rem 0.5rem 0.5rem;
      }

      .arrow::before {
        top: 0;
        border-bottom-color: rgba(0, 0, 0, 0.25);
      }

      .arrow::after {
        top: 1px;
        border-bottom-color: #fff;
      }

      // This will remove the popover-header's border just below the arrow
      .popover-header::before {
        position: absolute;
        top: 0;
        left: 50%;
        display: block;
        width: 1rem;
        margin-left: -0.5rem;
        content: "";
        border-bottom: 1px solid #f7f7f7;
      }
    }

    &.bs-popover-left {
      margin-right: 0.5rem;

      .arrow {
        right: calc((0.5rem + 1px) * -1);
        width: 0.5rem;
        height: 1rem;
        margin: 0.3rem 0;
      }

      .arrow::before,
      .arrow::after {
        border-width: 0.5rem 0 0.5rem 0.5rem;
      }

      .arrow::before {
        right: 0;
        border-left-color: rgba(0, 0, 0, 0.25);
      }

      .arrow::after {
        right: 1px;
        border-left-color: #fff;
      }
    }

    &.bs-popover-auto {
      &[x-placement^="top"] {
        @extend .bs-popover-top;
      }

      &[x-placement^="right"] {
        @extend .bs-popover-right;
      }

      &[x-placement^="bottom"] {
        @extend .bs-popover-bottom;
      }

      &[x-placement^="left"] {
        @extend .bs-popover-left;
      }
    }
  }
}
