/*
Drop downs

Default styling for drop downs

Markup:
<div style="position: relative;width:200px;">
    <div class="dropdown__control">
        Cash
    </div>
    <div class="dropdown__menu-container">
        <ul class="dropdown__menu" role="menu">
            <li class="dropdown__menu-item" role="menuitem">Cash</li>
            <li class="dropdown__menu-item" role="menuitem">Check</li>
            <li class="dropdown__menu-item" role="menuitem">Money order</li>
        </ul>
    </div>
    <div class="dropdown__arrow"></div>
</div>

Name: dropdown

Styleguide 3.4
*/

@dropdown-border-color-active: @theme-green1;

.dropdown__control {
    height: 40px;
    padding: 11px 30px 11px 20px;
    user-select: none;
    cursor: pointer;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    background-color: #FFFFFF;
    color: @color-input;
    font-weight: normal;
    box-sizing: border-box;
    border: 1px solid @color-border-input;
    border-radius: @border-radius-default;

    &:hover {
        text-decoration: none;
        border-color: @color-border-input-hover;
    }

    &:active,
    &:focus {
        text-decoration: none;
        outline: none;
        color: @color-input;
        border-color: @dropdown-border-color-active;
    }
}

.dropdown__control--no-selection {
    color: @color-placeholder-text;
}

.dropdown__control--disabled {
    cursor: not-allowed;
    color: @disabled-font-color;

    &:hover,
    &:active {
        border-color: @color-border-input;
        box-shadow: none;
    }
}

.dropdown__control--has-error {
    border-color: @color-error;

    &:hover,
    &:focus {
        border-color: @color-error;
    }
}

.dropdown__control--reduced-padding {
    padding: 7px 30px 7px 20px;
}

.dropdown__arrow {
    position: absolute;
    right: 15px;
    top: 44%;
    width: 10px;
    height: 5px;
    padding: 0 !important;
    pointer-events: none;
    cursor: pointer;
    .svgicon--icons-chevron-down-grey;
}

.dropdown__arrow--open {
    transform: rotate(180deg);
}

.dropdown__menu-container {
    position: absolute;
    top: 45px;
    width: 100%;
    display: inline-table;
    padding: 10px 0;
    background-color: #FFFFFF;
    z-index: @z-index-popover;
    border: 1px solid @color-border-input;
    border-radius: @border-radius-default;
    box-shadow: @combobox-menu-box-shadow;
}

.dropdown__menu-container--multi-select {
    top: 112%;
    padding: 15px 0;
}

.dropdown__menu-container--hidden {
    display: none;
}

.dropdown__menu {
    max-height: 186px;
    overflow-y: auto;
    overflow-x: hidden;
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown__menu-item {
    padding: @dropdown-item-padding;
    line-height: @dropdown-item-line-height;
    cursor: pointer;
    color: @color-input;
    font-weight: normal;
    list-style: none;

    &:hover {
        background-color: @color-popover-link-bg;
    }
}

.dropdown__menu-item--placeholder {
    color: @color-placeholder-text;
}

.dropdown__menu-item--selected {
    background-color: @color-popover-link-bg;
}

.dropdown__menu-item--category {
    background-color: #FFFFFF;

    &:hover {
        cursor: default;
        background-color: #FFFFFF;
    }
}

.dropdown__menu-item--new-section {
    border-top: 1px solid @color-border-input;
}

.dropdown__menu-item-link {
    color: @color-input;
    text-decoration: none;
}

.dropdown__category-label {
    display: block;
    font-size: @font-size--13;
    .text-bold;
}

// This class is only used on the aspx versions of dropdown
.dropdown__presenter {
    width: @legacy-width-size2;
}

.dropdown__presenter--md {
    width: 120px;
}

.dropdown__presenter--size3 {
    width: 315px;
}

.dropdown__presenter--country {
    width: 427.5px;
}

.dropdown__presenter--full-width {
    width: 100%;
}

// This class is only used on the aspx versions of dropdown
.dropdown__wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: 15px;
    vertical-align: bottom;

    // Need to do this so we don't have to hack form validation
    &.error {
        .dropdown__control {
            .dropdown__control--has-error;
        }
    }
}

.dropdown__control--no-border {
    border: 0 !important;
    box-shadow: none !important;
}

.dropdown__control--no-left-padding {
    padding-left: 0;
}
