// General Properties

$_padding: 8px 10px;
$_textColor: $grayDark;
$_ActiveColor: lighten($grayLighter, 8%);
$_listBorder: 1px solid lighten($grayLighter, 8%);
$_listBackground: $white;

// Dropdown

.dd  {

  position:relative;
  display:inline-block;
  text-shadow: none;

  // Button

  .dd-btn {
    @include padding-right($rtl, 5px);
    > .vicon {
      font-size: 10px;
      @include margin($rtl, 0, 8px, 0, 11px);
      line-height: 1;
      vertical-align: middle;
    }

    &.btn-append {
      @include border-left-color($rtl, rgba(255,255,255,.4));
    }
  }

  // Menu

  .dd-menu {
    overflow: hidden;
    background: $white;
    box-shadow: 0px 1px 1px rgba(0,0,0,0.2);
    border-radius: 4px;
    outline: medium none;
    @include left($rtl, 0);
    top: 100%;
    margin-top: 5px;
    position: absolute;
    width: auto;
    min-width: 100% !important;
    z-index: 10;

    max-height: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    will-change: opacity;


    // Menu item

    .dd-item {
      border-top: $_listBorder;
      padding: 0;
      list-style: none;

      &:first-child {
        border: 0;
      }

      // Menu link
      a, .label {
        white-space: nowrap;
        padding: $_padding;
        color: $_textColor;
      }

      a {
        display: block;
        text-decoration: none;

        &.dd-btn {
          padding-right: 24px;
        }
      }

      &.active a, a:hover {
        background-color: $_ActiveColor;
      }

      .label {
        display: inline-block;
        font-weight: bold;
      }
    }

  }

  // State

  &.open {
    .dd-menu {
      opacity: 1;
      max-height: 400px;
    }
  }

   // Position

  &.pull-right {
    .dd-menu {
      @include left($rtl, auto);
      @include right($rtl, 0);
    }
  }

  &.pull-top {
    .dd-menu {
      margin-bottom: 5px;
      top: auto;
      bottom: 100%;
    }
  }

}

// When the dropdown is appended to an input field
.core-form .input-append .dd .active.btn-default {
  border-color: $buttonDefaultBorderColor;
}
