/* ==========================================================================
   WooCommerce Widgets styles - begin
   ========================================================================== */

.widget.woocommerce {
    clear: both;

    &.widget_rating_filter,
    &.widget_shopping_cart,
    &.widget_layered_nav,
    &.widget_price_filter,
    &.widget_layered_nav_filters,
    &.widget_product_categories,
    &.widget_products,
    &.widget_product_search,
    &.widget_product_tag_cloud,
    &.widget_recently_viewed_products,
    &.widget_recent_reviews,
    &.widget_top_rated_products {
        margin: 0 0 20px;
    }

    &.widget_rating_filter,
    &.widget_shopping_cart,
    &.widget_layered_nav,
    &.widget_layered_nav_filters,
    &.widget_product_categories,
    &.widget_products,
    &.widget_recently_viewed_products,
    &.widget_recent_reviews,
    &.widget_top_rated_products {

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

            li {
                @include mkdfRelativeHolderLayout();
                padding: 0;
                margin: 0 0 20px;
                clear: both;

                &:last-child {
                    margin: 0;
                }

                ul {
                    margin: 14px 0 0 10px;
                }
            }
        }
    }

    &.widget_shopping_cart {

        .widget_shopping_cart_content {
            @include mkdfRelativeHolderLayout();

            ul {

                li {

                    img {
                        display: block;
                        max-width: 84px;
                        margin: 0 70% 13px 0;
                    }

                    .remove {
                        position: absolute;
                        top: 0;
                        right: 0;
                        font-size: 0;
                        line-height: 1;

                        &:after {
                            position: relative;
                            display: block;
                            padding: 0 3px;
                            font-family: 'Ionicons';
                            content: "\f404";
                            font-size: 30px;
                            line-height: 25px;
                        }
                    }
                }
            }

            .variation {
                @include mkdfRelativeHolderLayout();

                > * {
                    display: inline-block;
                    vertical-align: middle;
                    margin: 0;

                    p {
                        margin: 0;
                    }
                }
            }

            .total {
                margin: 17px 0 13px;
            }

            .buttons {
                margin: 10px 0 0;
            }
        }
    }

    &.widget_layered_nav {

        .mkdf-widget-title {
            margin: 0 0 17px;
        }

        ul {

            li {
                margin: 2px 0;

                &.chosen {

                    a {
                        color: $first-main-color;
                    }
                }
            }
        }
    }

    &.widget_layered_nav_filters {

        .mkdf-widget-title {
            margin: 0 0 17px;
        }
    }

    &.widget_product_categories {

        ul {

            li {
                margin: 2px 0 19px;

                ul {
                    margin: 0 0 0 10px;
                }
            }
        }
    }

    &.widget_products {
        .product_list_widget {
            margin-top: 26px;

            .product-title {
                @include mkdfTransition(color $quick-transition $theme-easing);
            }

            a:hover .product-title {
                color: $first-main-color;
            }
        }
    }

    &.widget_products,
    &.widget_recently_viewed_products,
    &.widget_recent_reviews,
    &.widget_top_rated_products {

        .mkdf-widget-title {
            margin: 0 0 29px;
        }

        ul {

            li {
                min-height: 65px;

                a {

                    img {
                        position: absolute;
                        top: 0;
                        left: 0;
                        width: 100%;
                        max-width: 65px;
                    }

                    span {
                        position: relative;
                        display: block;
                        padding: 0 0 0 87px;
                        line-height: 20px;
                        box-sizing: border-box;
                    }
                }

                > *:not(a) {
                    margin: 0 0 0 87px;
                    line-height: 23px;
                }

                .star-rating {
                    position: relative;

                    span {
                        max-width: 100px;
                    }
                }

                del,
                ins {
                    display: block;

                    span {
                        color: inherit;
                    }
                }

                ins {
                    text-decoration: none;
                }
            }
        }
    }

    &.widget_products,
    &.widget_recently_viewed_products,
    &.widget_top_rated_products {

        ul {

            li {

                .product-title {
                    margin-bottom: 3px;
                    font-size: 18px;
                    line-height: 1.667em;
                    font-weight: 700;
                    color: $default-heading-color;
                    font-family: $default-heading-font;
                    margin-top: 5px;
                }

                .star-rating {
                    display: none;
                }

                .amount {
                    color: $first-main-color;
                    font-size: 15px;
                }
            }
        }
    }

    &.widget_recently_viewed_products {

        ul {

            li {

                del,
                > .amount {
                    display: block;
                    margin-top: 10px;
                }
            }
        }
    }

    &.widget_recent_reviews {

        ul {

            li {

                .star-rating {
                    margin-top: 7px;
                    margin-bottom: 10px;
                }
            }
        }

        a {
            display: block;
            padding: 0 0 0 102px;
        }

        .reviewer {
            display: inline-block;
            vertical-align: middle;
            width: auto;
            clear: both;
        }
    }

    &.widget_top_rated_products {

        ul {

            li {

                .star-rating {
                    margin-top: 10px;
                    margin-bottom: 12px;
                }

                .amount {
                    display: block;
                }
            }
        }
    }

    &.widget_product_tag_cloud {

        .tagcloud {

            a {
                position: relative;
                display: inline-block;
                vertical-align: middle;
                font-family: inherit;
                background-color: transparent;
                font-size: 14px !important;

                &:after {
                    content: '/';
                    color: $default-text-color;
                    margin: 0 0 0 4px;
                }

                &:last-child {

                    &:after {
                        display: none;
                    }
                }
            }
        }
    }
}

