// Transition
@mixin transition($args) {
    -webkit-transition: $args;
    -moz-transition: $args;
    -ms-transition: $args;
    -o-transition: $args;
    transition: $args;
}

/*------------------------------------------------------------------
Search
-------------------------------------------------------------------*/
.etww-search-wrap {
    position: relative;

    .search-submit {
        color: #333;

        &:focus,
        &:hover {
            color: #333;
        }
    }

    .etww-ajax-loading {
        display: none;
        background: transparent url('../../img/loader.svg') no-repeat center center;
        background-size: 100%;
        position: absolute;
        top: 50%;
        right: 60px;
        margin-top: -8px;
        width: 16px;
        height: 16px;
    }

    .etww-search-results {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff;
        -webkit-box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        -moz-box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        z-index: 999;
        overflow: hidden;

        ul {
            list-style: none;
            padding: 0;
            margin: 0;

            li {
                a.search-result-link {
                    display: -webkit-flex;
                    display: -ms-flexbox;
                    display: flex;
                    -webkit-align-items: center;
                    -ms-flex-align: center;
                    align-items: center;
                }

                a {
                    position: relative;
                    font-size: 14px;
                    line-height: 1;
                    padding: 10px 34px 10px 13px;
                    border-bottom: 1px solid #eaeaea;
                    letter-spacing: 0.6px;

                    img {
                        float: left;
                        max-width: 30px;
                        margin-right: 10px;
                    }

                    .result-title {
                        display: block;
                        line-height: 1.3;
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }

                    i.icon {
                        position: absolute;
                        top: 50%;
                        right: 13px;
                        margin-top: -6px;
                        font-size: 12px;
                        color: #aaa;
                        @include transition(all 0.3s ease);
                    }

                    &:hover i.icon {
                        color: #666;
                    }

                    &.all-results {
                        display: block;
                        font-size: 12px;
                        font-weight: 600;
                        letter-spacing: 0.6px;
                        text-align: center;

                        span {
                            display: inline-block;
                            padding-bottom: 3px;
                            border-bottom: 1px solid;

                            i {
                                padding-left: 5px;
                            }
                        }
                    }
                }

                a.search-result-link:hover {
                    background-color: #f8f8f8;
                    color: #555;
                }

                &:last-child a {
                    border-bottom: 0;
                }
            }
        }
    }

    .etww-no-search-results {
        position: relative;
        font-size: 14px;
        line-height: 1;
        padding: 18px 18px;

        h6 {
            margin: 0 0 10px;
        }

        p {
            margin: 0;
        }
    }
}

form.etww-searchform {
    width: 100%;
    height: auto;

    &,
    input.field {
        min-height: 40px;
    }

    input.field:focus {
        -webkit-box-shadow: 0 0 8px 1px rgba(0, 0, 0, .1);
        -moz-box-shadow: 0 0 8px 1px rgba(0, 0, 0, .1);
        box-shadow: 0 0 8px 1px rgba(0, 0, 0, .1);
    }
}

.etww-align-left .etww-search-wrap {
    margin: 0 auto 0 0;
}

.etww-align-center .etww-search-wrap {
    margin: 0 auto;
}

.etww-align-right .etww-search-wrap {
    margin: 0 0 0 auto;
}

@media (max-width: 1024px) {
    .etww-tablet-align-left .etww-search-wrap {
        margin: 0 auto 0 0;
    }

    .etww-tablet-align-center .etww-search-wrap {
        margin: 0 auto;
    }

    .etww-tablet-align-right .etww-search-wrap {
        margin: 0 0 0 auto;
    }
}

@media (max-width: 767px) {
    .etww-mobile-align-left .etww-search-wrap {
        margin: 0 auto 0 0;
    }

    .etww-mobile-align-center .etww-search-wrap {
        margin: 0 auto;
    }

    .etww-mobile-align-right .etww-search-wrap {
        margin: 0 0 0 auto;
    }
}

/* RTL */
body.rtl {
    .etww-search-wrap {
        .etww-ajax-loading {
            left: 60px;
            right: auto;
        }

        .etww-search-results {
            right: 0;
            left: auto;
        }

        .etww-search-results ul li a {
            padding-left: 34px;
            padding-right: 13px;

            .result-thumb {
                margin-left: 10px;
                margin-right: 0;
            }

            i.icon {
                left: 13px;
                right: auto;
            }

            &.all-results span i {
                padding-right: 5px;
                padding-left: 0;
            }
        }

        form.etww-searchform button {
            left: 0;
            right: auto;
        }
    }
}

