/**
 * Dropdown Style
 */

@import '../mixins/index.scss';

.at-dropdown {
  display: inline-block;

  &__popover {
    position: absolute;
    overflow: visible;
    z-index: $zindex-dropdown;
  }
}

.at-dropdown-menu {
  position: relative;
  padding: 0;
  width: inherit;
  max-height: $dropdown-max-height;
  border-radius: $border-radius-base;
  background-color: $dropdown-bg-color;
  box-shadow: $dropdown-box-shadow;
  list-style: none;
  // overflow-y: auto;
  z-index: $zindex-dropdown;
  .at-dropdown-menu__submenu-title,
  &__item {
    @include ellipsis();
    display: block;
    padding: $dropdown-item-padding;
    min-width: $dropdown-item-min-width;
    font-size: $dropdown-font-size;
    line-height: 1.5;
    transition: all .3s;
    cursor: pointer;

    &:hover {
      background-color: $dropdown-item-bg-color-hover;
    }
    &--disabled {
      color: $dropdown-item-bg-color-disabled;
      cursor: $cursor-disabled;

      &:hover {
        background-color: $dropdown-bg-color;
      }
    }
    &--divided {
      position: relative;
      margin-top: 6px;
      border-top: 1px solid $dropdown-divided-color;

      &:before {
        content: '';
        display: block;
        height: 6px;
      }
    }
  }
}

.cdk-overlay-container {
  pointer-events: none;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  position: fixed;
  z-index: 1000;
}

.cdk-overlay-backdrop {
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .4s cubic-bezier(.25, .8, .25, 1);
  opacity: 0;
  position: absolute;
  pointer-events: auto;
  z-index: 1000;
}

.cdk-overlay-pane {
  position: absolute;
  pointer-events: auto;
  z-index: 1000; // Give an opportunity to the content own to manage their z-index such as Modal
}

.select-host-overlay {
  .cdk-overlay-pane {
    z-index: 2000 !important;
  }
}

.cdk-overlay-connected-position-bounding-box {
  position: absolute;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  min-width: 1px;
  min-height: 1px;
}

