<?php
/**
 * @name : Default
 * @package : CMSSuperHeroes
 * @author : Fox
 */
?>
<?php global $smof_data, $wp_yellow_hats_meta; ?>
<div id="cshero-header-inner" class="header-9 h-style bg-trans m-style">
    <div id="cshero-header-wrapper">
        <div id="cshero-header" class="cshero-main-header <?php if (!empty($wp_yellow_hats_meta->_cms_one_page)) {echo 'active-menu-onepage';} ?> <?php if (!$smof_data['menu_sticky']) {echo 'no-sticky';} ?>">
            <div class="container">
                <div class="row">
                    <div id="cshero-header-logo" class="col-xs-12 col-sm-5 col-md-3 col-lg-3">
                        <?php 
                            if(is_page() && isset($wp_yellow_hats_meta->_cms_custom_logo) && $wp_yellow_hats_meta->_cms_custom_logo) {
                                if (is_page() && isset($wp_yellow_hats_meta->_cms_header_logo_page) && $wp_yellow_hats_meta->_cms_header_logo_page) {
                                    $smof_data['main_logo']['url'] = wp_get_attachment_url($wp_yellow_hats_meta->_cms_header_logo_page);
                                }
                            }
                            if(is_page() && isset($wp_yellow_hats_meta->_cms_custom_logo) && $wp_yellow_hats_meta->_cms_custom_logo) {
                                if (is_page() && isset($wp_yellow_hats_meta->_cms_header_logo_page_sticky) && $wp_yellow_hats_meta->_cms_header_logo_page_sticky) {
                                    $smof_data['sticky_logo']['url'] = wp_get_attachment_url($wp_yellow_hats_meta->_cms_header_logo_page_sticky);
                                }
                            }
                        ?>
                        <a class="logo-main" href="<?php echo esc_url(home_url('/')); ?>">
                            <img alt="" src="<?php echo esc_url($smof_data['main_logo']['url']); ?>">
                        </a>
                        <a class="logo-sticky" href="<?php echo esc_url(home_url('/')); ?>">
                            <img alt="" src="<?php echo esc_url($smof_data['sticky_logo']['url']); ?>">
                        </a>
                    </div>
                    <div id="cshero-header-navigation" class="col-xs-12 col-sm-7 col-md-9 col-lg-9">
                        <div class="navigation-main">
                            <div class="cshero-navigation-right icon-white hidden-xs hidden-sm">
                                <?php if(isset($smof_data['show_button_quote']) && $smof_data['show_button_quote']) { ?>
                                    <div class="nav-button-icon">
                                        <span class="get-form-quote"><?php echo esc_attr($smof_data['button_quote_text']); ?></span>
                                    </div>
                                <?php } ?>
                            </div>
                            <nav id="site-navigation" class="main-navigation menu-white">
                                <?php
                                
                                $attr = array(
                                    'menu' =>wp_yellow_hats_menu_location(),
                                    'menu_class' => 'nav-menu menu-main-menu',
                                );
                                
                                $menu_locations = get_nav_menu_locations();
                                
                                if(!empty($menu_locations['primary'])){
                                    $attr['theme_location'] = 'primary';
                                }
                                
                                /* enable mega menu. */
                                if(class_exists('HeroMenuWalker')){ $attr['walker'] = new HeroMenuWalker(); }
                                
                                /* main nav. */
                                wp_nav_menu( $attr ); ?>
                            </nav>
                            
                        </div>
                    </div>
                    <div id="cshero-menu-mobile" class="collapse navbar-collapse">
                        <i class="cms-icon-menu pe-7s-menu"></i>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>