dropdown-buttons {
  display: inline-block;
  position: relative;

  &.right {
    options {
      left: auto;
      right: 2px;
      transform-origin: right;
    }
  }

  &.bottom {
    open::before {
      transform: rotate(180deg);
    }
    options {
      border-bottom-left-radius: 0px;
      border-bottom-right-radius: 0px;
      border-top-left-radius: 3px;
      border-top-right-radius: 3px;
      top: auto;
      bottom: 48px;
      box-shadow: none;
    }
  }

  open {
    background: #ddd;
    height: 38px;
    line-height: 38px;
    display: inline-block;
    padding-left: 15px;
    padding-right: 25px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
    color: #555;
    transition: background 250ms ease;
    font-size: 14px;
    font-weight: 500;
    border-radius: 2px;
    margin-right: 2px;
    margin-left: 2px;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
    &::before {
      width: 0;
      height: 0;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-top: 6px solid #666;
      content: " ";
      position: absolute;
      right: 6px;
      top: 50%;
      margin-top: -1px;
      top: 18px;
    }
    &:hover {
      background: $accent;
      color: #fff;
    }
  }
  options {
    z-index: 1000;
    top: 38px;
    left: 2px;
    opacity: 0;
    pointer-events: none;
    transform: scaleX(0);
    transition: all 300ms ease;
    display: block;
    position: absolute;
    transform-origin: left;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    overflow: hidden;
    bt {
      display: block;
      background: $primary;
      color: #fff;
      white-space: nowrap;
      padding: 7px;
      padding-left: 20px;
      padding-right: 20px;
      border-top: 1px solid #aaa;
      cursor: pointer;
      transition: background 300ms ease;
      &:hover {
        background: $accent;
      }
    }
  }

  &.opened {
    open {
      color: #fff;
      background: $accent;
    }
    options {
      opacity: 1;
      pointer-events: all;
      transform: scaleX(1);
    }
  }
}
