<!DOCTYPE html>
<html lang="pt-br">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<link href="<?php echo show_file_link(SYS_ICONE); ?>" rel="icon" type="image/png">
		<link rel="manifest" href="<?php echo show_file_link("/manifest.json"); ?>">

		<title><?php echo (!empty($title) ? $title." | ".SYS_NAME : SYS_NAME); ?></title>

		<meta property="og:url"         content="<?php echo (isset($_SERVER["HTTPS"]) ? "https" : "http")."://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; ?>" />
		<meta property="og:type"        content="website" />
		<meta property="og:title"       content="<?php echo (!empty($product_title) ? $product_title : $title." | ".SYS_NAME); ?>" />
		<meta property="og:description" content="<?php echo (!empty($product_description) ? $product_description : "Aproveite os nossos itens com promoções exclusivas!"); ?>" />
		<meta property="og:image"       content="<?php echo (!empty($product_image) ? $product_image : show_url(SYS_LOGO)); ?>" />

		<link href="<?php echo show_file_link("/assets/fontawesome/releases/v6.2.0/css/all.css"); ?>" rel="stylesheet" type="text/css">
		<link href="<?php echo show_file_link("/assets/fontawesome/releases/v6.2.0/css/sharp-solid.css"); ?>" rel="stylesheet" type="text/css">
		<link href="<?php echo show_file_link("/assets/fonts/fonts.css"); ?>" rel="stylesheet">
		<link href="<?php echo show_file_link("/assets/custom/css/styles.css"); ?>" rel="stylesheet">
		<link href="<?php echo show_file_link("/assets/custom/css/custom.css"); ?>" rel="stylesheet">
		<link href="<?php echo show_file_link("/assets/jquery-toast/css/jquery.toast.css"); ?>" rel="stylesheet">

		<!-- Owl Carousel CSS -->
		<link rel="stylesheet" href="<?php echo show_file_link("/assets/owl-carousel/owl.carousel.css"); ?>">
		<link rel="stylesheet" href="<?php echo show_file_link("/assets/owl-carousel/owl.theme.css"); ?>">

		<?php import_file(DIR_TEMPLATES."style.php"); ?>

		<script src="<?php echo show_file_link("/assets/jquery/jquery.min.js"); ?>"></script>
		<script src="<?php echo show_file_link("/assets/bootstrap/js/bootstrap.bundle.min.js"); ?>"></script>
		<script src="<?php echo show_file_link("/assets/jquery-toast/js/jquery.toast.js"); ?>"></script>
		<script src="<?php echo show_file_link("/assets/jquery-mask/jquery.mask.js"); ?>"></script>
		<script src="<?php echo show_file_link("/assets/custom/js/scripts.js"); ?>"></script>

		<!-- CKEditor JS -->
		<script src="<?php echo show_file_link("/assets/ckeditor/ckeditor.js"); ?>"></script>

		<!-- Owl Carousel JS -->
		<script src="<?php echo show_file_link("/assets/owl-carousel/owl.carousel.min.js"); ?>"></script>

		<script src="<?php echo show_file_link("/assets/custom/js/functions.js"); ?>"></script>

		<style>
			.link-produto{
				color: <?php echo TEXT_COLOR; ?> !important;
			}
			.link-produto:hover{
				color: <?php echo COLOR_PRIMARY; ?> !important;
			}

			body, p, span, h1, h2, h3, h4, h5, h6, label, strong{
				font-family: "Roboto Condensed" !important;
			}
		</style>
	</head>
	<body style="background-color: <?php echo BACKGROUND_COLOR; ?>;">
		<?php 

			$paginas = Connection::query("
				SELECT * FROM pagina 
				WHERE 
					local_pagina = 'Menu Superior'
			");

		?>

		<nav id="navbar-main">
			<div class="navbar navbar-expand-md navbar-dark navbar-degrade">
				<a class="navbar-brand" href="<?php echo show_link("/"); ?>">
					<?php if (PRESENTATION_STANDARD == 1): ?>
						<img src="<?php echo show_file_link(SYS_LOGO); ?>" alt="logo" style="max-width: 150px; max-height: 50px; width: auto; height: auto;">
						&nbsp; 
						<span class="d-md-block d-none">
							<?php echo SYS_NAME; ?>
						</span>
					<?php elseif (PRESENTATION_STANDARD == 2): ?>
						<img src="<?php echo show_file_link(SYS_LOGO); ?>" alt="logo" style="max-width: 175x; max-height: 50px; width: auto; height: auto;">
					<?php else: ?>
						<?php echo SYS_NAME; ?>
					<?php endif; ?>
				</a>

				<?php if ($paginas->rowCount()): ?>	
					<a 
						href="#" 
						class="navbar-toggler"
						data-toggle="collapse" 
						data-target="#navbar-top" 
						aria-controls="navbar-top" 
						aria-expanded="false" 
						aria-label="Toggle navigation"
					>
						<i class="fa-solid fa-bars"></i>
					</a>

					<div class="collapse navbar-collapse" id="navbar-top">
						<ul class="navbar-nav ml-auto">
							<?php foreach ($paginas as $i): ?>
								<li class="nav-item">
									<a href="<?php echo show_link("/pagina/?pagina=".urlencode($i->slug_pagina)); ?>" class="nav-link">
										<?php echo $i->titulo_pagina; ?>	
									</a>
								</li>
							<?php endforeach ?>
						</ul>
					</div>
				<?php endif; ?>
			</div>
		</nav>
		<nav id="navbar-menu">
			<div class="navbar navbar-expand-lg navbar-dark navbar-degrade">		
				<ul class="navbar-nav" style="flex-direction: row;">
					<li class="nav-item">
						<a href="<?php echo show_link("/"); ?>" class="nav-link">Início</a>
					</li>
					<li class="nav-item">
						<a href="<?php echo show_link("/pesquisa-produtos/"); ?>" class="nav-link">Produtos</a>
					</li>
					<li class="nav-item">
						<a href="<?php echo show_link("/pesquisa-lojas/"); ?>" class="nav-link">Lojas</a>
					</li>

					<?php if (Session::isRegistered("id_usuario") == false): ?>
						<li class="nav-item dropdown">
							<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
								Cadastre-se
							</a>

							<div class="dropdown-menu" style="z-index: 1000; position: absolute;">
								<a href="<?php echo show_link("/cadastro-usuario/"); ?>" class="dropdown-item">
									Como Pessoa
								</a>

								<div class="dropdown-divider"></div>

								<a href="<?php echo show_link("/cadastro-empresa/"); ?>" class="dropdown-item">
									Como Loja
								</a>
							</div>
						</li>

						<li class="nav-item">
							<a href="<?php echo show_link("/login/"); ?>" class="nav-link">
								Entrar
							</a>
						</li>
					<?php else: ?>
						<li class="nav-item">
							<a href="<?php echo show_link("/dashboard/"); ?>" class="nav-link">
								Meu Painel
							</a>
						</li>
					<?php endif; ?>
				</ul>

				<ul class="navbar-nav text-right ml-auto">
					<li class="nav-item" style="margin: 10px;">
						<a href="#" id="btn-search">
							<i class="icon icon-search"></i>
						</a>
					</li>
				</ul>
			</div>

			<div id="navbar-search" class="navbar slideup">
				<form action="<?php echo show_link("/pesquisa-produtos/"); ?>" method="get" class="form-navbar-search">
					<div class="input-group">
						<input type="text" name="pesquisa" id="search-navbar" class="form-control" placeholder="Pesquisa" autocomplete="off" value="<?php echo $_GET["pesquisa"]; ?>">
						<input type="hidden" name="h" value="0">
						<div class="input-group-append">
							<button type="submit" class="btn btn-white-search">
								<i class="fa-solid fa-search"></i>
							</button>
						</div>
					</div>
				</form>
			</div>
		</nav>