<?php
$search_status = $settings['search_enable'];
$cart_status = $settings['cart_enable'];
$sidebar_status = $settings['sidebar_enable'];
$sticky_status = (get_theme_mod('header_sticky_menu') == 'yes'  && !is_admin_bar_showing()) ? 'sticky-header' : '';
$sticky_onepage_status = ($settings['onepage_menu'] == 'yes' && !is_admin_bar_showing()) ? 'sticky-header--one-page' : 'sticky-header--normal';
$menu_onepage_status = ($settings['onepage_menu'] == 'yes') ? 'one-page-scroll-menu' : ' ';
if ('layout_one' === $settings['layout_type']) : ?>
	<header class="main-header main-header--one <?php echo esc_attr($sticky_status . " " . $sticky_onepage_status); ?>">
		<div class="container-fluid">
			<div class="main-header__inner">
				<div class="main-header__logo logo-ostech">
					<a href="<?php echo esc_url(home_url('/')); ?>">
						<img width="<?php echo esc_attr($settings['logo_dimension']['width']); ?>" height="<?php echo esc_attr($settings['logo_dimension']['height']); ?>" src="<?php echo esc_url($settings['light_logo']['url']); ?>" alt="<?php echo esc_attr(get_bloginfo('name')); ?>">
					</a>
				</div>

				<nav class="main-header__nav main-menu">
					<?php
					wp_nav_menu(
						array(
							'menu' => $settings['nav_menu'],
							'menu_class' => 'main-menu__list ' . esc_attr($menu_onepage_status),
							'walker'         => class_exists('\Layerdrops\Ostech\Megamenu\Walker_Nav_Menu') ? new \Layerdrops\Ostech\Megamenu\Walker_Nav_Menu : '',
						)
					);
					?>
				</nav>
				<div class="main-header__right">
					<?php if (!empty($settings['header_call_number'])) : ?>
						<a href="tel:<?php echo esc_attr(str_replace(' ', '-', $settings['header_call_number'])); ?>" class="main-header__right__call">
							<div class="main-header__right__icon">
								<i class="icon-call"></i>
							</div>
							<div class="main-header__right__content">
								<span class="main-header__right__text"><?php echo wp_kses($settings['header_call_text'], 'ostech_allowed_tags'); ?></span>
								<h6 class="main-header__right__number"><?php echo esc_html($settings['header_call_number']); ?></h6>
							</div>
						</a>
					<?php endif; ?>
					<?php if (('yes' == $search_status) || ('yes' == $cart_status && class_exists('WooCommerce'))) : ?>
						<div class="main-header__right__info">
							<?php if (('yes' == $search_status)) : ?>
								<a href="#" class="search-toggler main-header__right__info__item"><i class="icon-search" aria-hidden="true"></i></a>
							<?php endif; ?>
							<?php if ('yes' == $cart_status && class_exists('WooCommerce')) : ?>
								<a href="<?php echo esc_url(wc_get_cart_url()); ?>" class="main-header__right__info__item"><i class="icon-trolley-cart" aria-hidden="true"></i></a>
							<?php endif; ?>
						</div>
					<?php endif; ?>
					<div class="mobile-nav__btn mobile-nav__toggler">
						<span></span><span></span><span></span>
					</div>
				</div>
			</div>
		</div>
	</header>
<?php endif; ?>

