<?php
$layout = !empty($_GET['product_layout'])? $_GET['product_layout']:reza_option('product_layout');
$key = 'product';
$model = $layout == 'list_1'? 'list':'grid';
$list_layout = reza_option('product_list_layout');
$grid_layout = reza_option('product_grid_layout');
$between_class =reza_option('product_between');
$ratio_class =reza_option('product_ratio');
$alignment_class =reza_option('product_alignment');
$second_image_class =reza_option('product_second_image',true)?'rd-has-second':'';
$box_layout =reza_option('product_box_layout');
$box_layout_class = 'rd-'.$box_layout;

$option=array(
	'layout'=>!empty($_GET['product_layout'])? $_GET['product_layout']:reza_option('product_layout'),
	'list_layout'=>reza_option('product_list_layout'),
	'grid_layout'=>reza_option('product_grid_layout'),
);
	
if($layout=='grid'){
	$option['responsive_column']=reza_option('product_responsive_column');
}
	
$layout_class='';
if($layout=='list'){
	$layout_class ='rd_img_width_'.reza_option('product_image_width');
} 
$classes = array(
	'rd-el-shop',
	'woocommerce',
	'rd-gap-'.$between_class,
	$ratio_class,$layout_class,
	$second_image_class,
	'rd-align-'.reza_alignment($alignment_class),
	$box_layout_class,
);
		 
?> 
    				 
<section class="rd-el-product <?php echo esc_attr(join( ' ', $classes ));?>" data-key="shop">

 	<?php   
  	$woocommerce_archive_description =get_the_archive_description();
	$class_woocommerce_archive_description =!empty($woocommerce_archive_description)?'rd-has-archive':'';
	$title_class= reza_option('title_box_style');?>
    
	 <div class="rd-tbox-<?php echo esc_attr($title_class).' '.esc_attr($class_woocommerce_archive_description);?> rd-has-orderby">
		
         <h1 class="rd-title-box"> 

 			<?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?>
				<div class="rd-tab-main">
				<span><?php woocommerce_page_title();?></span></div>
			<?php endif; ?> 
 		</h1>
        
        
		<?php if(is_product_category()||is_product_tag()|| is_product_taxonomy() && !empty($woocommerce_archive_description)){?>
			<div class="rd-archive-description">
				<?php echo wp_kses_post($woocommerce_archive_description);?>
			</div>
		<?php } ?>
        
 		 <div class="rd-orderby">
			<?php do_action( 'woocommerce_before_shop_loop' );?>
		 </div>
	
	</div>
    
						<div class="rd-gap-content">
	<div class="rd-gap-warp" >
		<?php if ( woocommerce_product_loop() ) : ?>
			<div class="rd-item-list rd-aw rd-flex <?php echo reza_post_class($option);?> products "  >
  
				<?php woocommerce_product_loop_start(); ?>
    
                <?php
                if ( wc_get_loop_prop( 'total' ) ) : 
                while ( have_posts() ) :  the_post();
					wc_get_template_part( 'content', 'product' ); 
                endwhile;  
                endif; 			
				woocommerce_product_loop_end(); 
                ?>
            
			</div> 
                 
			<?php do_action( 'woocommerce_after_shop_loop' ); ?>
 
		<?php else :?> 

			<?php do_action( 'woocommerce_no_products_found' ); ?>

		<?php endif;?>		 
 	</div> 
 	</div> 
    
</section>