

<?php
/**
 * Template for displaying single product pages.
 *
 * @see     https://woocommerce.com/document/template-structure/
 * @package WooCommerce\Templates
 * @version 8.0.0
 */
get_header(); ?>
<div class="clearfix"></div>
<?php $image = wp_get_attachment_url( get_post_thumbnail_id($post->ID));?>

<!-- <header class="page-main-header" <?php  if (!empty($image)) : ?> style="background: url('<?php echo esc_url($image); ?>'); background-repeat: no-repeat; background-size:cover; position: relative;"<?php endif ?> >  -->

<header class="page-main-header" > 
	<div class="innheadpgimg"></div>    
    <div class="  container" >
        <div class="headinnbox">
            <!-- <h1 class="page-title ht-main-title wow zoomIn"></?php woocommerce_page_title(); ?></h1> -->
            <?php if( get_theme_mod('breadcrumb_button_display','show' ) == 'show') : ?>
            <div class="breadcrumbbox ">
                <div class='button'><?php luzuk_lite_the_breadcrumb(); ?></div>
                <div class="clearfix"></div>
            </div>
             <?php endif ?>
        </div>
    </div>
    <div class="clearfix"></div>
</header>

<div class="single-productpage">
	<main id="innerpage-box">
		<div id="page" class="container" >
			<div class="inner_contentbox" >		
				<article id="content" class="article single_inner">
					<?php do_action('woocommerce_before_main_content'); ?>
							<?php while ( have_posts() ) : the_post(); ?>
							<?php wc_get_template_part( 'content', 'single-product' ); ?>
					<?php endwhile; // end of the loop. ?>
				<div class="clearfix"></div>
				<?php
					if ( ! defined( 'ABSPATH' ) ) {
						exit; // Exit if accessed directly
					}
					global $product;

					// Product Description
					echo '<div class="woocommerce-product-details__description">';
					echo '<h6>Description</h6>';
					echo apply_filters( 'woocommerce_short_description', $product->get_description() );
					echo '</div>';

					// Product Additional Information
					echo '<div class="woocommerce-product-additional-information">';
					echo '<h6>About This Item</h6>';
					do_action('woocommerce_product_additional_information', $product);
					echo '</div>';

					// Product Reviews
					if ( comments_open() || get_comments_number() ) {
						echo '<div class="woocommerce-product-reviews">';
						echo '<h2 class="woo-reviews">Customer Review</h2>';
						comments_template();
						echo '</div>';
					}
				?>
				<!-- Display Related Products -->
			    <div class="woocommerce-related-products">
			    	<div class="related-products-button">
				        <?php
					        if ( function_exists( 'wc_get_page_id' ) && is_product() ) {
					            global $product;
					            
					            // Get related products IDs
					            $related_products = wc_get_related_products($product->get_id(), 4); // Retrieve 4 related product IDs

					            // Only show the "See All" button if there are related products
					            if (!empty($related_products)) {
					                $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) );
					                echo '<a href="' . esc_url( $shop_page_url ) . '" class="button">See All</a>';
					            }
					        }
				        ?>
				    </div>
			        <?php
			            woocommerce_related_products(array(
			                'posts_per_page' => 4,
			                'columns'        => 4,
			                'orderby'        => 'date' 
			            ));
			        ?>
			    </div>
			    			<!--  -->


			    			<!--  -->
			</article>
			<div class="clearfix"></div>
		</div>
		<div class="clearfix"></div>
	</div>
  </main><!-- #primary -->	
</div>
<div class="clearfix"></div>

<?php 
  get_template_part('template-parts/section','support');
 ?>
 <?php 
  get_template_part('template-parts/section','newsletter');
 ?>
<?php get_footer(); ?>

