<?php
/**
 * Header Navbar (bootstrap5)
 *
 * @package Magazine Style
 * @since 1.1.0
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

$container = get_theme_mod( 'magazinestyle_container_type' );
?>

<nav id="main-nav" class="navbar navbar-expand-md navbar-dark bg-primary magazinestyletopmenu" aria-labelledby="main-nav-label" <?php magazinestyle_do_schema( 'nav' ); ?>>

	<h2 id="main-nav-label" class="screen-reader-text">
		<?php esc_html_e( 'Main Navigation', 'magazine-style' ); ?>
	</h2>


	<div class="<?php echo esc_attr( $container ); ?>">
		
		<button
			class="navbar-toggler order-first"
			type="button"
			data-bs-toggle="collapse"
			data-bs-target="#navbarNavDropdown"
			aria-controls="navbarNavDropdown"
			aria-expanded="false"
			aria-label="<?php esc_attr_e( 'Toggle navigation', 'magazine-style' ); ?>"
		>
			<span class="navbar-toggler-icon"></span>
		</button>
<div class="order-last">
<?php if (get_theme_mod( 'magazinestyle_topside' ) !== 'disable'){
		get_template_part( 'global-templates/navbar-side' ); 
		}
		?></div>
		<!-- The WordPress Menu goes here -->
		<?php
		wp_nav_menu(
			array(
				'theme_location'  => 'magazinestyle-top-menu',
				'container_class' => 'collapse navbar-collapse order-first',
				'container_id'    => 'navbarNavDropdown',
				'fallback_cb' => 'magazinestyle_primary_menu_fallback',
				'menu_class'      => 'navbar-nav',
				'menu_id'         => 'main-menu',
				'depth'           => 0,
				'walker'          => new magazinestyle_WP_Bootstrap_Navwalker(),
			)
		);
		?>
<!-- Your site branding in the menu -->
		

	</div><!-- .container(-fluid) -->

</nav><!-- #main-nav -->