<?php if ('layout_two' === $settings['layout_type']) : ?>
	<div class="topbar-one">
		<div class="container-fluid">
			<div class="topbar-one__inner">
				<ul class="list-unstyled topbar-one__info ml-0">
					<?php foreach ($settings['topbar_infos'] as $info) : ?>
						<li class="topbar-one__info__item">
							<?php \Elementor\Icons_Manager::render_icon($info['topbar_icon'], ['aria-hidden' => 'true', 'class' => 'topbar-one__info__icon'], 'i'); ?>
							<?php echo wp_kses($info['topbar_info_text'], 'ostech_allowed_tags'); ?>
						</li>
					<?php endforeach; ?>
				</ul>
				<div class="topbar-one__right">
					<?php if (!empty($settings['topbar_call_number'])) : ?>
						<a href="tel:<?php echo esc_attr(str_replace(' ', '-', $settings['topbar_call_number'])); ?>" class="topbar-one__right__call">
							<div class="topbar-one__right__call__icon">
								<?php \Elementor\Icons_Manager::render_icon($settings['topbar_call_icon'], ['aria-hidden' => 'true'], 'i'); ?>
							</div>
							<p class="topbar-one__right__call__text"><?php echo esc_html($settings['topbar_call_number']); ?></p>
						</a>
					<?php endif; ?>
					<?php if (!empty($settings['social_icons'])) : ?>
						<div class="topbar-one__social">
							<?php foreach ($settings['social_icons'] as $social_icon) : ?>
								<a <?php echo esc_attr(!empty($social_icon['social_url']['is_external']) ? 'target=_blank' : ' '); ?> href="<?php echo esc_url($social_icon['social_url']['url']); ?>">
									<?php \Elementor\Icons_Manager::render_icon($social_icon['social_icon'], ['aria-hidden' => 'true'], 'i'); ?>
								</a>
							<?php endforeach; ?>
						</div>
					<?php endif; ?>
				</div>
			</div>
		</div>
	</div>

	<header class="main-header main-header--two <?php echo esc_attr($sticky_status . " " . $sticky_onepage_status); ?>">
		<div class="container-fluid">
			<div class="main-header__inner">
				<div class="main-header__logo logo-ostech">
					<a href="<?php echo esc_url(home_url('/')); ?>">
						<img width="<?php echo esc_attr($settings['logo_dimension']['width']); ?>" height="<?php echo esc_attr($settings['logo_dimension']['height']); ?>" src="<?php echo esc_url($settings['light_logo']['url']); ?>" alt="<?php echo esc_attr(get_bloginfo('name')); ?>">
					</a>
				</div><!-- /.main-header__logo -->
				<div class="main-header__inner__item">
					<nav class="main-header__nav main-menu">
						<?php
						wp_nav_menu(
							array(
								'menu' => $settings['nav_menu'],
								'menu_class' => 'main-menu__list ' . esc_attr($menu_onepage_status),
								'walker'         => class_exists('\Layerdrops\Ostech\Megamenu\Walker_Nav_Menu') ? new \Layerdrops\Ostech\Megamenu\Walker_Nav_Menu : '',
							)
						);
						?>
					</nav><!-- /.main-header__nav -->
					<div class="main-header__right">
						<?php if (!empty($settings['button_label'])) : ?>
							<div class="main-header__right__btn">
								<a href="<?php echo esc_url($settings['button_url']['url']); ?>" <?php esc_attr(!empty($settings['button_url']['is_external']) ? "target=_blank" : ' '); ?> class="ostech-btn main-header__btn"><?php echo esc_html($settings['button_label']); ?></a>
							</div>
						<?php endif; ?>
						<?php if (('yes' == $search_status)) : ?>
							<a href="#" class="search-toggler main-header__right__info__item"><i class="icon-search" aria-hidden="true"></i></a>
						<?php endif; ?>
						<?php if ('yes' == $cart_status && class_exists('WooCommerce')) : ?>
							<a href="<?php echo esc_url(wc_get_cart_url()); ?>" class="main-header__right__info__item"><i class="icon-trolley-cart" aria-hidden="true"></i></a>
						<?php endif; ?>
						<div class="mobile-nav__btn mobile-nav__toggler">
							<span></span> <span></span> <span></span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</header>
<?php endif; ?>

