<?php defined('ABSPATH') || exit; ?>
<div class="dejavo_wrapper">
    <?php if (have_posts()) {  ?>
    <div class="dej_posts d_grid mob_col2 lap_col3 col4">
        <?php  while (have_posts()) : the_post(); ?>
            <?php if (get_post_type() === 'post') { get_template_part('template/post/card'); } ?>
        <?php endwhile;
        wp_reset_postdata(); ?>
    </div>
<br>
    <div class="dej_products d_grid mob_col2 lap_col3 col4">
        <?php  while (have_posts()) : the_post(); ?>
            <?php if (get_post_type() === 'product') {  wc_get_template_part('content', 'product'); } ?>
        <?php endwhile;
        wp_reset_postdata(); ?>
    </div>
        <div class="dej_pagination">
            <?php the_posts_pagination(array('mid_size' => 2, 'prev_text' => __('<i class="dej-angle-small-right"></i>'), 'next_text' => __('<i class="dej-angle-small-left"></i>'),)); ?>
        </div>

    <?php } elseif ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'single' ) ) {
        get_template_part( 'template/post/404' );
    }

    $term = get_queried_object();
    if ($term) {
        $meta = get_term_meta($term->term_id, 'dej_category_options', true);
        $meta_desc = $meta['dej_cat_desc'] ?? '';
        if (!empty($meta_desc)) {
            echo '<div class="term-description">' . wp_kses_post(wpautop($meta_desc)) . '</div>';
        }
    }


    ?>

</div>