<?php
/**
 * Displays top header
 *
 * @package Construction Demolition Services
 */
?>

<div class="top-info text-end">
	<div class="container">
		<div class="row top-header m-0 px-5">
			<div class="col-xl-4 col-lg-4 col-md-4 col-sm-12 col-12 text-lg-start text-center align-self-center mail-box">
				<?php if(get_theme_mod('construction_demolition_services_phone') != '' ){ ?>
					<div class="row">
						<div class="col-lg-2 col-md-2 col-sm-4 col-4 align-self-center phone-icon">
							<i class="fas fa-phone"></i>
						</div>
						<div class="col-lg-10 col-md-10 col-sm-8 col-8 align-self-center ">
							<p class="mb-1">Call us any time</p>
							<a href="tel:<?php echo esc_attr(get_theme_mod('construction_demolition_services_phone','')); ?>"><?php echo esc_html(get_theme_mod('construction_demolition_services_phone','')); ?></a>
						</div>
					</div>
	            <?php }?>
            </div>
			<div class="col-xl-4 col-lg-4 col-md-4 col-sm-12 col-12 logo-box align-self-center">
                <div class="navbar-brand ">
                    <?php if ( has_custom_logo() ) : ?>
                        <div class="site-logo"><?php the_custom_logo(); ?></div>
                    <?php endif; ?>
                    <?php $construction_demolition_services_blog_info = get_bloginfo( 'name' ); ?>
                        <?php if ( ! empty( $construction_demolition_services_blog_info ) ) : ?>
                            <?php if ( is_front_page() && is_home() ) : ?>
                                <?php if( get_theme_mod('construction_demolition_services_logo_title_text',true) != ''){ ?>
                                    <h1 class="site-title "><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
                                <?php } ?>
                            <?php else : ?>
                                <?php if( get_theme_mod('construction_demolition_services_logo_title_text',true) != ''){ ?>
                                    <p class="site-title "><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                                <?php } ?>
                            <?php endif; ?>
                        <?php endif; ?>
                        <?php
                            $construction_demolition_services_description = get_bloginfo( 'description', 'display' );
                            if ( $construction_demolition_services_description || is_customize_preview() ) :
                        ?>
                        <?php if( get_theme_mod('construction_demolition_services_theme_description',false) != ''){ ?>
                            <p class="site-description pb-2"><?php echo esc_html($construction_demolition_services_description); ?></p>
                        <?php } ?>
                    <?php endif; ?>
                </div>
            </div>
			<div class="col-xl-4 col-lg-4 col-md-4 col-sm-12 align-self-center btn-box">
                <?php if ( get_theme_mod('construction_demolition_services_header_button') != "" || get_theme_mod('construction_demolition_services_header_button_url') != ""  ) {?>
                    <span class="head-btn"><a href="<?php echo esc_url(get_theme_mod('construction_demolition_services_header_button_url')); ?>"><?php echo esc_html(get_theme_mod('construction_demolition_services_header_button')); ?></a></span>
                <?php }?>
                <?php if (get_theme_mod('construction_demolition_services_header_search_setting', false) != '') { ?>
                    <span class="head-search">
                        <span class="header-search-wrapper">
                            <span class="search-main">
                                <i class="fa fa-search"></i>
                            </span>
                            <div class="search-form-main clearfix">
                                <form method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
                                    <input type="hidden" name="post_type" value="post"> <!-- Set post type to product for WooCommerce products -->
                                    <label>
                                        <input type="search" class="search-field form-control" placeholder="Search for Post..." value="<?php echo get_search_query(); ?>" name="s">
                                    </label>
                                    <input type="submit" class="search-submit btn btn-primary mt-3" value="Search">
                                </form>
                            </div>
                        </span>
                    </span>
                <?php } ?>
			</div>
		</div>
	</div>
</div>