// /**
//  * Copyright © Magento, Inc. All rights reserved.
//  * See COPYING.txt for license details.
//  */

//
//  Variables
//  _____________________________________________

@autocomplete__background-color: @color-white;
@autocomplete__border: 1px solid @form-element-input__border-color;
@autocomplete-item__border: 1px solid @color-gray90;
@autocomplete-item__hover__color: @color-gray91;
@autocomplete-item-amount__color: @color-gray60;

//
//  Common
//  _____________________________________________

& when (@media-common = true) {
    .search-autocomplete {
        margin-top: 0;
    }
    .block-search {
        margin-bottom: 0;   
        position: relative;
        z-index: 4;
        .block {
            &-title {
                display: none;
            }
        }

        .block-content {
            margin-bottom: 0;
        }

        .label {
            display: none;
        }
        .action.search {
            display: inline-block;
            .lib-button-icon(
            @_icon-font-content: @icon-search,
            @_icon-font-text-hide: true,
            @_icon-font-color: @header-icons-color
            );
            .lib-button-reset();
            padding: @indent__xs 0;
            position: absolute;
            right: 10px;
            top: 0;
            z-index: 1;

            &:focus {
                &:before {
                    .lib-css(color, @color-gray20);
                }
            }
        }
        input {
            .lib-input-placeholder(@form-element-input-placeholder__color);
            margin: 0;
        }

            .nested {
                display: none;
            }
    }

    .search-autocomplete {
        &:extend(.abs-add-box-sizing all);
        display: none;
        margin-top: -15px;
        overflow: hidden;
        position: absolute;
        z-index: 3;

        ul {
            .lib-list-reset-styles();

            li {
                .lib-css(border-top, @autocomplete-item__border);
                cursor: pointer;
                margin: 0;
                padding: @indent__xs @indent__xl @indent__xs @indent__s;
                position: relative;
                text-align: left;
                white-space: normal;

                &:not(:empty) {
                    border-top: 0;
                    .lib-css(border, @autocomplete__border);
                    .lib-css(background, @autocomplete__background-color);
                }

                &:first-child {
                    border-top: none;
                }

                &:hover,
                &.selected {
                    .lib-css(background, @autocomplete-item__hover__color);
                }

                .amount {
                    .lib-css(color, @autocomplete-item-amount__color);
                    position: absolute;
                    right: 7px;
                    top: @indent__xs;
                }
            }
        }
    }

    .form.search.advanced {
        .fields.range {
            .field {
                &:first-child {
                    position: relative;

                    .control {
                        padding-right: 25px;

                        &:after {
                            content: ' \2013 ';
                            display: inline-block;
                            position: absolute;
                            right: 0;
                            text-align: center;
                            top: 6px;
                            width: 25px;
                        }
                    }
                }

                &:last-child {
                    position: relative;

                    div.mage-error[generated] {
                        left: 0;
                        position: absolute;
                        top: 32px;
                    }
                }

                &.with-addon {
                    .control {
                        padding-right: 45px;
                    }
                }
            }
        }

        .group.price {
            .addon {
                .addafter {
                    background: none;
                    border: 0;
                    padding-top: 6px;
                    position: absolute;
                    right: 0;
                    top: 0;
                }
            }
        }
    }

    .search.summary {
        margin-bottom: @indent__s;
    }
}
