{{ header }}
<div class="container layer-category">
    <div class="layered-navigation-block"></div>
    <div class="ajax-loader">
        <img src="{{ module_oclayerednavigation_loader_img }}" alt="" />
    </div>
    <ul class="breadcrumb">
        {% for breadcrumb in breadcrumbs %}
            <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
        {% endfor %}
    </ul>
    <div class="row">{{ column_left }}
        {% if column_left and column_right %}
            {% set class = 'col-md-6 col-sm-12' %}
        {% elseif column_left or column_right %}
            {% set class = 'col-md-9 col-sm-12' %}
        {% else %}
            {% set class = 'col-sm-12' %}
        {% endif %}
        <div id="content" class="{{ class }}">{{ content_top }}
			<div class="category-info">
            <h2 class="category-name">{{ heading_title }}</h2>
            {% if thumb or description %}
				{% if thumb %}
					<div class="catgory-thumb"><img src="{{ thumb }}" alt="{{ heading_title }}" title="{{ heading_title }}" class="img-thumbnail" /></div>
				{% endif %}
				{% if description %}
					{{ description }}
				{% endif %}
            {% endif %}
			</div>
            {% if categories %}
                <h3 class="refine-category">{{ text_refine }}</h3>
                {% if categories|length <= 5 %}
					<ul>
						{% for category in categories %}
							<li><a href="{{ category.href }}">{{ category.name }}</a></li>
						{% endfor %}
					</ul>
                {% else %}
                    <div class="row"> {% for category in categories|batch((categories|length / 4)|round(1, 'ceil')) %}
                        <div class="col-sm-3">
                            <ul>
                                {% for category in categories %}
                                    <li><a href="{{ category.href }}">{{ category.name }}</a></li>
                                {% endfor %}
                            </ul>
                        </div>
                        {% endfor %} </div>
                    <br />
                {% endif %}
            {% endif %}
            <div class="custom-category">
                {% if products %}
                <div class="category-compare"><a href="{{ compare }}" id="compare-total">{{ text_compare }}</a></div>
				<div class="toolbar">
					<div class="col-md-2 toolbar3 pull-left">
                        <div class="btn-group">
                            <button type="button" id="list-view" class="btn btn-default"></button>
                            <button type="button" id="grid-view" class="btn btn-default"></button>
                        </div>
                    </div>
					<div class="col-md-2 toolbar2 pull-right">
                        <select id="input-limit" class="form-control" onchange="oclayerednavigationajax.filter(this.value)">
							{% for limits in limits %}
								{% if limits.value == limit %}
									<option value="{{ limits.href }}" selected="selected">{{ text_limit~limits.text }}</option>
								{% else %}
									<option value="{{ limits.href }}">{{ text_limit~limits.text }}</option>
								{% endif %}
							{% endfor %}
						</select>
                    </div>
					<div class="col-md-3 toolbar1 pull-right">
                        <select id="input-sort" class="form-control" onchange="oclayerednavigationajax.filter(this.value)">
							{% for sorts in sorts %}
								{% if sorts.value == '%s-%s'|format(sort, order) %}
									<option value="{{ sorts.href }}" selected="selected">{{ text_sort~sorts.text }}</option>
								{% else %}
									<option value="{{ sorts.href }}">{{ text_sort~sorts.text }}</option>
								{% endif %}
							{% endfor %}
						</select>
                    </div>
				</div>
                <div class="custom-products">
                    {% for product in products %}
                    <div class="product-layout product-list col-xs-12">
                        <div class="product-thumb">
							<div class="item-inner">
								<div class="image">
									<a href="{{ product.href }}">
										<img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive" />
										{% if product.rotator_image %}<img class="img-r" src="{{ product.rotator_image }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive" />{% endif %}
									</a>
									{% if product.special %}
										<div class="label-product label_sale">{{ text_label_sale }}</div>
									{% endif %}
									{% if product.is_new %}
										<div class="label-product label_new">{{ text_label_new }}</div>
									{% endif %}
									<div class="actions">
										<div class="add-to-links">
											<div class="wishlist">
												<button type="button" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><span>{{ button_wishlist }}</span></button>
											</div>
											<div class="compare">
												<button type="button" title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><span>{{ button_compare }}</span></button>
											</div>
											<div class="qv-button-container">
												<button class="btn-quickview" type="button" data-toggle="tooltip" title="{{ button_quickview }}" onclick="ocquickview.ajaxView('{{ product.href }}')"><i class="zmdi zmdi-search zmdi-hc-fw"></i><span>{{ button_quickview }}</span></button>
											</div>
										</div>
									</div>
								</div>
								<div class="caption">
									{% if product.manufacturer %}
									<p class="manufacture-product">
										<a href="{{ product.manufacturers }}">{{ product.manufacturer }}</a>
									</p>
									{% endif %}
									<h4 class="product-name"><a href="{{ product.href }}">{{ product.name }}</a></h4> 
									{% if product.rating %}
										<div class="ratings">
											<div class="rating-box">
											{% for i in 0..5 %}
												{% if product.rating == i %}
												{% set class_r = "rating"~i %}
												<div class="{{ class_r }}">rating</div>
												{% endif %}
											{% endfor %}
											</div>
										</div>					
									{% endif %}
									{% if product.price %}
										<p class="price">
										{% if not product.special %}
											{{ product.price }}
										{% else %}
											<span class="price-old">{{ product.price }}</span><span class="price-new">{{ product.special }}</span>						  
										{% endif %}
										{% if product.tax %}
											<span class="price-tax">{{ text_tax }} {{ product.tax }}</span>
										{% endif %}
										</p>
									{% endif %}
									<p class="product-des">{{ product.description }}</p>
									<div class="cart">
										<button type="button" title="{{ button_cart }}" onclick="cart.add('{{ product.product_id }}', '{{ product.minimum }}')"><span>{{ button_cart }}</span></button>
									</div>
								</div>
							</div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
                <div class="row toolbar4">
                    <div class="col-sm-6 text-left">{{ pagination }}</div>
                    <div class="col-sm-6 text-right">{{ results }}</div>
                </div>
                {% endif %}
                {% if not categories and not products %}
                    <p class="text_empty">{{ text_empty }}</p>
                    <div class="buttons">
                        <div class="pull-right"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
                    </div>
                {% endif %}
            </div>
            {{ content_bottom }}</div>
        {{ column_right }}</div>
</div>
{{ footer }}