<?php if ('layout_three' === $settings['layout_type']) : ?>
	<div class="topbar-two">
		<div class="container-fluid">
			<div class="topbar-two__inner">
				<?php if (!empty($settings['topbar_infos'])) : ?>
					<ul class="list-unstyled topbar-two__info ml-0">
						<?php foreach ($settings['topbar_infos'] as $info) : ?>
							<li class="topbar-two__info__item">
								<?php \Elementor\Icons_Manager::render_icon($info['topbar_icon'], ['aria-hidden' => 'true', 'class' => 'topbar-one__info__icon'], 'i'); ?>
								<?php echo wp_kses($info['topbar_info_text'], 'ostech_allowed_tags'); ?>
							</li>
						<?php endforeach; ?>
					</ul>
				<?php endif; ?>
				<div class="topbar-two__right">
					<?php if (!empty($settings['topbar_date'])) : ?>
						<div class="topbar-two__info__item">
							<i class="icon-email topbar-two__info__icon"></i>
							<p class="topbar-two__info__item__time"><?php echo wp_kses($settings['topbar_date'], 'ostech_allowed_tags'); ?></p>
						</div>
					<?php endif; ?>
					<?php if (!empty($settings['social_icons'])) : ?>
						<div class="topbar-two__social">
							<?php foreach ($settings['social_icons'] as $social_icon) : ?>
								<a <?php echo esc_attr(!empty($social_icon['social_url']['is_external']) ? 'target=_blank' : ' '); ?> href="<?php echo esc_url($social_icon['social_url']['url']); ?>">
									<?php \Elementor\Icons_Manager::render_icon($social_icon['social_icon'], ['aria-hidden' => 'true'], 'i'); ?>
								</a>
							<?php endforeach; ?>
						</div>
					<?php endif; ?>
				</div>
			</div>
		</div>
	</div>

	<header class="main-header main-header--three <?php echo esc_attr($sticky_status . " " . $sticky_onepage_status); ?>">
		<div class="container-fluid">
			<div class="main-header__inner">
				<div class="main-header__logo logo-ostech">
					<a href="<?php echo esc_url(home_url('/')); ?>">
						<img width="<?php echo esc_attr($settings['logo_dimension']['width']); ?>" height="<?php echo esc_attr($settings['logo_dimension']['height']); ?>" src="<?php echo esc_url($settings['light_logo']['url']); ?>" alt="<?php echo esc_attr(get_bloginfo('name')); ?>">
					</a>
				</div>

				<nav class="main-header__nav main-menu">
					<?php
					wp_nav_menu(
						array(
							'menu' => $settings['nav_menu'],
							'menu_class' => 'main-menu__list ' . esc_attr($menu_onepage_status),
							'walker'         => class_exists('\Layerdrops\Ostech\Megamenu\Walker_Nav_Menu') ? new \Layerdrops\Ostech\Megamenu\Walker_Nav_Menu : '',
						)
					);
					?>
				</nav>
				<div class="main-header__right">
					<?php if (!empty($settings['button_label'])) : ?>
						<div class="main-header__right__btn">
							<a href="<?php echo esc_url($settings['button_url']['url']); ?>" <?php esc_attr(!empty($settings['button_url']['is_external']) ? "target=_blank" : ' '); ?> class="ostech-btn main-header__btn"><?php echo esc_html($settings['button_label']); ?></a>
						</div>
					<?php endif; ?>
					<?php if (('yes' == $search_status)) : ?>
						<a href="#" class="search-toggler main-header__right__info__item"><i class="icon-search" aria-hidden="true"></i></a>
					<?php endif; ?>
					<?php if ('yes' == $cart_status && class_exists('WooCommerce')) : ?>
						<a href="<?php echo esc_url(wc_get_cart_url()); ?>" class="main-header__right__info__item"><i class="icon-trolley-cart" aria-hidden="true"></i></a>
					<?php endif; ?>
					<?php if (!empty($settings['header_call_number'])) : ?>
						<a href="tel:<?php echo esc_attr(str_replace(' ', '-', $settings['header_call_number'])); ?>" class="topbar-one__right__call">
							<div class="topbar-one__right__call__icon">
								<i class="icon-call"></i>
							</div>
							<div class="main-header__right__call__content">
								<span class="main-header__right__call__subtitle"><?php echo wp_kses($settings['header_call_text'], 'ostech_allowed_tags'); ?></span>
								<h6 class="main-header__right__call__text"><?php echo esc_html($settings['header_call_number']); ?></h6>
							</div>
						</a>
					<?php endif; ?>
					<div class="mobile-nav__btn mobile-nav__toggler">
						<span></span> <span></span> <span></span>
					</div>
				</div>
			</div>
		</div>
	</header>

<?php endif; ?>

