@import '../../style/var';

.hl-dropdown-menu {
  user-select: none;

  &__bar {
    position: relative;
    display: flex;
    height: 36px;
    background-color: $dropdown-menu-background-color;
    &--opened {
      z-index: $dropdown-item-z-index + 1;
    }
  }

  &__item {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-width: 0; // hack for flex ellipsis
    cursor: pointer;

    &:active {
      opacity: $active-opacity;
    }

    &--disabled {
      &:active {
        opacity: 1;
      }

      .hl-dropdown-menu__title {
        color: $dropdown-menu-title-disabled-text-color;
      }
    }
  }

  &__title {
    position: relative;
    box-sizing: border-box;
    padding: $dropdown-menu-title-padding;
    color: $dropdown-menu-title-text-color;
    font-size: $dropdown-menu-title-font-size;
    line-height: $dropdown-menu-title-line-height;
    max-width: 84%;
    &::after {
      position: absolute;
      top: 50%;
      right: -4px;
      margin-top: -5px;
      border-radius: 1px;
      border-style: solid;
      border-width: 3px;
      border-color: transparent transparent #c3c3c3 #c3c3c3;
      transform: rotate(-45deg);
      content: '';
    }

    &--active {
      color: $dropdown-menu-title-active-text-color;
      &::after {
        border-color: transparent transparent #18f #18f;
      }
    }
    &--down {
      &::after {
        margin-top: -1px;
        transform: rotate(135deg);
      }
    }
  }

  .arrow {
    max-width: 84%;
    &::after {
      position: absolute;
      display: inline-block;
      content: '';
      height: 5px;
      width: 5px;
      border-width: 0 1px 1px 0;
      border-color: #c7c7cc;
      border-style: solid;
      transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
      top: 50%;
      right: -4px;
      margin-top: -5px;
      transform-origin: center;
      transition: transform 0.3s;
    }

    &.hl-dropdown-menu__title--active {
      color: $dropdown-menu-title-active-text-color;
      &::after {
        border-color: $dropdown-menu-title-active-text-color;
        content: '';
      }
    }

    &.hl-dropdown-menu__title--down {
      &::after {
        margin-top: -2px;
        border-width: 1px 0 0 1px;
        border-color: $dropdown-menu-title-active-text-color;
        content: '';
      }
    }
  }

  .filter {
    max-width: 70%;
    &::after {
      position: absolute;
      top: 18%;
      right: -10px;
      display: inline-block;
      content: ' ';
      height: 14px;
      width: 14px;
      background-image: url('https://hotel.rsscc.cn/imgData/newWxappHotel/hotelList/sx-icon@2x.png');
      background-position: 0 0;
      background-size: 100% 100%;
      border: none;
      transform: rotate(0deg);
      margin-top: 0;
    }
    &.hl-dropdown-menu__title--active {
      color: $dropdown-menu-title-active-text-color;
      &::after {
        border-color: transparent;
        content: '';
        background-image: url('https://hotel.rsscc.cn/imgData/newWxappHotel/hotelList/sx-icon-y@2x.png');
      }
    }

    &.hl-dropdown-menu__title--down {
      &::after {
        margin-top: 0;
        background-image: url('https://hotel.rsscc.cn/imgData/newWxappHotel/hotelList/sx-icon-y@2x.png');
      }
    }

    &.hl-dropdown-menu__title--count {
      display: flex;
      &::after {
        display: none;
      }
      .count {
        width: 15px;
        min-width: 15px;
        height: 15px;
        color: #fff;
        font-size: 10px;
        background: #18f;
        border-radius: 50%;
        text-align: center;
        line-height: 15px;
        margin-top: 3px;
        margin-left: 4px;
      }
    }
  }
}
