// /**
//  * 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) {
    .block-search {
        margin-bottom: 0;

        .block {
            &-title {
                display: none;
            }
        }

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

        .label {
            &:extend(.abs-visually-hidden all);
        }

        .nested {
            display: none;
        }
        input {
            .lib-input-placeholder(@form-element-input-placeholder__color);
        }
        .action.search {
            display: inline-block;
            padding: 0;
            margin: 0;
            width:38px;
            height:38px;
            background:@header_search-button--bg;
            box-shadow:none;
            border:none;
            border-radius: 0;
            position: absolute;
            right: 0;
            top: 0;
            z-index: 1;
            span{
                display: none;
            }
            &:hover{
                &:after{
                    background:@header_search-button--bg-hover;
                }
                svg{
                    fill:#ffffff;
                }
            }
        }
    }

    .search-autocomplete {
        &:extend(.abs-add-box-sizing all);
        display: none;
        margin-top: 0;
        overflow: hidden;
        position: absolute;
        z-index: 3;
        box-shadow: 0px 4px 19px -2px rgba(0,0,0, 0.1);
        ul {
            .lib-list-reset-styles();
            li {
                .lib-css(border-top, @autocomplete-item__border);
                cursor: pointer;
                margin: 0;
                color:#333333;
                padding: 10px 40px 10px 10px;
                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 {
                        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;
    }
}

//
//  Mobile
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
    .block-search {
        .block-content {
            margin-bottom: 0;
        }
    }
}

//
//  Desktop
//  _____________________________________________
.block-search--type-panel .block-content{
	display: none;
}
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .block-search--type-panel{
        .ox-overlay-close-btn,
        .flashing-cursor,
        .action-search-slideout{
            display: none!important;
        }
		.block-content{
			display: block;
		}
    }
    .block-search {
        position: relative;
        z-index: 4;
        .control {
            border-top: 0;
            margin: 0;
            padding: 0 0 25px;
        }
        .nested {
            display: block;
            padding-top: 5px;
            position: absolute;
        }
    }

    .search-autocomplete {
        margin-top: 0;
    }
}
