<?php if (isset($_SERVER['HTTP_USER_AGENT']) && !strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') && strpos($_SERVER['HTTP_USER_AGENT'], 'Opera')) echo '<?xml version="1.0" encoding="UTF-8"?>'. "\n" ."<!-- This is here for the Old Opera mobile  -->"; ?>
<!DOCTYPE html>
<!-- OMFramework 2.4.1 Basic www.omframework.com -->
<!--[if IEMobile 7 ]>    <html class="no-js iem7"> <![endif]-->
<!--[if (gt IEMobile 7)|!(IEMobile)]><!--> <html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>"> <!--<![endif]-->
  <head>
    <meta charset="UTF-8" />
    <title><?php echo $title; ?></title>
    <base href="<?php echo $base; ?>" />

    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' name='viewport' />

    <?php if ($description) { ?>
    <meta name="description" content="<?php echo $description; ?>" />
    <?php } ?>
    <?php if ($keywords) { ?>
    <meta name="keywords" content="<?php echo $keywords; ?>" />
    <?php } ?>
    <?php if ($icon) { ?>
    <link href="<?php echo $icon; ?>" rel="icon" />
    <?php } ?>
    <?php foreach ($links as $link) { ?>
    <link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
    <?php } ?>
    <?php if (file_exists(DIR_TEMPLATE . $this->config->get('config_mobile_theme') . '/stylesheet/mobile2.scss')) { ?>
    <link rel="stylesheet" type="text/css" href="<?php echo 'catalog/view/theme/' . $this->config->get('config_mobile_theme') ?>/s.php?p=mobile2.scss" >
    <?php } else { ?>
    <link rel="stylesheet" type="text/css" href="catalog/view/theme/omf2/s.php?p=mobile2.scss" >
    <?php } ?>
    <?php foreach ($styles as $style) { ?>
    <link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
    <?php } ?>
    <script>
    document.cookie='resolution='+Math.max(screen.width,screen.height)+'; path=/';
    setTimeout(scrollTo, 0, 0, 1);</script>
    <?php if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != '') { ?>
    <script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
    <?php } else { ?>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
    <?php } ?>
    <link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />
