<style>
    .dej_p_tabs {
        display: flex;
        justify-content: space-between;
        gap: 15px;
        align-items: flex-start;
    }
    .dej_tabs {
        width: 76%;
    }

    .dej_sticky_add {
        width: 24%;
        position: sticky;
        top: 100px;
    }
    .dej_sticky_add {
        background-color: white;
        padding: 10px;
        border-radius: var(--dej-max-radius);
    }
    .dejavo_advanced_reviews .right {
        width: 100% !important;
    }
    .dejavo_advanced_reviews .left {
        display: none !important;
    }
    .dej_sticky_rate_title {
        display: flex;
        justify-content: flex-start;
        gap:7px;
        align-items: center;
        margin-bottom: 8px;
        font-size: 14px;
        font-weight: 500;
    }
    .display_dejavo_rate {
        padding: 10px 10px 15px;
        margin-bottom: 8px;
        border-radius: var(--dej-min-radius);
    }
    @media (max-width: 1200px) {
        .dej_sticky_add {
            width: 30%;
        }
        .dej_tabs {
            width: 70%;
        }
    }
    @media (min-width: 992px) {
        .DejavoSA-wrapper{
            display: none !important;
        }
        .BackToTop {
            bottom: 20px !important;
        }
        .DejavoFC-count {
            bottom: 86px !important;
        }
        .DejavoFC-count:hover {
            bottom: 83px !important;
        }
    }
    @media (max-width: 992px) {
        .dej_p_tabs {
            flex-direction: column !important;
        }
        .dej_sticky_add {
            width: 100% !important;
            position: unset;
        }
        .dej_tabs {
            width: 100% !important;
        }
    }
</style>


<?php
if (dej_opt('show_dej_reviews_slide_opt', 1) ) {
    global $product;
    ?>
    <div class="dej_sticky_rate_title"><i class="dej-bars-progress"></i><?=  __('ارزیابی کاربران', 'dejavo') ?></div>
    <div class="display_dejavo_ratings">
        <?php
        $slider_rating = dej_opt('dej_slider_rating', 0);
        if (!$slider_rating) {return;}
        $counter = $average = $count = $percent = 0;
        foreach ($slider_rating as $item) {
            $key = 'dejavo_rate' . $counter;
            $average = get_average_option_rating($product->get_id(), $key);
            $count = get_count_option_rating($product->get_id(), $key);
            $percent = $average * 20;
            ?>
            <div class="display_dejavo_rate">
                <?php
                echo '<div class="title_sec"> <span>' . $item['dej_slide_rate'] . ' (' . $percent . '%)</span> <span class="comment_count">' . $count . ' نظر</span></div>';
                echo '<div class="dejavo_progres"><div class="bar" style="width:' . $percent . '%"  aria-valuenow="' . $percent . '" aria-valuemin="0" aria-valuemax="100"></div></div>';
                ?>
            </div>
            <?php
            $counter++;
        } ?>
    </div>
    <?php
}
?>


<div class="dej_single_add_to_cart">
    <?php woocommerce_template_single_add_to_cart(); ?>
</div>