.main-header {
    background: #FFF;
    z-index: 102;
    top: 0;
    //position: relative;
    @media (max-width: 992px) {
        margin-bottom: 20px;
    }

    .row > div {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        white-space: nowrap;
        -ms-flex-negative: 0;
        flex-shrink: 0;
    }

    &.sticky {
        position: fixed;
        top: 0;
        background: #FFF;
        width: 100%;
        left: 0;
        right: 0;
    }
}

.main-header {
    .contact-bar {
        background: #EFEFEF;
        padding: 4px 0;
        color: #3e3e3e;

        a:hover {
            color: $danger;
        }

        .contact-item {
            display: inline-flex;
            align-items: center;
            margin-right: 30px;
            line-height: 20px;

            a {
                color: #3e3e3e;
            }

            .icon {
                font-size: 15px;
                margin-right: 10px;
            }

            > div {
                position: relative;

                &:before {
                    content: '';
                    position: absolute;
                    left: 0;
                    top: 2px;
                    width: 2px;
                    height: 34px;
                    background: #d4d4d4;
                }

                * {
                    display: block;
                    padding-left: 10px;
                }
            }
        }

        .socials {
            float: right;
            @media (max-width: 576px) {
                display: none;
            }

            ul {
                display: inline-flex;
                align-items: center;

                li {
                    margin-left: 15px;

                    .mdi {
                        font-size: 22px;
                        position: relative;
                        top: 4px;
                    }
                }
            }
        }
    }
}

.main-header .header-row {
    padding: 12px 0;

    .site-name {
        display: none;
    }
}

.main-header {
    .search-form-wrapper {
        position: relative;
        width: 100%;
    }

    .search-form {
        position: relative;
        z-index: 101;

        &:before {
            font-family: IRANKala;
            content: "\E131\00FE0E";
            left: 8px;
            top: 9px;
            position: absolute;
            z-index: 101;
            color: #A1A3A8;
            font-size: 24px;
            width: 36px;
            height: 36px;
        }

        input[type=text] {
            background-color: #F0F0F1;
            border: none;
            padding-left: 40px;
            padding-right: 40px;
            z-index: 101;

            &.focused {
                background: #FFF;
            }
        }

        .reset {
            cursor: pointer;
            position: absolute;
            top: 10px;
            right: 106px;
            display: none;

            &:before {
                font-family: IRANKala;
                content: "\E0DA\00FE0E";
                z-index: 100;
                display: -webkit-box;
                display: -ms-flexbox;
                display: flex;
                -webkit-box-align: center;
                -ms-flex-align: center;
                align-items: center;
                color: #BCBCBC;
                font-size: 25px;
            }
        }

        .product-cat {
            position: absolute;
            right: 0;
            top: 7px;
            z-index: 52;
            background: transparent !important;
            border: none;
            width: 106px;
            height: 30px;
            border-radius: 0;
            border-left: 1px solid #D6DCE2;
            padding-left: 12px;
            padding-right: 12px;
        }
    }

    .search-results {
        display: none;
        position: absolute;
        width: 100%;
        background: #FFF;
        z-index: 100;
        border-radius: $border-radius;
        top: 0;
        padding: 59px 15px 15px;
        box-shadow: 0 3px 12px 0 rgba(0, 0, 0, .2);

        ul {
            list-style: none;
            padding: 0;
            margin: 0;
            max-height: 320px;
            overflow-y: auto;
            overflow-x: hidden;

            li {
                line-height: 3;

                img {
                    max-width: 32px;
                    height: auto;
                    border-radius: 50%;
                    margin-right: 10px;
                }

                .price {
                    margin: 0 7px;

                    .cover-outofstock {
                        height: auto;

                        span {
                            font-size: inherit;
                        }
                    }

                    del, .discount-percent {
                        display: none;
                    }

                    .woocommerce-Price-currencySymbol {
                        color: #ACACAC;
                    }
                }

                .price, .price ins {
                    text-align: inherit;
                    font-weight: normal;
                    color: #ACACAC;
                    font-size: inherit;
                    display: inline-block;
                    height: auto;
                }
            }
        }
    }
}

