{{ header }}
<div id="product-category" class="container layer-category">
    <div class="layered-navigation-block"></div>
    <div class="ajax-loader">
        <img src="{{ ajax_loader }}" alt="" />
    </div>
    <ul class="breadcrumb">
        {% for breadcrumb in breadcrumbs %}
            <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
        {% endfor %}
    </ul>
    <div class="row"><div class="col-order">{{ column_left }}
        {% if column_left and column_right %}
            {% set class = 'col-sm-6' %}
        {% 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="thumb"><img src="{{ thumb }}" alt="{{ heading_title }}" title="{{ heading_title }}" class="img-thumbnail" /></div>
					{% endif %}
						{% if description %}
							<div class="description">{{ description }}</div>
						{% endif %}
				{% endif %}
			</div>
            {% if categories %}
                <h3 class="refine-category">{{ text_refine }}</h3>
                {% if categories|length <= 5 %}
					<ul class="list-cate">
						{% 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 class="list-cate">
                                    {% for child in category %}
                                        <li><a href="{{ child.href }}">{{ child.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="modes toolbar3">
							{% if use_custom_view %}
								<button type="button" onclick="category_view.changeView('grid', 3, 'btn-grid-3')" class="btn btn-default btn-custom-view btn-grid btn-grid-3" data-toggle="tooltip" title="3">3</button>
								<button type="button" onclick="category_view.changeView('grid', 4, 'btn-grid-4')" class="btn btn-default btn-custom-view btn-grid btn-grid-4" data-toggle="tooltip" title="4">4</button>
								<button type="button" onclick="category_view.changeView('grid', 5, 'btn-grid-5')" class="btn btn-default btn-custom-view btn-grid btn-grid-5" data-toggle="tooltip" title="5">5</button>
								<button type="button" onclick="category_view.changeView('list', 0, 'btn-list')" class="btn btn-default btn-custom-view btn-list" data-toggle="tooltip" title="{{ button_list }}">{{ button_list }}</button>
								<input type="hidden" id="category-view-type" value="{{ category_view }}" />
								<input type="hidden" id="category-grid-cols" value="{{ grid_columns }}" />
							{% else %}
								<button type="button" id="grid-view" class="btn btn-default btn-grid"  title="{{ button_grid }}">{{ button_grid }}</button>
								<button type="button" id="list-view" class="btn btn-default btn-list"  title="{{ button_list }}">{{ button_list }}</button>
							{% endif %}
                         </div>
                        <div class="toolbar-amount toolbar4">
							<span>{{ results }}</span>
						</div>
                        <div class="sorter toolbar1">
							{% if use_layered %}
								<label  for="input-sort">{{ text_sort }}</label>
								<select id="input-sort" class="form-control" onchange="ocfilter.filter(this.value);">
									{% for sorts in ajax_sorts %}
										{% if sorts.value == '%s-%s'|format(sort, order) %}
											<option value="{{ sorts.href }}" selected="selected">{{ sorts.text }}</option>
										{% else %}
											<option value="{{ sorts.href }}">{{ sorts.text }}</option>
										{% endif %}
									{% endfor %}
								</select>
							{% else %}
								<label for="input-sort">{{ text_sort }}</label>
								<select id="input-sort" class="form-control" onchange="location = this.value;">
									{% for sorts in sorts %}
										{% if sorts.value == '%s-%s'|format(sort, order) %}
											<option value="{{ sorts.href }}" selected="selected">{{ sorts.text }}</option>
										{% else %}
											<option value="{{ sorts.href }}">{{ sorts.text }}</option>
										{% endif %}
									{% endfor %}
								</select>
							{% endif %}
                        </div>
                        <div class="limiter toolbar2">
							{% if use_layered %}
								<label for="input-limit">{{ text_limit }}</label>
								<select id="input-limit" class="form-control" onchange="ocfilter.filter(this.value);">
									{% for limits in ajax_limits %}
										{% if limits.value == limit %}
											<option value="{{ limits.href }}" selected="selected">{{ limits.text }}</option>
										{% else %}
											<option value="{{ limits.href }}">{{ limits.text }}</option>
										{% endif %}
									{% endfor %}
								</select>
							{% else %}
								<label  for="input-limit">{{ text_limit }}</label>
								<select id="input-limit" class="form-control" onchange="location = this.value;">
									{% for limits in limits %}
										{% if limits.value == limit %}
											<option value="{{ limits.href }}" selected="selected">{{ limits.text }}</option>
										{% else %}
											<option value="{{ limits.href }}">{{ limits.text }}</option>
										{% endif %}
									{% endfor %}
								</select>
							{% endif %}
                        </div>
                    </div>
                    <div class="custom-products">
                        {% for product in products %}
                            <div class="product-layout product-list col-xs-12 product-item">
                                <div class="product-thumb">
									<div class="item">
										<div class="item-inner">
											<div class="image images-container">
												{% 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 %}
												{% if image_effect == 'swatches' %}
													<div class="image swatches-image-container">
														<a href="{{ product.href }}">
															<img src="{{ product.thumb }}"  alt="{{ product.name }}" title="{{ product.name }}"
																 class="img-responsive img-cate-{{ product.product_id }}" />
															<input type="hidden" value="{{ product.thumb }}" class="img-default-{{ product.product_id }}" />
															{% if product.swatches_images %}
																{% for s_image in product.swatches_images %}
																	<input type="hidden" value="{{ s_image.image }}" class="img-swatch-{{ product.product_id }}-{{ s_image.product_option_value_id }}" />
																{% endfor %}
															{% endif %}
														</a>
														<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="cart">
																	<button type="button" title="{{ button_cart }}" onclick="cart.add('{{ product.product_id }}', '{{ product.minimum }}');"><span>{{ button_cart }}</span></button>
																</div>
																{% if use_quickview %}
																	<div class="qv-button-container">
																		<button type="button" title="{{ button_quickview }}" onclick="ocquickview.ajaxView('{{ product.href }}')"><span>{{ button_quickview }}</span></button>
																	</div>
																{% endif %}
															</div>
														</div>
													</div>
												{% else %}
													<div class="image rotate-image-container">
														<a href="{{ product.href }}">
															<img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive img-default-image" />
															{% if product.rotate_image %}
																<img src="{{ product.rotate_image }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive img-rotate-image" />
															{% endif %}
														</a>
														<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="cart">
																	<button type="button" title="{{ button_cart }}" onclick="cart.add('{{ product.product_id }}', '{{ product.minimum }}');"><span>{{ button_cart }}</span></button>
																</div>
																{% if use_quickview %}
																	<div class="qv-button-container">
																		<button type="button" title="{{ button_quickview }}" onclick="ocquickview.ajaxView('{{ product.href }}')"><span>{{ button_quickview }}</span></button>
																	</div>
																{% endif %}
															</div>
														</div>
													</div>
												{% endif %}
											</div>
											<div class="caption">
												{% if product.manufacturer %}
												<p class="manufacture-product {% if image_effect == 'swatches' %}{% if product.options %}{{ 'hide-hover' }}{% endif %}{% endif %}">
													<span>{{ text_manufacturer ~ ' ' }}</span><a href="{{ product.manufacturers }}">{{ product.manufacturer }}</a>
												</p>
												{% endif %}
												{% 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 image_effect == 'swatches' %}	
													<div class="category-options">
														{% if product.options %}
															{% for option in product.options %}
																<ul class="ul-swatches-colors">
																	{% for option_value in option.product_option_value %}
																		<li class="swatches-options">
																			<a href="javascript:void(0);" onclick="swatches.changeSwatchInCategory($(this));" title="{{ option_value.name }}"
																			   style="{% if option_value.image %} width: {{ icon_swatches_width }}px; height: {{ icon_swatches_height }}px;
																		background-image: url('{{ option_value.image }}') {% endif %}"
																			   data-product-id="{{ product.product_id }}"
																			   data-product-option-value-id="{{ option_value.product_option_value_id }}">{% if not option_value.image %} {{ option_value.name }} {% endif %}</a>
																		</li>
																	{% endfor %}
																</ul>
															{% endfor %}
														{% endif %}
													</div>
												{% endif %}
												<h4 class="product-name"><a href="{{ product.href }}">{{ product.name }}</a></h4>
												<p class="model">{{ product.model }}</p>
												{% if product.price %}
													<div class="price">
														<div class="price-box">
														{% if not product.special %}
															<p class="regular-price"><span class="price">{{ product.price }}</span></p>
														{% else %}
															<p class="special-price"><span class="price">{{ product.special }}</span></p>
															<p class="old-price"><span class="price">{{ product.price }}</span></p>						  
														{% endif %}
														{% if product.tax %}
															<p class="price-tax"><span class="price">{{ text_tax }} {{ product.tax }}</span></p>
														{% endif %}
														</div>
													</div>
												{% endif %}
												<p class="product-des">{{ product.description }}</p>	
											</div>
										</div>
									</div>
                                </div>
                            </div>
                        {% endfor %} 
					</div>
                    <div class="toolbar toolbar-products toolbar-bottom">
                        {% if use_layered %}
                            <div class="pages ajax_pagination">{{ ajax_pagination }}</div>
                        {% else %}
                            <div class="pages">{{ pagination }}</div>
                        {% endif %}
                        <div class="toolbar-amount"><span>{{ results }}</span></div>
                    </div>
                {% endif %}
                {% if not categories and not products %}
                    <p>{{ 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></div>
{{ footer }} 
