:host {
  /**
   * @prop --background: Background of the popover
   * @prop --box-shadow: Box shadow of the popover
   *
   * @prop --min-width: Minimum width of the popover
   * @prop --width: Width of the popover
   * @prop --max-width: Maximum width of the popover
   *
   * @prop --min-height: Minimum height of the popover
   * @prop --height: Height of the popover
   * @prop --max-height: Maximum height of the popover
   *
   * @prop --backdrop-opacity: Opacity of the backdrop
   */
  --background: var(--ion-background-color, #fff);
  --min-width: 0;
  --min-height: 0;
  --max-width: auto;
  --height: auto;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  position: fixed;
  align-items: center;
  justify-content: center;
  outline: none;
  color: var(--ion-text-color, #000);
  z-index: 1001;
}

:host(.overlay-hidden) {
  display: none;
}

.popover-wrapper {
  opacity: 0;
  z-index: 10;
}

.popover-content {
  display: flex;
  position: absolute;
  flex-direction: column;
  width: var(--width);
  min-width: var(--min-width);
  max-width: var(--max-width);
  height: var(--height);
  min-height: var(--min-height);
  max-height: var(--max-height);
  background: var(--background);
  box-shadow: var(--box-shadow);
  overflow: auto;
  z-index: 10;
}

.popover-viewport {
  --ion-safe-area-top: 0px;
  --ion-safe-area-right: 0px;
  --ion-safe-area-bottom: 0px;
  --ion-safe-area-left: 0px;
}

:host {
  --width: 200px;
  --max-height: 90%;
  --box-shadow: none;
  --backdrop-opacity: var(--ion-backdrop-opacity, 0.08);
}

.popover-content {
  border-radius: 10px;
}

.popover-arrow {
  display: block;
  position: absolute;
  width: 20px;
  height: 10px;
  overflow: hidden;
}

.popover-arrow::after {
  left: 3px;
  top: 3px;
  border-radius: 3px;
  position: absolute;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  background: var(--background);
  content: "";
  z-index: 10;
}
[dir=rtl] .popover-arrow::after, :host-context([dir=rtl]) .popover-arrow::after {
  left: unset;
  right: unset;
  right: 3px;
}

:host(.popover-bottom) .popover-arrow {
  top: auto;
  bottom: -10px;
}

:host(.popover-bottom) .popover-arrow::after {
  top: -6px;
}

@supports (backdrop-filter: blur(0)) {
  :host(.popover-translucent) .popover-content,
:host(.popover-translucent) .popover-arrow::after {
    background: rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);
    backdrop-filter: saturate(180%) blur(20px);
  }
}