<?php if ('layout_four' === $settings['layout_type']) : ?>
	<header class="main-header main-header--four sticky-header <?php echo esc_attr($sticky_status . " " . $sticky_onepage_status); ?>">
		<div class="container-fluid">
			<div class="main-header__inner">
				<div class="main-header__logo">
					<a href="<?php echo esc_url(home_url('/')); ?>">
						<img width="<?php echo esc_attr($settings['logo_dimension']['width']); ?>" height="<?php echo esc_attr($settings['logo_dimension']['height']); ?>" src="<?php echo esc_url($settings['light_logo']['url']); ?>" alt="<?php echo esc_attr(get_bloginfo('name')); ?>">
					</a>
				</div><!-- /.main-header__logo -->
				<nav class="main-header__nav main-menu">
					<?php
					wp_nav_menu(
						array(
							'menu' => $settings['nav_menu'],
							'menu_class' => 'main-menu__list',
							'walker'         => class_exists('\Layerdrops\Ostech\Megamenu\Walker_Nav_Menu') ? new \Layerdrops\Ostech\Megamenu\Walker_Nav_Menu : '',
						)
					);
					?>
				</nav><!-- /.main-header__nav -->
				<div class="main-header__right">
					<div class="mobile-nav__btn mobile-nav__toggler">
						<span></span>
						<span></span>
						<span></span>
					</div><!-- /.mobile-nav__toggler -->
					<?php if (('yes' == $search_status)) : ?>
						<a href="#" class="search-toggler main-header__search">
							<i class="ostech-icons-two-search" aria-hidden="true"></i>
						</a><!-- /.search-toggler -->
					<?php endif; ?>
					<?php if ('yes' == $cart_status && class_exists('WooCommerce')) : ?>
						<a href="<?php echo esc_url(wc_get_cart_url()); ?>" class="main-header__cart">
							<i class="ostech-icons-two-cart" aria-hidden="true"></i>
							<?php if (!is_null(WC()->cart)) : ?>
								<span class="main-header__cart__quantity" id="ostech-cart-count"><?php echo esc_html(WC()->cart->cart_contents_count); ?></span>
							<?php endif; ?>
						</a><!-- /.search-toggler -->
					<?php endif; ?>
					<?php if (!empty($settings['button_label'])) : ?>
						<a href="<?php echo esc_url($settings['button_url']['url']); ?>" class="ostech-btn ostech-btn--icon">
							<span><?php echo esc_html($settings['button_label']); ?><span class="ostech-btn--icon__icon">
									<i class="ostech-icons-two-up-right-arrow"></i>
								</span>
							</span>
						</a><!-- /.thm-btn main-header__btn -->
					<?php endif; ?>
				</div><!-- /.main-header__right -->
			</div><!-- /.main-header__inner -->
		</div><!-- /.container-fluid -->
	</header><!-- /.main-header -->
<?php endif; ?>

<?php if ('layout_five' === $settings['layout_type']) : ?>
	<header class="main-header main-header--five sticky-header sticky-header--normal">
		<div class="container-fluid">
			<div class="main-header__inner">
				<div class="main-header__logo">
					<a href="<?php echo esc_url(home_url('/')); ?>">
						<img width="<?php echo esc_attr($settings['logo_dimension']['width']); ?>" height="<?php echo esc_attr($settings['logo_dimension']['height']); ?>" src="<?php echo esc_url($settings['light_logo']['url']); ?>" alt="<?php echo esc_attr(get_bloginfo('name')); ?>">
					</a>
				</div><!-- /.main-header__logo -->
				<nav class="main-header__nav main-menu">
					<?php
					wp_nav_menu(
						array(
							'menu' => $settings['nav_menu'],
							'menu_class' => 'main-menu__list',
							'walker'         => class_exists('\Layerdrops\Ostech\Megamenu\Walker_Nav_Menu') ? new \Layerdrops\Ostech\Megamenu\Walker_Nav_Menu : '',
						)
					);
					?>
				</nav><!-- /.main-header__nav -->
				<div class="main-header__right">
					<div class="mobile-nav__btn mobile-nav__toggler">
						<span></span>
						<span></span>
						<span></span>
					</div><!-- /.mobile-nav__toggler -->
					<?php if (('yes' == $search_status)) : ?>
						<a href="#" class="search-toggler main-header__search">
							<i class="ostech-icons-two-search" aria-hidden="true"></i>
						</a><!-- /.search-toggler -->
					<?php endif; ?>
					<?php if ('yes' == $cart_status && class_exists('WooCommerce')) : ?>
						<a href="<?php echo esc_url(wc_get_cart_url()); ?>" class="main-header__cart">
							<i class="ostech-icons-two-cart" aria-hidden="true"></i>
							<?php if (!is_null(WC()->cart)) : ?>
								<span class="main-header__cart__quantity" id="ostech-cart-count"><?php echo esc_html(WC()->cart->cart_contents_count); ?></span>
							<?php endif; ?>
						</a><!-- /.search-toggler -->
					<?php endif; ?>
					<?php if (!empty($settings['button_label'])) : ?>
						<a href="<?php echo esc_url($settings['button_url']['url']); ?>" class="ostech-btn ostech-btn--icon">
							<span><?php echo esc_html($settings['button_label']); ?><span class="ostech-btn--icon__icon">
									<i class="ostech-icons-two-up-right-arrow"></i>
								</span>
							</span>
						</a><!-- /.thm-btn main-header__btn -->
					<?php endif; ?>

					<a href="#" class="main-header--five__toggler">
						<div class="main-header--five__toggler__wrapper">
							<span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span>
						</div>
					</a>

				</div><!-- /.main-header__right -->
			</div><!-- /.main-header__inner -->
		</div><!-- /.container-fluid -->
	</header><!-- /.main-header -->
