<?php
$options = roonix_WSH()->option();
$allowed_html = wp_kses_allowed_html( 'post' );

//Logo Settings
$image_normal_logo = $options->get( 'image_normal_logo' );
$normal_logo_dimension = $options->get( 'normal_logo_dimension' );

$image_mobile_logo = $options->get( 'image_mobile_logo' );
$mobile_logo_dimension = $options->get( 'mobile_logo_dimension' );

$image_sidebar_logo = $options->get( 'image_sidebar_logo' );
$sidebar_logo_dimension = $options->get( 'sidebar_logo_dimension' );

$logo_type = '';
$logo_text = '';
$logo_typography = ''; ?>

<?php if( $options->get( 'enable_mouse_cursor' ) ):?>
<div class="cursor"></div>
<?php endif; ?>
<div class="page-wrapper sidebar-menu-page">

	<?php if( $options->get( 'theme_preloader' ) ):?>
        <!-- Preloader -->
	<div class="loader-wrap">
		<div class="preloader">
			<div class="preloader-close">x</div>
			<div id="handle-preloader" class="handle-preloader">
				<div class="animation-preloader">
					<div class="spinner"></div>
					<div class="txt-loading">
						<?php echo wp_kses($options->get('preloader_text'), true); ?>
					</div>
				</div>  
			</div>
		</div>
	</div>
	<!-- Preloader End -->
	<?php endif; ?>
    
    <!-- Main Header / Header Style Four -->
    <header class="main-header header-style-four">
    	
        <!-- Header Lower -->
        <div class="header-lower">
            
			<div class="auto-container">
				<div class="inner-container clearfix">
					
					<div class="pull-left logo-box">
						<div class="logo"><?php echo roonix_logo( $logo_type, $image_normal_logo, $normal_logo_dimension, $logo_text, $logo_typography ); ?></div>
					</div>
					<div class="nav-outer clearfix">
						
						<!-- Mobile Navigation Toggler -->
						<div class="mobile-nav-toggler"><span class="icon flaticon-menu"></span></div>
						
						<!-- Main Menu -->
						<nav class="main-menu show navbar-expand-md">
							<div class="navbar-header">
								<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
								</button>
							</div>
							
							<div class="navbar-collapse collapse clearfix" id="navbarSupportedContent">
								<ul class="navigation clearfix">
									<?php wp_nav_menu( array( 'theme_location' => 'main_menu', 'container_id' => 'navbar-collapse-1',
										'container_class'=>'navbar-collapse collapse navbar-right',
										'menu_class'=>'nav navbar-nav',
										'fallback_cb'=>false, 
										'items_wrap' => '%3$s', 
										'container'=>false,
										'depth'=>'3',
										'walker'=> new Bootstrap_walker()  
									) ); ?>
								</ul>
							</div>
							
						</nav>
						<!-- Main Menu End-->
						
						<!-- Outer Box -->
						<div class="outer-box clearfix">
							<?php if($options->get('show_search_switcher_v4')):?>
							<!-- Search Box -->
							<div class="search-box-outer">
								<div class="search-box-btn"><span class="flaticon-search-1"></span></div>
							</div>
							<?php endif; ?>
							<!-- Nav Btn -->
							<div class="nav-btn navSidebar-button"><span class="icon flaticon-menu"></span></div>
							
						</div>
						<!-- End Outer Box -->
						
					</div>
					
				</div>
				
			</div>
        </div>
        <!-- End Header Lower -->
        
		<!-- Mobile Menu  -->
        <div class="mobile-menu">
            <div class="menu-backdrop"></div>
            <div class="close-btn"><span class="icon flaticon-multiply"></span></div>
            <nav class="menu-box">
                <div class="nav-logo"><?php echo roonix_logo( $logo_type, $image_mobile_logo, $mobile_logo_dimension, $logo_text, $logo_typography ); ?></div>
				<?php if($options->get('show_search_switcher_v4')):?>
                <!-- Search -->
				<div class="search-box">
					<?php echo (get_template_part('searchform1')); ?>
				</div>
                <?php endif; ?>
                <div class="menu-outer"><!--Here Menu Will Come Automatically Via Javascript / Same Menu as in Header--></div>
            </nav>
        </div>
		<!-- End Mobile Menu -->
	
    </header>
    <!-- End Main Header -->
	
	<?php if($options->get('show_sidebar_v4')):?>
	<!-- Sidebar Cart Item -->
	<div class="xs-sidebar-group info-group">
		<div class="xs-overlay xs-bg-black"></div>
		<div class="xs-sidebar-widget">
			<div class="sidebar-widget-container">
				<div class="widget-heading">
					<a href="#" class="close-side-widget">
						X
					</a>
				</div>
				<div class="sidebar-textwidget">
					<!-- Sidebar Info Content -->
					<div class="sidebar-info-contents">
						<div class="content-inner">
							<div class="logo">
								<?php echo roonix_logo( $logo_type, $image_sidebar_logo, $sidebar_logo_dimension, $logo_text, $logo_typography ); ?>
							</div>
                            <?php if(($options->get('title_v4')) || ($options->get('text_v4')) || ($options->get('button_title_v4'))):?>
							<div class="content-box">
								<?php if($options->get('title_v4')):?><h5><?php echo wp_kses($options->get('title_v4'), true); ?></h5><?php endif; ?>
								<?php if($options->get('text_v4')):?><p class="text"><?php echo wp_kses($options->get('text_v4'), true); ?></p><?php endif; ?>
								<?php if($options->get('button_title_v4')):?><a href="<?php echo esc_attr($options->get('button_link_v4'));?>" class="theme-btn btn-style-one"><span class="txt"><?php echo wp_kses($options->get('button_title_v4'), true); ?></span></a><?php endif; ?>
							</div>
                            <?php endif; ?>
                            <?php if(($options->get('contact_title_v4')) || ($options->get('address_v4')) || ($options->get('phone_v4')) || ($options->get('email_v4')) || ($options->get('closing_hour_v4'))):?>
							<div class="contact-info">
								<?php if($options->get('contact_title_v4')):?><h5><?php echo wp_kses($options->get('contact_title_v4'), true); ?></h5><?php endif; ?>
								<ul class="list-style-one">
									<?php if($options->get('address_v4')):?><li><span class="icon fa fa-location-arrow"></span><?php echo wp_kses($options->get('address_v4'), true); ?></li><?php endif; ?>
									<?php if($options->get('phone_v4')):?><li><span class="icon fa fa-phone"></span><?php echo wp_kses($options->get('phone_v4'), true); ?></li><?php endif; ?>
									<?php if($options->get('email_v4')):?><li><span class="icon fa fa-envelope"></span><?php echo wp_kses($options->get('email_v4'), true); ?></li><?php endif; ?>
									<?php if($options->get('closing_hour_v4')):?><li><span class="icon fa fa-clock-o"></span><?php echo wp_kses($options->get('closing_hour_v4'), true); ?></li><?php endif; ?>
								</ul>
							</div>
                            <?php endif; ?>
                            <?php
								$icons = $options->get( 'header_v4_social_share' );
								if ( ! empty( $icons ) ) :
							?>
							<!-- Social Box -->
							<ul class="social-box">
								<?php
									foreach ( $icons as $h_icon ) :
									$header_social_icons = json_decode( urldecode( roonix_set( $h_icon, 'data' ) ) );
									if ( roonix_set( $header_social_icons, 'enable' ) == '' ) {
										continue;
									}
									$icon_class = explode( '-', roonix_set( $header_social_icons, 'icon' ) );
									?>
									<li><a href="<?php echo esc_url(roonix_set( $header_social_icons, 'url' )); ?>" <?php if( roonix_set( $header_social_icons, 'background' ) || roonix_set( $header_social_icons, 'color' ) ):?>style="background-color:<?php echo esc_attr(roonix_set( $header_social_icons, 'background' )); ?>; color: <?php echo esc_attr(roonix_set( $header_social_icons, 'color' )); ?>"<?php endif;?> class="fa <?php echo esc_attr( roonix_set( $header_social_icons, 'icon' ) ); ?>"></a></li>
								<?php endforeach; ?>
							</ul>
                            <?php endif; ?>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- END sidebar widget item -->
    <?php endif; ?>
 