<?php
/*
* Display Logo and contact details
*/
?>
<div class="main-header">
  <div class="headerbox">
    <div class="header-details">
      <div class="container">
        <div class="row m-0">
          <div class="col-lg-12 col-md-4 col-sm-4 align-self-center">
            <div class="logo-section">
              <div class="logo">
                <?php if( has_custom_logo() ) estate_brokerage_services_the_custom_logo(); ?>
                <?php if(get_theme_mod('estate_brokerage_services_site_title',true) == 1){ ?>
                  <?php if (is_front_page() && is_home()) : ?>
                    <h1 class="text-capitalize">
                      <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                    </h1> 
                  <?php else : ?>
                    <p class="text-capitalize site-title mb-1">
                      <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                    </p>
                  <?php endif; ?>
                <?php }?>
                <?php $estate_brokerage_services_description = get_bloginfo( 'description', 'display' );
                if ( $estate_brokerage_services_description || is_customize_preview() ) : ?>
                  <?php if(get_theme_mod('estate_brokerage_services_site_tagline',false)){ ?>
                    <p class="site-description mb-0"><?php echo esc_html($estate_brokerage_services_description); ?></p>
                  <?php }?>
                <?php endif; ?>
              </div>
            </div>
          </div>
          <div class="col-lg-12 col-md-4 col-sm-4 px-0 align-self-center">
            <div class="sidebar-position">
              <?php get_template_part('template-parts/navigation/site-nav'); ?>
            </div>
          </div>
          <div class="col-lg-12 col-md-4 col-sm-4 p-0 align-self-center">
            <div class="sign-btn">
              <div class="header-menu-right">
                <?php if (is_user_logged_in()): ?>
                  <?php 
                  $estate_brokerage_services_account_url = function_exists('wc_get_page_permalink') ? wc_get_page_permalink('myaccount') : admin_url('profile.php');
                  $estate_brokerage_services_account_label = esc_html__('My Account', 'estate-brokerage-services');
                  ?>
                  <a href="<?php echo esc_url($estate_brokerage_services_account_url); ?>" class="signin-register-btn account-btn" title="<?php esc_attr_e('Dashboard & Profile', 'estate-brokerage-services'); ?>">
                      <?php echo $estate_brokerage_services_account_label; ?>
                  </a>
                <?php else: ?>
                  <div class="auth-buttons">
                    <?php 
                    $estate_brokerage_services_login_url = wp_login_url(get_permalink());
                    $estate_brokerage_services_register_url = wp_registration_url() ?: wp_login_url(get_permalink() . '?action=register');
                    $estate_brokerage_services_login_label = esc_html__('Sign In', 'estate-brokerage-services');
                    $estate_brokerage_services_register_label = esc_html__('Register', 'estate-brokerage-services');
                    ?>
                    <a href="<?php echo esc_url($estate_brokerage_services_login_url); ?>" class="signin-btn" title="<?php esc_attr_e('Login to your account', 'estate-brokerage-services'); ?>">
                        <?php echo $estate_brokerage_services_login_label; ?>
                    </a><span class="slash-separator"><?php echo esc_html__(' / ', 'estate-brokerage-services'); ?></span>
                    <a href="<?php echo esc_url($estate_brokerage_services_register_url); ?>" class="register-btn" title="<?php esc_attr_e('Create free account', 'estate-brokerage-services'); ?>">
                        <?php echo $estate_brokerage_services_register_label; ?>
                    </a>
                  </div>
                <?php endif; ?>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>