<?php endif; ?>
<div class="mobile-nav__wrapper">
	<div class="mobile-nav__overlay mobile-nav__toggler"></div>
	<!-- /.mobile-nav__overlay -->
	<div class="mobile-nav__content">
		<span class="mobile-nav__close mobile-nav__toggler"><i class="fa fa-times"></i></span>

		<div class="logo-box logo-retina">
			<a href="<?php echo esc_url(home_url('/')); ?>" aria-label="logo image">
				<img width="<?php echo esc_attr($settings['logo_dimension']['width']); ?>" height="<?php echo esc_attr($settings['logo_dimension']['height']); ?>" src="<?php echo esc_attr($settings['mobile_menu_logo']['url']); ?>" alt="<?php echo esc_attr(get_bloginfo('name')); ?>" />
			</a>
		</div>
		<!-- /.logo-box -->
		<div class="mobile-nav__container"></div>
		<!-- /.mobile-nav__container -->
		<ul class="mobile-nav__contact list-unstyled ml-0">
			<?php if ($settings['mobile_email']) : ?>
				<li>
					<i class="fa fa-envelope"></i>
					<a href="mailto:<?php echo esc_attr($settings['mobile_email']); ?>"><?php echo esc_html($settings['mobile_email']); ?></a>
				</li>
			<?php endif; ?>
			<?php if ($settings['mobile_phone']) : ?>
				<li>
					<i class="fa fa-phone-alt"></i>
					<a href="tel:<?php echo esc_attr(str_replace(' ', '-', $settings['mobile_phone'])); ?>">
						<?php echo esc_html($settings['mobile_phone']); ?>
					</a>
				</li>
			<?php endif; ?>
		</ul><!-- /.mobile-nav__contact -->
		<div class="mobile-nav__top">
			<div class="mobile-nav__social">
				<?php foreach ($settings['mobile_menu_social_icons'] as $social_icon) : ?>
					<a href="<?php echo esc_url($social_icon['social_url']['url']); ?>" class="fab <?php echo esc_attr($social_icon['social_icon']); ?>"></a>
				<?php endforeach; ?>
			</div><!-- /.mobile-nav__social -->
		</div><!-- /.mobile-nav__top -->

	</div>
	<!-- /.mobile-nav__content -->
</div>

<div class="search-popup">
	<div class="search-popup__overlay search-toggler"></div>
	<!-- /.search-popup__overlay -->
	<div class="search-popup__content">
		<form role="search" method="get" class="search-popup__form" action="<?php echo esc_url(home_url('/')); ?>">
			<input name="s" type="text" id="search" placeholder="<?php echo esc_html__("Search Here...", 'ostech-addon'); ?>" />
			<button type="submit" aria-label="search submit" class="ostech-btn">
				<span class="ostech-btn__shape"></span><span class="ostech-btn__shape"></span><span class="ostech-btn__shape"></span><span class="ostech-btn__shape"></span>
				<span class="ostech-btn__text"><i class="icon-search"></i></span>
			</button>
		</form>
	</div>
	<!-- /.search-popup__content -->
</div>
<!-- /.search-popup -->


<?php $ostech_back_to_top_status = get_theme_mod('scroll_to_top', 'no'); ?>
<?php if ('yes' === $ostech_back_to_top_status) : ?>
	<!-- back-to-top-start -->
	<a href="#" data-target="html" class="scroll-to-target scroll-to-top">
		<span class="scroll-to-top__text"><?php echo esc_html(get_theme_mod("scroll_to_top_text", false)); ?></span>
		<span class="scroll-to-top__wrapper"><span class="scroll-to-top__inner"></span></span>
	</a>
<?php endif; ?>