.widget {

    // price filter - legacy and block common
    $slider-handle-size: 14px;
    $slider-rail-height: 3px;
    $slider-bottom-margin: 29px;

    @mixin mkdfWooSliderHandle() {
        background-image: none;
        border: none;
        border-radius: 100%;
        height: $slider-handle-size;
        position: relative;
        top: -#{($slider-handle-size - $slider-rail-height) / 2};
        width: $slider-handle-size;
        margin: 0 0 0 -1px;
        cursor: pointer;
        outline: medium none;
        background-color: #8b8b8b;

        &:hover {
            @include mkdfWooSliderHandleFocus();
        }
    }

    @mixin mkdfWooSliderHandleFocus() {
        transform: scale(1);
    }

    @mixin mkdfPriceFilterButtonStyle() {
        @include mkdfButtonDefaultStyle();
        @include mkdfButtonSolidColor();
        float: right;
        padding: 6px 28px !important;
        text-decoration: none;
        font-size: 11px !important;
        border-radius: 0;

        &:hover {
           @include mkdfButtonSolidHoverColor();
        }
    }
    
    &.widget_price_filter {

        .price_slider_wrapper {

            .ui-widget-content {
                position: relative;
                height: $slider-rail-height;
                background-color: #ebebeb;
                margin-top: 25px;

                .ui-slider-handle {
                    @include mkdfWooSliderHandle();
                    position: absolute;
                    z-index: 2;

                    &:last-child {
                        @include mkdfTransform(translateX(-50%));
                    }
                }

                .ui-slider-range {
                    position: absolute;
                    display: block;
                    height: 100%;
                    background-color: #8b8b8b;
                    z-index: 1;
                }
            }
        }

        .price_slider_amount {
            margin: 30px 0 0;

            .button {
                @include mkdfPriceFilterButtonStyle();
            }

            .price_label {
                float: left;
                color: #bababa;
                font-size: 15px;
                line-height: 38px;
            }
        }
    }

    // price filter - block
    .wc-block-components-price-slider {
        align-items: flex-start;
        display: flex;
        flex-direction: column;
        margin: 0;

        .wc-block-components-price-slider__range-input-wrapper {
            box-shadow: none;
            height: $slider-rail-height;
            margin: calc((#{$slider-handle-size} / 2)) 0;
            width: 100%;

            &:before {
                display: none;
            }
        }

        .wc-block-components-price-slider__range-input-progress {
            height: $slider-rail-height;
        }

        // can’t comma-separate these type of selectors
        .wc-block-components-price-slider__range-input {

            &::-webkit-slider-thumb {
                @include mkdfWooSliderHandle();
                top: -5px;
                margin: 0;
            }

            &::-moz-range-thumb {
                @include mkdfWooSliderHandle();
                transform: translateY(2px) !important;
            }

            &::-ms-thumb {
                @include mkdfWooSliderHandle();
            }

            &:focus {

                &::-webkit-slider-thumb {
                    @include mkdfWooSliderHandleFocus();
                }

                &::-ms-thumb {
                    @include mkdfWooSliderHandleFocus();
                }
            }
        }

        .wc-block-components-price-slider__controls,
        .wc-block-components-price-slider__range-text {
            margin: $slider-bottom-margin 0 0 0;

            input {
                margin: 0;
            }

            span {
                font-size: 15px;
                color: #bababa;

                &:first-child {

                    &:after {
                        content: '—';
                        margin: 0 4px;
                    }
                }
            }
        }

        .wc-block-components-price-slider__actions {
            display: flex;
            flex-direction: row-reverse;
            gap: 5px;
            padding-top: 23px;

            .wc-block-components-filter-reset-button,
            .wc-block-components-filter-submit-button {
                @include mkdfPriceFilterButtonStyle();
            }
        }

        &.wc-block-components-price-slider--has-filter-button {
            flex-wrap: wrap;
            justify-content: space-between;
            flex-direction: row;
        }

        .wc-block-components-price-slider__range-input-wrapper {
            background: #ebebeb;
        }

        .wc-block-components-price-slider__range-input-progress {
            --range-color: #8b8b8b;
        }

        // can’t comma-separate these type of selectors
        .wc-block-components-price-slider__range-input {

            &::-webkit-slider-thumb,
            &::-moz-range-thumb,
            &::-ms-thumb {
                background-color: #8b8b8b;
            }
        }

        .wc-block-components-price-slider__controls {
            width: 100%;
        }
    }

    // price filter - block
    .wp-block-woocommerce-price-filter,
    .wp-block-woocommerce-filter-wrapper {

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            margin: 0 0 18px;
        }
    }
}

/* ==========================================================================
   WooCommerce Widgets styles - end
   ========================================================================== */