.gridlist-toggle {
    display: flex;
    @media #{$screen-small} {
        display: none;
    }

    > a {
        font-size: 1rem;
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--porto-heading-color);
        border: 1px solid var(--porto-heading-color);
        &:not(.active) {
            border: 1px solid var(--porto-gray-5);
        }
    }

    #grid {
        margin-#{$right}: .25rem
    }
}

.woocommerce-result-count {
    margin-bottom: 0
}

.woocommerce-ordering,
.woocommerce-viewing {
    select {
        font-size: 1em;
        padding: side-values(0 25px 0 8px);
        box-shadow:none;
        /*-webkit-appearance: none;
        -ms-appearance: none;
        -moz-appearance: none;
        background: #fff url("../images/select-bg.svg") no-repeat scroll;
        @if $rtl == 1 {
            background-position: 4% 48%;
        } @else {
            background-position: 96% 48%;
        }
        background-size: 26px 60px;
        text-indent: 0.01em;
        text-overflow: "";*/
        border: 1px solid var(--porto-gray-5);
        height: 34px;
        border-radius: 0;
    }
}

.woocommerce-ordering select {
    width: 160px;
}

.woocommerce-viewing {
    display:inline-block;
    vertical-align: top;
}

.woocommerce-pagination {
    position: relative;
    text-align: $right;

    ul {
        display: inline-block;
        white-space: nowrap;
        padding: 0;
        margin: side-values(0 0 0 10px);
        clear: both;

        li {
            float: $left;
            margin-#{$left}: 5px;
            display: inline;
            padding: 0;
            text-align: center;
        }
    }

    li a, li span {
        //border: 1px solid $input-border-color;
        border: 1px solid var(--porto-gray-5);
        color: var(--porto-body-color);
        display: block;
        font-size: .9375rem;
        font-weight: 700;
        margin: 0 0 5px;
        padding: 0 .5em;
        line-height: 2.1em;
        min-width: 2.2em;
        height: 2.2em;
    }

    span.dots {
        border-width: 0;
        min-width: 0;
        padding: 0;
    }

    li {
        a:hover,
        a:focus,
        span.current {
            //color: $color-arrow-hover;
            color: var(--porto-body-color);
            border-color: var(--porto-primary-color);
        }
    }

    .prev,
    .next {
        text-indent: -9999px;
        //width: 2.2em;
        position: relative;
        /*height: 32px;
        line-height: 32px;
        width: 32px;*/
        padding: 0;
        &:before {
            font-family: "porto";
            font-size: 1.25rem;
            font-weight: normal;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            text-indent: 0;
        }
    }

    .prev:before {
        //content: if-ltr($fa-var-caret-left, $fa-var-caret-right);
        content: if-ltr('\e819', '\e81a');
    }

    .next:before {
        //content: if-ltr($fa-var-caret-right, $fa-var-caret-left);
        content: if-ltr('\e81a', '\e819');
    }

    &.load-more {
        float: none;
        &:not(.d-none) {
            display: block !important;
        }
        .woocommerce-viewing {
            display: none;
        }
        > .page-numbers {
            float: none;
            display: block;
            width: 100%;
            margin: 0 0 11px;
        }
        ul li {
            float: none;
            display: block;
            margin-#{$left}: 0;
        }
    }
}

.shop-loop-before,
.shop-loop-after {
    font-size: .9286em;

    label {
        margin: side-values(0 7px 0 0);
        vertical-align: middle;
        @media #{$screen-small} {
            display: none;
        }
    }
    .pwb-filter-products label {
        @media #{$screen-small} {
            display: block;
        }
    }
}

