<?php
/**
 * The header for our theme
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package warego
 */

?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
    <base href="<?php echo site_url(); ?>/">
	<link rel="profile" href="https://gmpg.org/xfn/11">
	<link rel="icon" href="<?php echo get_template_directory_uri(); ?>/assets/img/favicon.webp"/>
	<?php wp_head(); ?>

    <?php
        $page_schema = get_field('page_schema');
        // Page Schema
        echo $page_schema ? $page_schema : '';
    ?>


    <style>
        .holiday-modal .gccphone {
            padding: 7px 45px !important;
        }
        @media(min-width:992px){
            .holiday-modal .gccphone::placeholder {
                color:#fff;
            }
        }
    </style>
</head>

<body <?php body_class(); ?>>
    <!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MW5QDXC9"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<?php wp_body_open(); ?>


<?php
// Check if the current URL path is in the array

/* if (!is_page('pricing') && !is_page('contact-us') && !is_page('signup')) { 
    get_template_part('templates-parts/pages/holiday-bar');
    get_template_part('templates-parts/modals/holiday-modal');
} */

?>



<header>
 <div class="topbar"></div>
    <div class="progress-container">
        <div class="progress-bar" id="myBar"></div>
    </div>
    <nav class="navbar navbar-expand-lg position-static pb-3">
        <div class="container">
        <a class="navbar-brand" href="<?php echo str_replace('/customer-support', '', site_url()); ?>/">
    <?php 
    if (has_custom_logo()) {
        the_custom_logo(); // This will display the uploaded logo
    } else { ?>
        <img src="<?php echo get_template_directory_uri(); ?>/assets/img/logo.webp" class="img-fluid" alt="logo" loading="lazy">
    <?php } ?>
</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarText"
                    aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon">☰</span>
            </button>
            <div class="collapse navbar-collapse justify-content-end" id="navbarText">
                <?php
                    $nav_content = "";
                    $main_template_directory_path = ABSPATH . '../wp-content/themes/waregowp/';
                    if (file_exists($main_template_directory_path . 'primary-nav.txt')) {
                        $nav_content = file_get_contents($main_template_directory_path . 'primary-nav.txt');
                    }

                    if (strlen($nav_content) < 100) {
                        $nav_content = file_get_contents(get_template_directory() . '/primary-nav-default.txt');
                    }

                    echo $nav_content;
                ?>
                <div class="contact-btn">
                    <a href="<?php echo str_replace('/customer-support', '', site_url()); ?>/signup/">Start for free</a>
                </div>
            </div>
        </div>
    </nav>
</header>