.main-header {
    .header-action {
        text-align: right;
        width: 100%;
    }

    .header-btn {
        padding: 0 12px;
        display: inline-block;
        position: relative;

        .login-btn {
            padding: 10px 12px;
            border-radius: 5px;
            border: 1px solid #E0E0E2;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-align: center;
            -ms-flex-align: center;
            align-items: center;
            white-space: nowrap;
            -ms-flex-negative: 0;
            flex-shrink: 0;
            cursor: pointer;
            color: #616161;
            line-height: 1.833;

            &:before {
                font-family: IRANKala;
                content: "\E188\00FE0E";
                margin-right: 8px;
                font-size: 24px;
                line-height: 23px;
            }
        }

        .dropdown-toggle {
            border-radius: 5px;

            &:before {
                font-family: IRANKala;
                content: "\E188\00FE0E";
                font-size: 24px;
                margin-left: 4px;
                color: #424750;
            }

            &:after {
                font-family: IRANKala;
                content: "\E105\00FE0E";
                font-size: 18px;
            }

            &.show {
                background: rgba(239, 57, 78, .05);

                + .dropdown-menu {
                    display: block;
                    max-height: 460px;
                    overflow-y: auto;
                }
            }
        }

        .dropdown-menu {
            display: none;
            position: absolute;
            top: calc(100% + 2px);
            right: 0;
            width: 200px;
            -webkit-box-shadow: 0 3px 8px 0 rgba(0, 0, 0, .3);
            box-shadow: 0 3px 8px 0 rgba(0, 0, 0, .3);
            background: #FFF;
            border-radius: $border-radius;
            overflow: hidden;
            text-align: left;
            z-index: 999;

            .account-navigation {
                list-style: none;
                padding: 0;
                margin: 0;

                .woocommerce-MyAccount-navigation-link {
                    padding: 0 7px;

                    &:before {
                        margin-top: 6px;
                    }

                    a {
                        position: relative;
                        padding: 8px 12px;
                        display: block;
                        line-height: 24px;
                    }
                }

                li:not(:last-child):not(.first-item) a {
                    border-bottom: 1px solid #F0F0F1;
                }

                .first-item {
                    padding: 8px;
                    border-bottom: 1px solid #F0F0F1;

                    &:hover {
                        background: #F0F0F1;
                    }
                }

                .user-info {
                    float: left;
                    line-height: 22px;
                }

                .avatar {
                    float: left;
                    margin-right: 7px;
                    border: 1px solid $font-color;
                    border-radius: 50%;
                }

                .user-name {
                    font-weight: bold;
                }

                .profile-link {
                    padding: 0;
                    font-size: 11px;
                    color: $primary;
                    position: relative;

                    &:after {
                        content: '\203A';
                        position: absolute;
                        right: -17px;
                        font-size: 18px;
                        top: -2px;
                    }
                }

                .woocommerce-MyAccount-navigation-link--customer-logout:before {
                    color: $danger;
                }

                .dokan-item.logout .fa {
                    color: $danger;
                }
            }
        }
    }

    .mini-cart {
        position: relative;
        padding-left: 12px;
        display: inline-block;

        &:before {
            content: "";
            display: block;
            height: 24px;
            background: #E0E0E2;
            position: absolute;
            left: 0;
            width: 1px;
            top: 50%;
            -webkit-transform: translateY(-50%);
            transform: translateY(-50%);
        }

        #cart-button {
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-align: center;
            -ms-flex-align: center;
            align-items: center;
            -webkit-box-pack: center;
            -ms-flex-pack: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            position: relative;
            border-radius: $border-radius;

            &:before {
                font-family: IRANKala;
                content: "\E0CC\00FE0E";
                font-size: 24px;
                color: #424750;
            }

            .cart-counter {
                font-size: 10px;
                line-height: 15px;
                color: #FFF;
                width: 20px;
                height: 18px;
                background: $danger;
                text-align: center;
                vertical-align: middle;
                border-radius: 5px;
                font-weight: 900;
                border: 2px solid #FFF;
                position: absolute;
                bottom: 6px;
                left: 2px;
            }
        }

        &:hover {
            #cart-button {
                background: rgba(239, 57, 78, .05);
            }

            .mini-cart-content {
                display: block;
            }
        }
    }
}

