<?php
/**
 * Template Name: Custom Home
 */
get_header(); ?>

<main id="skip-content" role="main">

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

	<section id="banner">	  
		<div class="overat"></div>
		<div class="ct1"></div>
		<div class="container">
			<div class="bannerinn">
				<div class="content-box">
					<div class="row mr-0">
						<div class="content-boxinn">
							<div class="sub-title">
								🌲 <?php
								echo esc_html(
									get_theme_mod(
										'luzuk_wood_house_construction_bannerheadingtrustedbytext',
										esc_html__( 'Eco-Luxury Wood Construction', 'wood-house-construction' )
									)
								);
								?>
							</div>

							<h2>
								<?php
								echo esc_html(
									get_theme_mod(
										'luzuk_wood_house_construction_bannerheading1',
										esc_html__( 'Crafting', 'wood-house-construction' )
									)
								);
								?>
								<div class="clearfix"></div>
								<span>
									<?php
									echo esc_html(
										get_theme_mod(
											'luzuk_wood_house_construction_bannerheadingspan',
											esc_html__( 'Dream Wooden', 'wood-house-construction' )
										)
									);
									?>
								</span>
								<div class="clearfix"></div>
							</h2>
							<h3>
								<?php
								echo esc_html(
									get_theme_mod(
										'luzuk_wood_house_construction_bannerheading2',
										esc_html__( 'Homes', 'wood-house-construction' )
									)
								);
								?>
							</h3>

							<p>
								<?php
								echo esc_html(
									get_theme_mod(
										'luzuk_wood_house_construction_bannerdescription',
										esc_html__( 'Experience the perfect blend of nature and architecture. We build premium wooden houses that combine sustainability, craftsmanship, and modern design.',
											'wood-house-construction'
										)
									)
								);
								?>
							</p>

							<div class="banner-btn">

								<a class="bt1"
								href="<?php
										echo esc_url(
											get_theme_mod(
												'luzuk_wood_house_construction_bannerbtnlink',
												'#'
											)
										);
								?>">
									<?php
									echo esc_html(
										get_theme_mod(
											'luzuk_wood_house_construction_bannerbtntext',
											esc_html__( 'Start Free Trial', 'wood-house-construction' )
										)
									);
									?>

									<svg xmlns="http://www.w3.org/2000/svg" width="18" height="16" viewBox="0 0 24 24"
										fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
										stroke-linejoin="round"
										class="lucide lucide-arrow-right w-5 h-5 group-hover:translate-x-1 transition-transform"
										aria-hidden="true">
										<path d="M5 12h14"></path>
										<path d="m12 5 7 7-7 7"></path>
									</svg>
								</a>

								<div class="banner-mail">
									<a href="<?php
										echo esc_url(
											get_theme_mod(
												'luzuk_wood_house_construction_bannerscheduledemolink',
												'#'
											)
										);
									?>">
										<?php
										echo esc_html(
											get_theme_mod(
												'luzuk_wood_house_construction_bannerscheduledemotext',
												esc_html__( 'Schedule Demo', 'wood-house-construction' )
											)
										);
										?>
									</a>
								</div>

							</div>

							<div class="banner-features">
								<div class="row m-0">
									<div class="bann-bx">
										<div class="bannsingle">
											<div class="box1 bannsingleinn">							
												<div class="bann-num">
													<?php
														echo esc_html(
															get_theme_mod(
																'luzuk_wood_house_construction_bannerfeaturesbox1num',
																esc_html__( '450+', 'wood-house-construction' )
															)
														);
													?>
												</div>
												<div class="bann-title">
													<?php
														echo esc_html(
															get_theme_mod(
																'luzuk_wood_house_construction_bannerfeaturesbox1text',
																esc_html__( 'Houses Built', 'wood-house-construction' )
															)
														);
													?>
												</div>			
											</div>
										</div>
									</div>
									<div class=" bann-bx">
										<div class="bannsingle">
											<div class="box2 bannsingleinn">
												<div class="bann-num">
													<?php
														echo esc_html(
															get_theme_mod(
																'luzuk_wood_house_construction_bannerfeaturesbox2num',
																esc_html__( '98%', 'wood-house-construction' )
															)
														);
													?>
												</div>
												<div class="bann-title">
													<?php
														echo esc_html(
															get_theme_mod(
																'luzuk_wood_house_construction_bannerfeaturesbox2text',
																esc_html__( 'Satisfaction', 'wood-house-construction' )
															)
														);
													?>
												</div>
											</div>
										</div>
									</div>
									<div class="bann-bx">
										<div class="bannsingle">
											<div class="box3 bannsingleinn">
												<div class="bann-num">
													<?php
														echo esc_html(
															get_theme_mod(
																'luzuk_wood_house_construction_bannerfeaturesbox3num',
																esc_html__( '20+', 'wood-house-construction' )
															)
														);
													?>
												</div>
												<div class="bann-title">
													<?php
														echo esc_html(
															get_theme_mod(
																'luzuk_wood_house_construction_bannerfeaturesbox3text',
																esc_html__( 'Years Exp', 'wood-house-construction' )
															)
														);
													?>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>

						</div>

						<div class="Mbx">
							<div class="fmbx">

								<?php if ( ! class_exists( 'WooCommerce' ) ) : ?>

									<!-- WooCommerce NOT ACTIVE -->
									<div class="whc-hero-search whc-warning">

										<h3 class="whc-search-title">
											<?php esc_html_e( 'Search Unavailable', 'wood-house-construction' ); ?>
										</h3>

										<p>
											<?php esc_html_e( 'Please install and activate WooCommerce Plugin to enable product search.', 'wood-house-construction' ); ?>
										</p>

										<p>
											<?php esc_html_e( 'Add products and categories to start using this feature.', 'wood-house-construction' ); ?>
										</p>

									</div>

								<?php else : ?>

									<!-- WooCommerce ACTIVE -->
									<?php
									$categories = get_terms( array(
										'taxonomy'   => 'product_cat',
										'hide_empty' => true,
									) );

									if ( is_wp_error( $categories ) ) {
										$categories = array();
									}
									?>

									<div class="whc-hero-search">

										<h3 class="whc-search-title">
											<?php esc_html_e( 'Find Your Perfect Wood Home', 'wood-house-construction' ); ?>
										</h3>

										<form method="get"
											action="<?php echo esc_url( wc_get_page_permalink( 'shop' ) ); ?>"
											class="whc-search-form">

											<!-- Category -->
											<div class="sub-h">
												<?php esc_html_e( 'House Type', 'wood-house-construction' ); ?>
											</div>

											<p>
												<i class="fa fa-home"></i>
												<select name="product_cat">
													<option value="">
														<?php esc_html_e( 'All Types', 'wood-house-construction' ); ?>
													</option>

													<?php if ( ! empty( $categories ) ) : ?>
														<?php foreach ( $categories as $cat ) : ?>
															<option value="<?php echo esc_attr( $cat->slug ); ?>">
																<?php echo esc_html( $cat->name ); ?>
															</option>
														<?php endforeach; ?>
													<?php endif; ?>
												</select>
											</p>

											<!-- Location -->
											<div class="sub-h">
												<?php esc_html_e( 'Location', 'wood-house-construction' ); ?>
											</div>

											<p>
												<i class="fa fa-map-marker"></i>
												<input type="text"
													name="whc_location"
													placeholder="<?php esc_attr_e( 'Enter location (city / area)', 'wood-house-construction' ); ?>">
											</p>

											<!-- Budget -->
											<div class="sub-h">
												<?php esc_html_e( 'Budget Range', 'wood-house-construction' ); ?>
											</div>

											<p>
												<i class="fa fa-usd"></i>
												<select name="whc_budget">
													<option value="">
														<?php esc_html_e( 'Any Budget', 'wood-house-construction' ); ?>
													</option>
													<option value="10-25"><?php esc_html_e( '₹10L – ₹25L', 'wood-house-construction' ); ?></option>
													<option value="25-50"><?php esc_html_e( '₹25L – ₹50L', 'wood-house-construction' ); ?></option>
													<option value="50+"><?php esc_html_e( '₹50L+', 'wood-house-construction' ); ?></option>
												</select>
											</p>

											<div class="clearfix"></div>

											<input type="hidden" name="post_type" value="product">

											<button type="submit">
												<i class="fa fa-search"></i>
												<?php esc_html_e( 'Find My Dream Home', 'wood-house-construction' ); ?>
											</button>

										</form>

									</div>

								<?php endif; ?>

							</div>
						</div>

					</div>
				</div>
			</div>
		</div>
	</section>
	
	<?php do_action('luzuk_wood_house_construction_below_banner'); ?>

	<section id="features-section">
		<div class="container">
			<div class="features-head">
				
				<h3 class="subheading">
					<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sparkles"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"></path><path d="M20 3v4"></path><path d="M22 5h-4"></path><path d="M4 17v2"></path><path d="M5 18H3"></path></svg> <?php
					echo esc_html(
						get_theme_mod(
							'luzuk_wood_house_construction_featuressubheading',
							esc_html__( 'Our Features', 'wood-house-construction' )
						)
					);
					?>
				</h3>

				<h2 class="heading">
					<?php
					echo esc_html(
						get_theme_mod(
							'luzuk_wood_house_construction_featuresheading',
							esc_html__( 'Wood House Style', 'wood-house-construction' )
						)
					);
					?>						
				</h2>

				<p class="description">
					<?php
					echo esc_html(
						get_theme_mod(
							'luzuk_wood_house_construction_featuresdescription',
							esc_html__( 'Find the ideal wooden home design that matches your lifestyle and vision',
								'wood-house-construction'
							)
						)
					);
					?>
				</p>

			</div>
			<div class="features-content">
				<div class="row">
					<div class="box box1">
						<div class="boxinn">		
							<div class="icnbx">
								<i class="<?php echo esc_html(get_theme_mod('luzuk_wood_house_construction_featuresbox1icon', 'fas fa-home')); ?>"></i>
							</div>
							<h2>
								<?php echo esc_html(get_theme_mod('luzuk_wood_house_construction_featuresbox1heading',esc_html__( 'Wooden Villa', 'wood-house-construction' )));?>
							</h2>
						</div>
					</div>
					<div class="box box2">
						<div class="boxinn">
							<div class="icnbx">
								<i class="<?php echo esc_html(get_theme_mod('luzuk_wood_house_construction_featuresbox2icon', 'fas fa-home')); ?>"></i>
							</div>
							<h2>
								<?php echo esc_html(get_theme_mod('luzuk_wood_house_construction_featuresbox2heading',esc_html__( 'Wooden Villa', 'wood-house-construction' )));?>
							</h2>
						</div>
					</div>
					<div class="box box3">
						<div class="boxinn">
							<div class="icnbx">
								<i class="<?php echo esc_html(get_theme_mod('luzuk_wood_house_construction_featuresbox3icon', 'fas fa-home')); ?>"></i>
							</div>
							<h2>
								<?php echo esc_html(get_theme_mod('luzuk_wood_house_construction_featuresbox3heading',esc_html__( 'Wooden Villa', 'wood-house-construction' )));?>
							</h2>
						</div>
					</div>
					<div class="box box4">
						<div class="boxinn">
							<div class="icnbx">
								<i class="<?php echo esc_html(get_theme_mod('luzuk_wood_house_construction_featuresbox4icon', 'fas fa-home')); ?>"></i>
							</div>
							<h2>
								<?php echo esc_html(get_theme_mod('luzuk_wood_house_construction_featuresbox4heading',esc_html__( 'Wooden Villa', 'wood-house-construction' )));?>
							</h2>
						</div>
					</div>
					<div class="box box5">
						<div class="boxinn">
							<div class="icnbx">
								<i class="<?php echo esc_html(get_theme_mod('luzuk_wood_house_construction_featuresbox5icon', 'fas fa-home')); ?>"></i>
							</div>
							<h2>
								<?php echo esc_html(get_theme_mod('luzuk_wood_house_construction_featuresbox5heading',esc_html__( 'Wooden Villa', 'wood-house-construction' )));?>
							</h2>
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>

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

		<section id="services-section">
			<div class="container"> 
				<div class="headbx">	
					<div class="head">
						<h3 class="subheading">
							<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-package text-wood-600"><path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"></path><path d="M12 22V12"></path><polyline points="3.29 7 12 12 20.71 7"></polyline><path d="m7.5 4.27 9 5.15"></path></svg>
							<?php
							echo esc_html(
								get_theme_mod(
									'luzuk_wood_house_construction_servicessubheading',
									esc_html__( 'Our Services', 'wood-house-construction' )
								)
							);
							?>
						</h3>
						<h2 class="heading">
							<?php
							echo esc_html(
								get_theme_mod(
									'luzuk_wood_house_construction_servicesheading',
									esc_html__( 'Our Wood Services', 'wood-house-construction' )
								)
							);
							?>						
						</h2>

						<p class="description">
							<?php
							echo esc_html(
								get_theme_mod(
									'luzuk_wood_house_construction_servicesdescription',
									esc_html__( 'From initial design concepts to final construction, we provide end-to-end services for your wooden home project.',
										'wood-house-construction'
									)
								)
							);
							?>
						</p>
					</div>
				</div>
				<div class="row">
					<?php
					$pages_selected = false;

					// Check if any page is selected
					for ( $i = 1; $i <= 6; $i++ ) {
						$selected_page_id = absint(
							get_theme_mod( 'luzuk_wood_house_construction_page_setting_' . $i )
						);

						if ( $selected_page_id ) {
							$pages_selected = true;
							break;
						}
					}

					if ( $pages_selected ) {

						for ( $i = 1; $i <= 6; $i++ ) {

							$selected_page_id = absint(
								get_theme_mod( 'luzuk_wood_house_construction_page_setting_' . $i )
							);

							if ( $selected_page_id ) {

								$page = get_post( $selected_page_id );

								if ( ! $page ) {
									continue;
								}
								?>
								<div class="col-lg-4 col-md-6 col-sm-6 serbx">
									<div class="serbxinn">
										<div class="serimgbx">
											<a href="<?php echo esc_url( get_permalink( $page->ID ) ); ?>">
												<?php
												echo get_the_post_thumbnail(
													$page->ID,
													'medium',
													array(
														'alt' => esc_attr( get_the_title( $page->ID ) ),
													)
												);
												?>
												<div class="icnbx">
													<i class="fas fa-tree"></i>
												</div>
												<div class="oly"></div>
												<div class="sconbx">
													<a href="<?php echo esc_url( get_permalink( $page->ID ) ); ?>">
														<h4><?php echo esc_html( get_the_title( $page->ID ) ); ?></h4>
													</a>
													<p><?php echo esc_html( get_the_excerpt( $page->ID ) ); ?></p>
													<div class="service-tags">    
														<div class="ser-tag">
							                                <?php esc_html_e( '100% Certified', 'wood-house-construction' ); ?>
							                            </div>
							                    	</div>
												</div>
											</a>
										</div>
									</div>
								</div>
								<?php
							}
						}

					} else {
						echo '<p>' . esc_html__( 'Please select pages from the customizer', 'wood-house-construction' ) . '</p>';
					}
					?>
				</div>
				<div class="bttn">
					<a href="#">
						<?php esc_html_e( 'Request A Service', 'wood-house-construction' ); ?> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right group-hover:translate-x-1 transition-transform"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg>
					</a>
				</div>

			</div>
		</section>

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

	<div class="container">
	  	<?php while ( have_posts() ) : the_post(); ?>
	  		<div class="lz-content">
	        	<?php the_content(); ?>
	        </div>
	    <?php endwhile; // end of the loop. ?>
	</div>
</main>

<?php get_footer(); ?>