<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="content">
 *
 * @package agapi
 */
$theme_options_data = theme_options_data();

?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="profile" href="http://gmpg.org/xfn/11">
	<link rel="pingback" href="<?php esc_url( bloginfo( 'pingback_url' ) ); ?>">
	<?php
    $custom_sticky = $show_line = '';
    if ( isset( $theme_options_data['thim_config_att_sticky'] ) && $theme_options_data['thim_config_att_sticky'] == 'sticky_custom' ) {
        $custom_sticky .= ' bg-custom-sticky';
    }
    if ( isset( $theme_options_data['thim_show_wave_line'] ) && $theme_options_data['thim_show_wave_line'] == 1 ) {
        $show_line .= 'show-wave-line';
    }
    if ( isset( $theme_options_data['thim_header_sticky'] ) && $theme_options_data['thim_header_sticky'] == 1 ) {
        $custom_sticky .= ' sticky-header';
    }

	wp_head();
	?>
</head>

<body <?php body_class(); ?>>

<div id="wrapper-container" class="wrapper-container">
	<nav class="visible-xs mobile-menu-container mobile-effect">
		<?php get_template_part( 'inc/header/mobile-menu' ); ?>
	</nav>
	<div class="content-pusher">

        <header id="masthead" class="site-header affix-top<?php echo esc_attr( $custom_sticky ); ?>">
            <?php
            $thim_width_left_top = 6;
            if ( isset( $theme_options_data['thim_width_left_top'] ) ) {
                $thim_width_left_top = $theme_options_data['thim_width_left_top'];
            }
            $thim_width_right_top = 12 - $thim_width_left_top;
            if ( isset( $theme_options_data['thim_topbar_show'] ) && $theme_options_data['thim_topbar_show'] == '1' ) {
                ?>
                <?php if ( ( is_active_sidebar( 'top_right_menu' ) ) || ( is_active_sidebar( 'top_left_menu' ) ) ) : ?>
                    <div class="top-header">
                        <?php
                        echo "<div class='container'><div class='row'>";
                        ?>
                        <?php if ( is_active_sidebar( 'top_left_menu' ) ) : ?>
                            <div class="col-sm-<?php echo esc_attr($thim_width_left_top); ?> top_left">
                                <ul class="top-left-menu">
                                    <?php dynamic_sidebar( 'top_left_menu' ); ?>
                                </ul>
                            </div><!-- col-sm-6 -->
                        <?php endif; ?>
                        <?php if ( is_active_sidebar( 'top_right_menu' ) ) : ?>
                            <div class="col-sm-<?php echo esc_attr($thim_width_right_top); ?> top_right">
                                <ul class="top-right-menu">
                                    <?php dynamic_sidebar( 'top_right_menu' ); ?>
                                </ul>
                            </div>
                        <?php endif; ?>
                        <?php
                        echo "</div></div>";
                        ?>
                    </div><!--End/div.top-->
                <?php
                endif;
            }
            ?>
        <div class="header_menu <?php echo esc_attr( $show_line ); ?>">
            <?php if ( isset( $theme_options_data['thim_show_dotted'] ) && $theme_options_data['thim_show_dotted'] == '1' ) {?>
                <div class="dotted"></div>
            <?php }?>
            <?php get_template_part( 'inc/header/header_v1' );?>
            <?php if ( isset( $theme_options_data['thim_show_wave_line'] ) && $theme_options_data['thim_show_wave_line'] == '1' ) {?>
                <div class="wave-separator"></div>
            <?php }
            ?>
        </div>

		</header>
        <div id="main-content">