.mini-cart-content, .widget_shopping_cart_content {
    position: absolute;
    right: 0;
    top: calc(100% - 3px);
    width: 300px;
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #FFF;
    border-radius: $border-radius;
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, .2);
    z-index: 110;
    display: none;

    .mini-cart-header {
        padding: 10px;
        border-bottom: 1px solid #E8ECED;
        text-align: left;

        .count {
            color: #81858B;
        }

        .cart {
            float: right;
            color: $primary;
            position: relative;
            margin-right: 10px;

            &:after {
                content: '\203A';
                position: absolute;
                right: -10px;
                top: -1px;
                font-size: 18px;
            }
        }
    }

    .woocommerce-mini-cart {
        font-size: 90%;

        .mini_cart_item, .cart_item {
            text-align: left;
            padding: 10px;
            border-bottom: 1px solid #E8ECED;

            a {
                word-break: break-word;
                white-space: normal;
            }

            img {
                max-width: 42px;
                height: auto;
                margin-right: 10px;
                float: left;
            }

            .product-name {
                font-weight: bold;
                font-size: 90%;
                color: #000;
                line-height: 20px;
                display: block;
            }

            .variation {
                margin-bottom: 0;

                dt, dd {
                    display: inline-block;
                }
            }

            .quantity {
                color: #A1A3A8;
            }

            .remove {
                font-size: 17px;
                color: #A1A3A8;
                float: right;
                position: relative;
                top: 3px;
                font-weight: normal;

                &:before {
                    font-family: IRANKala;
                    content: "\E1D3\00FE0E";
                }

                &:hover {
                    background: transparent;
                    color: $danger !important;
                }
            }
        }
    }

    .mini-cart-footer {
        padding: 10px;
    }

    .total {
        text-align: left;
        font-size: 85%;
        float: left;

        strong {
            font-weight: normal;
            display: block;
            line-height: 14px;
        }

        .amount {
            font-size: 18px;
            font-weight: bold;

            .woocommerce-Price-currencySymbol {
                font-weight: normal;
                font-size: $font-size * 0.85;
            }
        }
    }

    .buttons {
        float: right;

        .button {
            margin: 0 5px;
            padding-right: 25px;
            padding-left: 25px;
        }

        .button:not(.checkout) {
            display: none;
        }
    }

    .woocommerce-mini-cart__empty-message {
        text-align: center;
        padding: 10px;
    }
}

.widget_shopping_cart_content {
    position: static;
    max-height: unset;
    box-shadow: none;
}

@media (max-width: 992px) {
    .main-header {
        background-color: #F9F9F9;
        border-bottom: 1px solid #E5E5EA;

        .contact-bar {
            padding: 2px 0;

            .contact-item {
                font-size: 12px;
                line-height: 18px;

                > div:before {
                    height: 31px;
                }
            }
        }

        .col-lg-2 {
            border-bottom: 1px solid #E5E5EA;
            padding-bottom: 12px;
            margin-bottom: 12px;
        }

        .col-lg-6 {
            width: calc(100% - 120px);
            float: left;
            padding-right: 0;
        }

        .col-lg-4 {
            width: 120px;
            float: right;
            padding-left: 0;
        }

        #cat-toggle {
            width: 31px;
            height: 3px;
            background-color: #929292;
            position: relative;

            &:before {
                content: '';
                position: absolute;
                width: 31px;
                height: 3px;
                background-color: #929292;
                top: -8px;
            }

            &:after {
                content: '';
                position: absolute;
                width: 31px;
                height: 3px;
                background-color: #929292;
                bottom: -8px;
            }
        }

        .header-logo {
            margin: auto;
        }

        .faqs {
            &:before {
                font-family: IRANKala;
                content: "\E18C\00FE0E";
                font-size: 30px;
                color: #929292;
                position: relative;
                top: 5px;
            }
        }

        .search-form {
            input[type=search] {
                border: 1px solid #979797;
                background: #FFF;
                border-radius: 8px;
            }
        }

        .header-action {
            a {
                color: #929292;
            }
        }

        .header-btn {
            .login-btn {
                width: 24px;
                overflow: hidden;
                padding: 0;
                border: none;
                height: 28px;
            }

            .dropdown-toggle {
                position: relative;

                &:after {
                    display: none;
                }

                .checked {
                    position: absolute;
                    background: #64D979;
                    width: 15px;
                    height: 15px;
                    border-radius: 50%;
                    right: -4px;
                    top: 11px;

                    &:after {
                        position: absolute;
                        font-family: IRANKala;
                        content: '\E0D4\00FE0E';
                        color: #FFF;
                        font-size: 8px;
                        right: 3px;
                        top: -7px;
                    }
                }
            }
        }

        .mini-cart {
            padding-left: 0;

            &:before {
                display: none;
            }

            #cart-button {
                &:before {
                    top: 2px;
                    position: relative;
                    color: #929292;
                }

                .cart-counter {
                    height: 20px;
                    background: $primary;
                    border-radius: 50%;
                    top: -3px;
                    left: 10px;
                }
            }

            .mini-cart-content {
                display: none !important;
            }
        }

        &.focus-search {
            .col-lg-6 {
                width: 100%;
                float: none;
                padding-right: 5px;
            }

            .col-lg-4 {
                display: none;
            }
        }
    }
}

@media (min-width: 992px) {
    #wpadminbar + #primary .main-header,
    #wpadminbar + .overlay + .main-header,
    #wpadminbar + .overlay + .top-ads + .main-header {
        top: 32px;
    }
}