<!DOCTYPE html>
<html lang="en">

	<head>
		{% block head %}
			<meta charset="UTF-8">
			<meta http-equiv="X-UA-Compatible" content="IE=edge">
			<meta name="viewport" content="width=device-width, initial-scale=1.0">
			<link rel="preconnect" href="https://fonts.googleapis.com">
			<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
			<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;700;900&display=swap" rel="stylesheet">
			{% block stylesheets %}
				<link href={{ asset('css/base.css') }} rel="stylesheet">
			{% endblock %}
			{% block javascripts %}
				<script src={{ asset('js/cookie.js') }}></script>
				<script type="text/javascript" src="{{ asset('js/jquery.min.js') }}"></script>
			{% endblock %}
			<title>IceLAND</title>
		{% endblock %}
	</head>

	<body>
  <div class="root">
		{% block header %}
			<header>
				<div class='logo'>
				<p class="title" >
					<a href="/">IceLand</a>
				</p>
				</div>
				<div class='nav'>
					<div class='nav__item'>
						<a href="/">Katalogs</a>
					</div>
					<div class='nav__item'>
						<a href="/contacts">Kontakti</a>
					</div>
					<div class='nav__item'>
						<a href="/feedback">Saziņa</a>
					</div>
					<div class='nav__item'>
						<a href="/about">Par mums</a>
					</div>
					<div class='nav__item'>
						<a href="/reviews">Atsauksmes</a>
					</div>
					<div class='nav__item nav__end'>
					<a href="/cart">
						<img class="cart-img" src="/img/cart.png" alt="none" />
					</a>
					<a href="/account">
						<img class="cart-img" src="/img/account.png" alt="none" />
					</a>
				</div>
				</div>

			</header>
		{% endblock %}
		<div class="main">
		{% block content %}{% endblock %}
		</div>
		{% block footer %}
		<footer class="footer">
			<div class="footer__block">
				<p>@ 2022-2023 SVIAT N | Visas tiesības aizsargatas</p>
			</div>
			<div class="footer__block">
				<a href="https://docs.google.com/document/d/1gRmrUdD52K-EcImUDYtN8boKjQl0uBYCvVVT1CELooI/edit?usp=sharing" target="_blank"><p>Lietošanas noteikumi</p> </a>
				<a href="https://docs.google.com/document/d/1gRmrUdD52K-EcImUDYtN8boKjQl0uBYCvVVT1CELooI/edit?usp=sharing" target="_blank"><p>Privātpolitika</p> </a>
			</div>
			<div class="footer__block">
				<a href="https://www.tiktok.com/" target="_blank"><img class="social-icon" src="/img/tiktok.png" alt="TikTok"></a>
				<a href="https://www.facebook.com/" target="_blank"><img class="social-icon" src="/img/facebook.png" alt="Facebook"></a>
				<a href="https://www.instagram.com/" target="_blank"><img class="social-icon" src="/img/instagram.png" alt="Instagram"></a>
				<p>info@iceland.com</p>
			</div>
		</footer>
{% endblock %}
        </div>
			
	<script>

		if (getCookie('cart_id') != ""){
			console.log('user has cart');
		} else {
			fetch('/createNewCart')
			.then(response => response.json())
			.then(result => {
				console.log(result);
				setCookie('cart_id', result.id)
			})
		}
	</script>
	</body>
</html>
