<?php
/**
 * Product loop item
 *
 * @see https://woocommerce.com/document/template-structure/
 * @package WooCommerce\Templates
 */

defined( 'ABSPATH' ) || exit;

global $product;

// Ensure visibility.
if ( empty( $product ) || ! $product->is_visible() ) {
	return;
}
?>

<li <?php wc_product_class( '', $product ); ?>>
	<div class="product-card">

		<div class="product-img">
			<a href="<?php the_permalink(); ?>">
				<?php
				if ( has_post_thumbnail() ) {
					the_post_thumbnail( 'full', array( 'class' => 'img-fluid' ) );
				} else {
					echo wc_placeholder_img( 'full' );
				}
				?>
			</a>

			<div class="actions">
				<div class="btn-wrap justify-content-center">
					<?php
					/**
					 * Hook: woocommerce_loop_add_to_cart_link
					 */
					woocommerce_template_loop_add_to_cart();
					?>
				</div>
			</div>
		</div>

		<div class="product-content">
			<h3 class="product-title">
				<a href="<?php the_permalink(); ?>">
					<?php the_title(); ?>
				</a>
			</h3>

			<span class="price">
				<?php woocommerce_template_loop_price(); ?>
			</span>
		</div>

	</div>
</li>
