<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">
<head>
<meta charset="UTF-8" />
<title><?php echo $title; ?></title>
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content= "<?php echo $keywords; ?>" />
<?php } ?>
  <base href="<?php echo $base; ?>" />
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src="https://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
  <script src="catalog/view/javascript/jquery/jquery-2.1.1.min.js" type="text/javascript"></script>
  <link href="catalog/view/javascript/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />
  <script src="catalog/view/javascript/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
  <link href="catalog/view/javascript/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  <link href="catalog/view/javascript/jquery/owl-carousel/owl.carousel.css" type="text/css" rel="stylesheet" media="screen"/>
  <link href="catalog/view/javascript/jquery/owl-carousel/owl.transitions.css" type="text/css" rel="stylesheet" media="screen"/>
  <script src="catalog/view/javascript/jquery/owl-carousel/owl.carousel.min.js" type="text/javascript"></script>
  <link href="catalog/view/javascript/pe-icon-7-stroke/css/helper.css" rel="stylesheet" type="text/css"/>
  <link href="catalog/view/javascript/pe-icon-7-stroke/css/pe-icon-7-stroke.css" rel="stylesheet" type="text/css"/>
  <script src="catalog/view/javascript/script.js" type="text/javascript"></script>
  <link href="catalog/view/theme/brech/stylesheet/jquery.lightbox-0.5.css" rel="stylesheet">
  <script src="catalog/view/javascript/jquery.lightbox-0.5.min.js" type="text/javascript"></script>
  <script src="catalog/view/javascript/slide.js" type="text/javascript"></script>
  <!--<script src="catalog/view/javascript/jquery/jquery-ui.js" type="text/javascript"></script>
  <link href="catalog/view/javascript/jquery/jquery-ui.css" rel="stylesheet" type="text/css" />-->
  <script type="text/javascript" src="catalog/view/javascript/bootstrap/js/bootstrap-datepicker-ru.min.js"></script>
  <link rel="stylesheet" href="catalog/view/javascript/bootstrap/css/bootstrap-datepicker3.css"/>
  <link href="catalog/view/theme/brech/stylesheet/stylesheet-15-11-16.css" rel="stylesheet">
  <?php foreach ($styles as $style) { ?>
  <link href="<?php echo $style['href']; ?>" type="text/css" rel="<?php echo $style['rel']; ?>" media="<?php echo $style['media']; ?>" />
  <?php } ?>
  <script src="catalog/view/javascript/common.js" type="text/javascript"></script>
  <?php foreach ($links as $link) { ?>
  <link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
  <?php } ?>
  <?php foreach ($scripts as $script) { ?>
  <script src="<?php echo $script; ?>" type="text/javascript"></script>
  <?php } ?>
  <?php foreach ($analytics as $analytic) { ?>
  <?php echo $analytic; ?>
  <?php } ?>
</head>
<body class="<?php echo $class; ?>">
<header>
  <div class="container">
    <div class="row">
      <div class="visible-xs col-xs-offset-5 col-sm-offset-5 visible-sm col-md-2 logo">
        <?php if ($logo) { ?>
        <a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" class="img-responsive" /></a>
        <?php } else { ?>
        <h1><a href="<?php echo $home; ?>"><?php echo $name; ?></a></h1>
        <?php } ?>
      </div>
      <div class="top visible-xs list-unstyled nopadding col-xs-10">
        <div class="language pull-left"><?php echo $language; ?></div>
        <div class="cart-top pull-left">
          <a href="<?php echo $shopping_cart; ?>" title="<?php echo $text_shopping_cart; ?>" class="pe-7s-cart">
            <span class="hidden-xs whishheader"></span>
            <div class="number-items"><span>(<?php echo $cart_products; ?>)</span></div>
          </a>
        </div>
        <div class="login-top pull-left"><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a></div>
        <div class="clearfix"></div>
      </div>
      <div class="nav-conteiner-1">
        <i class="visible-xs fa fa-bars" aria-hidden="true" id="menu-btn"></i>
        <nav class="nav">
          <ul class="col-sm-6 col-md-5 list-unstyled nopadding col-menu-1">
            <?php foreach ($categories as $category) { ?>
            <?php if ($category['sort_order'] < 100) { ?>
              <?php if (!$category['children']) { ?>
                <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
              <?php } else { ?>
                <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
                  <ul class="list-unstyled nopadding menu-level2">
                    <?php foreach ($category['children'] as $children) { ?>
                      <?php if (!$children['children'] && !$children['categories']) { ?>
                        <li><a href="<?php echo $children['href']; ?>"><?php echo $children['name']; ?></a></li>
                      <?php } else { ?>
                        <li><a href="<?php echo $children['href']; ?>"><?php echo $children['name']; ?></a>
                          <ul class="list-unstyled nopadding menu-level2 menu-level3">
                            <?php foreach($children['categories'] as $cat) { ?>
                              <li><a href="<?php echo $cat['href']; ?>"><?php echo $cat['name']; ?></a></li>
                            <?php } ?>
                            <?php foreach($children['children'] as $children2) { ?>
                              <li><a href="<?php echo $children2['href']; ?>"><?php echo $children2['name']; ?></a></li>
                            <?php } ?>
                          </ul>
                        </li>
                      <?php } ?>
                    <?php } ?>
                  </ul>
                </li>
              <?php } ?>
              <?php } ?>
            <?php } ?>
          </ul>
          <div class="hidden-xs hidden-sm col-md-2 logo">
            <?php if ($logo) { ?>
            <a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" class="img-responsive" /></a>
            <?php } else { ?>
            <h1><a href="<?php echo $home; ?>"><?php echo $name; ?></a></h1>
            <?php } ?>
          </div>
          <div class="top hidden-xs col-sm-6 col-md-5 list-unstyled nopadding">
            <div class="language pull-right"><?php echo $language; ?></div>
            <div class="cart-top pull-right">
              <a href="<?php echo $shopping_cart; ?>" title="<?php echo $text_shopping_cart; ?>" class="pe-7s-cart">
                <span class="hidden-xs whishheader"></span>

                <div <?php if($cart_products <= 0) { echo 'style="display: none"'; } ?> class="number-items"><span>(<amount><?php echo $cart_products; ?></amount>)</span></div>

              </a>
            </div>
            <div class="login-top pull-right"><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a></div>
            <div class="clearfix"></div>
          </div>
          <ul class="col-sm-6 col-md-5 list-unstyled nopadding col-menu-2">
            <?php foreach ($categories as $category) { ?>
            <?php if ($category['sort_order'] >= 100) { ?>
            <?php if (!$category['children']) { ?>
            <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
            <?php } else { ?>
            <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
              <ul class="list-unstyled nopadding menu-level2">
                <?php foreach ($category['children'] as $children) { ?>
                <?php if (!$children['children']) { ?>
                <li><a href="<?php echo $children['href']; ?>"><?php echo $children['name']; ?></a></li>
                <?php } else { ?>
                <li><a href="<?php echo $children['href']; ?>"><?php echo $children['name']; ?></a>
                  <ul class="list-unstyled nopadding menu-level2 menu-level3">
                    <?php foreach($children['children'] as $children2) { ?>
                    <li><a href="<?php echo $children2['href']; ?>"><?php echo $children2['name']; ?></a></li>
                    <?php } ?>
                  </ul>
                </li>
                <?php } ?>
                <?php } ?>
              </ul>
            </li>
            <?php } ?>
            <?php } ?>
            <?php } ?>
          </ul>
        </nav>
      </div>

    </div>
  </div>
</header>