@import "mixins";
@import "variables";

.toggle--refine-search {
    width: 100%;
    padding: 10px 15px;
    background-color: #fbfbfb;
    border: 1px solid $details-body-color;
    border-radius: 6px;
    font-weight: bold;
    color: $details-body-color;
    display: block;
    text-align: center;
    position: relative;

    &:after,
    &:before {
        content: "";
        position: absolute;
    }

    &:before {
        border-style: solid;
        border-width: 1px 1px 0 0;
        height: 6px;
        width: 6px;
        right: 15px;
        top: 50%;
        margin-top: -6px;
        @include prefix(transform, rotate(135deg), ms moz webkit);
    }

    &:focus,
    &:hover {
        text-decoration: none;
        color: $details-body-color;
    }

    &.collapsed {
        border-width: 1px 1px 0 1px;
        border-color: $refine-search-xs-border-color;
        border-radius: 6px 6px 0 0;
        background: #fff;
    }

    &:not(.collapsed) {
        &:focus,
        &:active:focus,
        &:hover {
            border: 1px solid $refine-search-xs-border-color;

            @include prefix(box-shadow, 0 2px 14px 0 rgba(0, 0, 0, 0.08), webkit ms moz);
        }
    }
}

.loading {
    &:after {
        content: "";
        position: fixed;
        z-index: 10;
        -webkit-animation: loading-animation 0.9s linear infinite;
        animation: loading-animation 0.9s linear infinite;
        background: url("../images/preloader.svg") no-repeat center;
        top: 50%;
        left: 50%;
        margin-top: -48px;
        margin-left: -16px;
        width: 32px;
        height: 32px;
    }

    &:before {
        content: "";
        width: 100%;
        height: 100%;
        position: fixed;
        background: #fff;
        opacity: 0.6;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 5;
    }
}

.refine-search {
    margin-bottom: 25px;

    @media all and (min-width: 767px) {
        position: relative;
        top: -60px;
    }

    .quick-search__inner-pages .quick-search {
        @media all and (max-width: 480px) {
            padding: 0;
        }
    }

    .quick-search__wrapper {
        @media all and (max-width: 480px) {
            margin-top: 0;
            margin-bottom: 25px;
            border: none;
            padding: 10px 0;
            border-radius: 0;
            @include prefix(box-shadow, none, moz ms o webkit);
        }
    }

    &__wrapper {
        min-height: 100px;
        padding-top: 10px;

        @media all and (max-width: 767px) {
            display: none;
            background: #fff;
            padding: 10px 15px 0;
            border-right: 1px solid $refine-search-xs-border-color;
            border-left: 1px solid $refine-search-xs-border-color;
            border-bottom: 1px solid $refine-search-xs-border-color;
            border-bottom-left-radius: 6px;
            border-bottom-right-radius: 6px;
        }

        &.loading {
            &:before,
            &:after {
                top: 0;
                bottom: 0;
                right: 0;
                left: 0;
                position: absolute;
            }

            &:after {
                margin: auto;
            }

            &:before {
                display: block;
                @media all and (min-width: 767px) {
                    background: $container-bg;
                    opacity: 1;
                }
            }
        }
    }

    h3:first-child {
        margin-top: 0;
    }

    &__block {
        margin-bottom: 25px;
    }

    .dropdown-toggle {
        position: relative;
        display: block;

        &:after {
            content: '';
            display: inline-block;
            border-style: solid;
            border-width: 1px 1px 0 0;
            height: 6px;
            width: 6px;
            position: relative;
            top: -3px;
            left: 8px;
            @include prefix(transform, rotate(135deg), moz ms webkit);
        }

        &:focus {
            color: $refine-search-hover;
            text-decoration: none;
        }
    }

    .dropdown-menu {
        left: 25px;
    }

    .current-search {
        margin-bottom: 30px;
        padding-left: 25px;

        &__title {
            color: $refine-search-collapsed;
            font-size: $font-size-large;
            font-weight: 500;
            line-height: 40px;
            text-decoration: none;
        }
    }

    .badge {
        height: 22px;
        border-radius: 100px;
        padding: 6px 22px 6px 12px;
        margin-bottom: 5px;
        position: relative;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
        max-width: 90%;

        &:after {
            display: inline-block;
            content: "";
            background: url("../images/icon-close-white.svg") no-repeat 0 0;
            width: 9px;
            height: 9px;
            position: absolute;
            right: 7px;
            top: 7px;
        }
    }

    .btn__refine-search {
        display: block;
        font-size: $font-size-large;
        font-weight: 500;
        margin-bottom: 10px;
        text-decoration: none;

        @include transition(color 0.2s ease-in-out);

        &:before {
            content: "";
            display: inline-block;
            width: 0;
            height: 0;
            border-style: solid;
            margin-right: 8px;
            position: relative;
            left: 3px;
            top: 1px;
            min-width: 12px;
        }

        &__radius {
            &:before {
                visibility: hidden;
            }
        }
    }

    .btn__refine-search[aria-expanded="true"] {
        &:before {
            top: -1px;
            left: 0;
        }
    }

    &__item {
        display: block;
        line-height: 40px;
        margin-left: 25px;

        @include transition(color 0.2s ease-in-out);

        &:hover {
            text-decoration: none;
        }
    }

    &__item-radius {
        &.active {
            color: $refine-search-hover;
            text-decoration: none;
        }
    }

    &__value {
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
        max-width: 75%;
    }

    &__count {
        color: $link-color;
        line-height: 40px;
        position: relative;
        left: -3px;
    }
}

.less-more {
    &__btn {
        display: block;
        text-align: left;
        padding-right: 25px;
        position: relative;
        line-height: 40px;
        margin-left: 25px;
        font-weight: 500;
        @include transition(all 0.2s ease-in);

        &:focus,
        &:hover {
            text-decoration: none;
        }

        &:after {
            content: "";
            display: inline-block;
            border-style: solid;
            border-width: 1px 1px 0 0;
            height: 6px;
            width: 6px;
            position: relative;
            top: -3px;
            margin-left: 5px;
            @include prefix(transform, rotate(135deg), moz webkit ms);
        }

        &.collapse {

            &:after {
                top: 0;
                @include prefix(transform, rotate(-45deg), moz webkit ms);
            }
        }
    }
}


