.bs-dropdown {
  --background: var(--bs-primary-color);
  --text: var(--bs-font-color);
  --icon: var(--bs-font-color);
  --radius: var(--bs-radius);
  --icon-active: var(--bs-dropdown-icon-active);
  --list: var(--bs-dropdpwn-list-bgc);
  --list-text: var(--bs-dropdpwn-list-text-color);
  --list-text-hover: var(--bs-dropdpwn-list-text-hover-color);
  display: inline-block;
  position: relative;
  z-index: 1;
  font-weight: 500;
  font-size: 14px;
  line-height: 25px;
  select,
  .button {
    margin: 0;
    border: 0;
    text-align: left;
    text-transform: none;
  }
  select {
    pointer-events: none;
    user-select: none;
    opacity: 0;
    padding: 0 36px 0 12px;
    visibility: hidden;
    font-weight: 500;
    height: 36.5px;
    line-height: 36.5px;
    font-size: 14px;
  }
  ul {
    margin: 0;
    padding: 0;
    list-style: none;
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    transform: translateY(var(--t));
    transition: opacity 0.3s ease,
      transform 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    li {
      padding: 0 36px 0 12px;
      height: 36.5px;
      line-height: 36.5px;
      cursor: pointer;
    }
  }
  & > ul {
    background: var(--list);
    color: var(--list-text);
    border-radius: var(--radius);
    li {
      transition: color 0.3s ease;
      &:hover {
        color: var(--list-text-hover);
      }
    }
  }
  .button {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    padding: 0;
    z-index: 1;
    width: 100%;
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    color: var(--text);
    background: var(--background);
    em {
      --r: 45deg;
      display: block;
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      width: 7px;
      &:before,
      &:after {
        --o: 0.4;
        content: "";
        width: 7px;
        height: 7px;
        opacity: var(--o);
        display: block;
        position: relative;
        transition: opacity var(--bs-ani-duration) ease;
        transform: rotate(var(--r)) scale(0.75);
      }
      &:before {
        border-left: 2px solid var(--icon);
        border-top: 2px solid var(--icon);
        top: 1px;
      }
      &:after {
        border-right: 2px solid var(--icon);
        border-bottom: 2px solid var(--icon);
        bottom: 1px;
      }
    }
  }
  &:not(.open) {
    & > ul {
      opacity: 0;
      pointer-events: none;
    }
  }
  &.open {
    &.tilt-up {
      animation: tilt-up 0.4s linear forwards;
      .button {
        em {
          &:before {
            --o: 1;
          }
        }
      }
    }
    &.tilt-down {
      animation: tilt-down 0.4s linear forwards;
      .button {
        em {
          &:after {
            --o: 1;
          }
        }
      }
    }
  }
}

@keyframes tilt-up {
  40%,
  60% {
    transform: perspective(500px) rotateX(8deg);
  }
}

@keyframes tilt-down {
  40%,
  60% {
    transform: perspective(500px) rotateX(-8deg);
  }
}
