<?php
/**
 * Displays main header
 *
 * @package Ambulance Paramedics
 */
?>
<?php
$ambulance_paramedics_sticky_header = get_theme_mod('ambulance_paramedics_sticky_header');
    $ambulance_paramedics_data_sticky = "false";
    if ($ambulance_paramedics_sticky_header) {
    $ambulance_paramedics_data_sticky = "true";
    }
?>
<div class="main-header" data-sticky="<?php echo esc_attr($ambulance_paramedics_data_sticky); ?>">
    <div class="container">
        <div class="row">
            <div class="col-lg-3 col-md-3 align-self-center">
                <div class="navbar-logo text-md-start text-center">
                    <?php if ( has_custom_logo() ) : ?>
                        <div class="site-logo"><?php the_custom_logo(); ?></div>
                    <?php endif; ?>
                    <?php $ambulance_paramedics_blog_info = get_bloginfo( 'name' ); ?>
                        <?php if ( ! empty( $ambulance_paramedics_blog_info ) ) : ?>
                            <?php if ( is_front_page() && is_home() ) : ?>
                                <?php if( get_theme_mod('ambulance_paramedics_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('ambulance_paramedics_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
                            $ambulance_paramedics_description = get_bloginfo( 'description', 'display' );
                            if ( $ambulance_paramedics_description || is_customize_preview() ) :
                        ?>
                        <?php if( get_theme_mod('ambulance_paramedics_theme_description',false) != ''){ ?>
                            <p class="site-description pb-2"><?php echo esc_html($ambulance_paramedics_description); ?></p>
                        <?php } ?>
                    <?php endif; ?>
                </div>
            </div>
            <div class="col-lg-5 col-md-5 align-self-center text-md-start text-center">
                <?php get_template_part('template-parts/navigation/nav'); ?>
            </div>
            <div class="col-lg-4 col-md-4 align-self-center d-flex justify-content-md-end justify-content-center ps-0">
                <?php if( get_theme_mod('ambulance_paramedics_search_enable',false) != false){ ?>
                    <span class="head-search text-md-end text-center">
                        <span class="header-search-wrapper">
                            <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 -->
                                    <button type="submit" class="search-submit align-self-center">
                                        <i class="fas fa-search"></i>
                                    </button>
                                    <label>
                                        <input type="search" class="search-field form-control"  value="<?php echo esc_attr( get_search_query() ); ?>" name="s">
                                    </label>
                                </form>
                            </div>
                        </span>
                    </span>
                <?php }?>
                <?php if(get_theme_mod('ambulance_paramedics_phone_number') != '') {?>
                    <a href="tel:<?php echo esc_attr(get_theme_mod('ambulance_paramedics_phone_number')); ?>" class="call-btn"><i class="fas fa-phone me-2"></i><span><?php echo esc_html(get_theme_mod('ambulance_paramedics_phone_number')); ?></span></a>
                <?php }?>
            </div>
        </div>
    </div>
</div>