<?php if (defined('VERSION') && (version_compare(VERSION, '1.5.5', '<') == true)) { ?>
    <script type="text/javascript" src="catalog/view/javascript/jquery/ui/external/jquery.cookie.js"></script>
<?php if (defined('VERSION') && (version_compare(VERSION, '1.5.2.1', '>') == true)) { ?>
    <script type="text/javascript" src="catalog/view/javascript/jquery/colorbox/jquery.colorbox.js"></script>
    <link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/colorbox/colorbox.css" media="screen" />
<?php } ?>
<?php } else { ?>
    <script type="text/javascript" src="catalog/view/javascript/jquery/jquery.total-storage.min.js"></script>
<?php } ?>
    <script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script>
    <script type="text/javascript" src="catalog/view/javascript/jquery/ajaxupload.js"></script>
    <script type="text/javascript" src="catalog/view/javascript/jquery/tabs.js"></script>
    <script type="text/javascript" src="catalog/view/javascript/common.js"></script>
    <?php foreach ($scripts as $script) { ?>
    <script type="text/javascript" src="<?php echo $script; ?>" data-no-instant></script>
    <?php } ?>
    <?php echo $google_analytics; ?>
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
    <script>
        $(document).ready(function() {
            $(window).scroll(function() {
                if ($(this).scrollTop() > 1){
                    $('#header').addClass("fixing");
                } else {
                    $('#header').removeClass("fixing");
                }
            });
            $('#categoryWrapper ul li a').each(function() {
                $(this).attr('data-href', $(this).attr('href'));
            });
        });
        function openCloseMenu() {
            $('#categoryWrapper').toggleClass('active');
            $('body').toggleClass('swiped');
        }
        function openCloseSubMenu(el) {
            if (el.siblings('ul').length) {
                if (el.siblings('ul').hasClass('opened')) {
                    location = el.attr('data-href');
                } else {
                    el.siblings('ul').addClass('opened');
                }
            } else {
                location = el.attr('data-href');
            }
        }
    </script>
  </head>
  <body class="body-body">
    <?php if ($categories) { ?>
        <div id="categoryWrapper">
            <ul class="nav">
                <?php foreach ($categories as $category) { ?>
                <li>
                    <a onclick="openCloseSubMenu($(this)); return false;" data-href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
                    <?php if ($category['children']) { ?>
                    <ul>
                        <?php foreach ($category['children'] as $child) { ?>
                        <li>
                            <a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a>
                        </li>
                        <?php } ?>
                    </ul>   
                    <?php } ?>
                </li>
                <?php } ?>
            </ul> 
        </div>
    <?php } ?>
    <div id="container">
      <div id="header">
        <?php if ($this->config->get('config_mobile_logo') && file_exists(DIR_IMAGE . $this->config->get('config_mobile_logo'))) {
            $mobile_logo = 'image/' . $this->config->get('config_mobile_logo');
        } else {
            $mobile_logo = $logo;
        } ?>
        <ul>
            <li><a onclick="openCloseMenu();" id="menuToggler"><i class="fa fa-bars"></i></a></li>
        </ul>
        <div id="logo"><a href="<?php echo $home; ?>"><img src="<?php echo $mobile_logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div>
        <ul>
          <?php /* ?><p><span id="welcome">
          <?php if (!$logged) { ?>
          <?php echo $text_welcome; ?>
          <?php } else { ?>
          <?php echo $text_logged; ?>
          <?php } ?>
          </span>
          </p><?php */ ?>
          <?php if ($logged) { ?>
            <li class="acc"><a href="<?php echo $account; ?>" id="account"><?php echo $text_logged; ?></a></li>
            <style type="text/css">
                .acc * {
                    font-size: 12px !important;
                }
            </style>
          <?php } else { ?>
            <li><a href="<?php echo $account; ?>" id="account"><i class="fa fa-user"></i></a></li>
          <?php } ?>
        <?php if (defined('VERSION') && (version_compare(VERSION, '1.5.2', '<') == true)) { ?>
                  <li><a href="<?php echo $cart; ?>" tabindex="2" id="cart" ><i class="fa fa-shopping-cart"></i><?php /* ?><?php echo $text_cart; ?> <?php */ ?><span style="font-size: 12px;margin-left: 5px;vertical-align: middle;" id="cart-total">(<?php echo $text_items_count; ?>)&#x200E;</span> </a></li>

        <?php } else { ?>
                  <li><a href="<?php echo $shopping_cart; ?>" tabindex="2" id="cart" ><i class="fa fa-shopping-cart"></i><?php /* ?><?php echo $text_shopping_cart; ?> <?php */ ?><span style="font-size: 12px;margin-left: 5px;vertical-align: middle;" id="cart-total">(<?php echo $text_items_count; ?>)&#x200E;</span> </a></li>
        <?php } ?>
        <?php if ( is_null($this->config->get('config_wishlist_disabled')) or (bool)$this->config->get('config_wishlist_disabled') == false) { ?>
            <li><a href="<?php echo $wishlist; ?>" id="wishlist-total"><i class="fa fa-heart"></i><?php //echo $text_wishlist; ?></a></li>
        <?php } ?>
            <?php if ((strrpos($route, "checkout") === false) && (strrpos($route, "account") === false)) { ?>
                    <li style="display:none"><a href="#search" tabindex="3" id="search_link" data-no-instant><i class="fa fa-search"></i><?php //echo $text_search_link; ?></a></li>
            <?php } else { ?>
                    <li style="display:none"><a href="index.php?route=product/search_mobile" tabindex="3" id="search_link"><i class="fa fa-search"></i><?php //echo $text_search_link; ?></a></li>
                </ul>
            <?php } ?>
        </ul>
      </div>
      <div id="main">
        <div id="notification"></div>
