<?php if ($this['widgets']->count('toolbar-l + toolbar-r + search')) : ?>
<div id="tm-toolbar" class="tm-toolbar">
  <div class="uk-container uk-container-center uk-clearfix">

    <?php if ($this['widgets']->count('toolbar-l')) : ?>
    <div class="uk-float-left"><?php echo $this['widgets']->render('toolbar-l'); ?></div>
    <?php endif; ?>

    <?php if ($this['widgets']->count('search')) : ?>
    <div class="uk-float-right uk-hidden-small"><?php echo $this['widgets']->render('search'); ?></div>
    <?php endif; ?>

    <?php if ($this['widgets']->count('toolbar-r')) : ?>
    <div class="uk-float-right"><?php echo $this['widgets']->render('toolbar-r'); ?></div>
    <?php endif; ?>

  </div>
</div>
<?php endif; ?>

<div class="tm-header-container" <?php if ($this['config']->get('sticky_mainbar')) echo 'data-uk-sticky'; if ($this['config']->get('sticky_on_scrollup')) echo '="{showup: true, animation: \'uk-animation-slide-top\'}"' ?>>
  <div class="<?php if ($this['widgets']->count('call-action')) : ?>tm-header-call<?php endif; ?>">
  <div class="tm-header uk-flex uk-flex-middle uk-flex-space-between">

      <?php if ($this['widgets']->count('logo')) : ?>
      <a class="tm-logo uk-hidden-small" href="<?php echo $this['config']->get('site_url'); ?>"><?php echo $this['widgets']->render('logo'); ?></a>
      <?php endif; ?>

      <?php if ($this['widgets']->count('logo-small')) : ?>
      <a class="tm-logo-small uk-visible-small" href="<?php echo $this['config']->get('site_url'); ?>"><?php echo $this['widgets']->render('logo-small'); ?></a>
      <?php endif; ?>

      <?php if ($this['widgets']->count('menu + mega-menu + headerbar + offcanvas')) : ?>  
      <div class="uk-flex uk-flex-middle uk-flex-space-between">

        <?php if ($this['widgets']->count('headerbar')) : ?>
        <div class="tm-headerbar">
            <?php echo $this['widgets']->render('headerbar'); ?>
        </div>
        <?php endif; ?>

        <?php if ($this['widgets']->count('menu + mega-menu + offcanvas')) : ?>
        <a href="#offcanvas" class="uk-navbar-toggle" data-uk-offcanvas="{mode:'push'}"></a>
        <?php endif; ?>

      </div>
      <?php endif; ?>
  </div>
  </div>

  <?php if ($this['widgets']->count('minibar')) : ?>
  <div class="tm-minibar">
      <?php echo $this['widgets']->render('minibar'); ?>
  </div>
  <?php endif; ?>
</div>