div.shop-loop-before.sticky {
    padding: 11.5px calc(var(--porto-fluid-spacing) - 10px) 1.5px var(--porto-fluid-spacing);
}
.shop-loop-before {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    &:not(.e-con) {
        margin-bottom: 10px;
        margin-#{$right}: -10px;
        > * {
            margin: side-values(0 10px 10px 0);
        }
    }

    > .sidebar-overlay {
        margin-#{$right}: 0;
    }
    p {
        font-size: inherit
    }

    &.sticky {
        position: fixed !important;
        z-index: 1000;
        #{$left}: 0;
        width: 100%;
        border-bottom: 1px solid var(--porto-gray-5);
        transition: $left .3s;
        &.e-con {
            padding: 10px var(--porto-fluid-spacing) 10px var(--porto-fluid-spacing);
        }
    }
    .page-numbers, .woocommerce-pagination .page-numbers {
        display: none;
    }

    .woocommerce-ordering {
        margin-#{$right}: auto;
    }

    .woocommerce-pagination {
        margin-top: 0;
        &:empty {
            display: none
        }
        .woocommerce-viewing {
            display: inline-block;
        }
        ul {
            @media #{$screen-normal} {
                margin-#{$left}: -5px;
            }
        }
    }
}
html:not(.filter-sidebar-opened) .page-wrapper.sticky-scroll-up {
    .shop-loop-before.sticky {
        top: 0;
        opacity: 1;
        visibility: visible;
        transform: translate3d( 0, 0, 0 );
        &.scroll-down {
            opacity: 0 !important;
            visibility: hidden;
            transform: translate3d( 0, -100%,0 );
        }
    }
    .shop-loop-before.sticky-ready {
        transition: $left .3s, visibility 0.3s, opacity 0.3s, transform 0.3s, top 0.3s ease;
    }
    .filter-placeholder {
        width: 100%;
    }
}

html.filter-sidebar-opened .page-wrapper.sticky-scroll-up .shop-loop-before.sticky.scroll-down {
    visibility: hidden;
    .porto-product-filters,
    .sidebar-overlay {
        visibility: visible;
    }
}

.sidebar-opened,
.panel-opened {
    .shop-loop-before.sticky {
        #{$left}: 260px;
    }
}

@media #{$screen-normal} {
    .panel-right-opened.panel-opened #header.sticky-header .header-main.sticky,
    .panel-right-opened.panel-opened .shop-loop-before.sticky,
    .sidebar-right-opened.sidebar-opened .shop-loop-before.sticky {
        #{$left}: -260px;
    }
}

.shop-loop-after {
    text-align: center;
    border-top: 1px solid var(--porto-gray-5);
    padding-top: 25px;
    .woocommerce-pagination {
        clear: both;
        text-align: center;

        > * {
            margin-bottom: 15px;
        }
    }

    .page-numbers {
        display: block;
    }
    
    .woocommerce-viewing {
        float: $left;
    }
    
    .page-numbers {
        clear: none;
        float: $right;
    }
    &.load-more-wrap {
        padding-top: 0;
        border-top: none;
    }

    .shop-loop-before & {
        padding-top: 0;
        border-top: none;

        .woocommerce-pagination > * {
            margin-bottom: 0
        }
    }
}

.porto-products-widget-pagination .woocommerce-viewing {
    display: none;
}

a.porto-product-filters-toggle {
    align-items: center;
    height: 36px;
    background: var(--porto-normal-bg);
    padding: side-values(0 10px 0 3px);
    text-transform: uppercase;
    color: inherit;
    border: 1px solid var(--porto-gray-5);
    svg {
        fill: #fff;
        width: 28px;
    }
}

@media #{$screen-normal} {

    .shop-loop-before {
        font-size: 11px;
        letter-spacing: -.025em;
        font-weight: 600;
        color: var(--porto-heading-color);
        &:not(.e-con) {
            background: var(--porto-gray-7);
            padding: side-values(10px 0 0 10px);
        }
        select {
            text-transform: uppercase;
            height: 36px;
            max-width: 140px;
            letter-spacing: inherit;
            font-weight: inherit;
            color: inherit;
        }
        label {
            font-weight: inherit;
        }
        .woocommerce-ordering, .woocommerce-pagination {
            font-size: 1em
        }
        .woocommerce-result-count {
            display: none
        }
    }
    .page-wrapper .shop-loop-before {
        margin-#{$right}: 0;
        margin-bottom: var(--porto-grid-gutter-width);
    }
    a.porto-product-filters-toggle svg {
        stroke: var(--porto-heading-color);
    }
}

// Elementor Shop Builder
.shop-wrap .elementor-container, .shop-wrap .elementor-row { 
    flex-wrap: wrap;
}
.pg-justify  {
    clear: both;
    .woocommerce-viewing {
        float: $left;
    }
    
    .page-numbers {
        clear: none;
        float: $right;
    }
}
.pg-left .woocommerce-pagination,
.pg-left>* {
    text-align: left;
}
.pg-center .woocommerce-pagination,
.pg-center>* {
    text-align: center;
}

.pg-right>* {
    text-align: right;
}