<div class="stripSection cartMain content_general">
  <div class="grid flexGrid gridJustify">
    {% if cart.item_count < 1 %}
      <h1 id="cartHeading">{{ 'cart.general.empty' | t }} {{ 'cart.general.continue_browsing_html' | t }}</h1>
    {%else%}
      {% assign free_total_product = 0 %}
      <form id="cartForm" class="fullSpan flexItem" id="cartForm" action="/cart" method="post" data-money_format='{{ shop.money_format }}'>
        {% assign totalDiscountAmount = 0 %}
        {% for item in cart.items %} 
          <ul class="cartRow flexGrid fullSpan gridJustify">
            <li><img  src="{{item.image.src | product_img_url: 'medium'}}" alt="{{ item.title | escape }}" /></li>
            <li class="product_title">
              {{ item.title }}
              {% assign property_size = item.properties | size %}
              {% if property_size > 0 %}
                {% for p in item.properties %}
                  {% unless p.last == blank %}
                    {{ p.first }}:
                    {% if p.last contains '/uploads/' %}
                      <a href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
                    {% else %}
                      {{ p.last }}
                    {% endif %}
                    <br>
                  {% endunless %}
                {% endfor %}
              {% endif %}
            </li>
            {% if item.price == 0 %}
				{% assign free_total_product = item.quantity | plus: free_total_product %}
            {% endif %}
            <li class="product_price_cart">
              {{item.price | money}}
            	{% assign totalDiscountAmountItem = 0 %}
                {% if item.variant.compare_at_price %}
                {% assign totalDiscountAmountItem = item.variant.compare_at_price | minus: item.price | times: item.quantity %}
                {% assign totalDiscountAmount = totalDiscountAmount | plus: totalDiscountAmountItem %}
                {% if settings.enable_total_saving %}
                
				{% if item.variant.compare_at_price > 0 %}
              ,
                <span class="money strip">
                    {{ item.variant.compare_at_price | money }}
                </span>
              {% endif %}
                {% endif %}
                {% endif %}
            </li>
            <li class="cart_qty_value">
              <button type="button" value="-" class="qtyminus" field="quantity" size="25">
              	{% if settings.qty_icon_type == icon1 %}
                	<?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Calque_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="0 0 595.28 841.89" enable-background="new 0 0 595.28 841.89" xml:space="preserve"> <g id="XMLID_3_"> <polygon id="XMLID_35_" fill="#FFFFFF" points="595.187,388.098 330.479,388.098 264.785,388.098 0.078,388.098 0.078,453.792 264.785,453.792 330.479,453.792 595.187,453.792 "/> </g> </svg>
              	{% else %}
                	<?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Calque_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="0 0 595.28 841.89" enable-background="new 0 0 595.28 841.89" xml:space="preserve"> <path fill="#FFFFFF" d="M572.401,398.176H22.85c-12.591,0-22.8,10.209-22.8,22.8c0,12.591,10.209,22.8,22.8,22.8h549.55 c12.591,0,22.8-10.209,22.8-22.8C595.201,408.385,584.992,398.176,572.401,398.176z"/> </svg>
                {% endif %}
              </button>
              
              <input class="qtyInput qty" type="text" name="quantity" id="updates_{{ item.id }}"  data-lineItem="{{ forloop.index }}"  min="0" {% unless item.variant.inventory_management == blank or item.variant.inventory_policy == 'continue' %} max="{{ item.variant.inventory_quantity }}"{%endunless%} value="{{ item.quantity }}" />
              <button type="button" value="+" class="qtyplus" field="quantity" size="25">
              	{% if settings.qty_icon_type == icon1 %}
                	<svg version="1.1" id="Calque_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="0 0 595.28 841.89" enable-background="new 0 0 595.28 841.89" xml:space="preserve"> <g id="XMLID_5_"> <polygon id="XMLID_39_" fill="#FFFFFF" points="595.04,388.16 330.58,388.16 330.58,123.7 264.948,123.7 264.948,388.16 0.488,388.16 0.488,453.792 264.948,453.792 264.948,718.252 330.58,718.252 330.58,453.792 595.04,453.792 "/> </g> </svg>
              	{% else %}
                	<?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Calque_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="0 0 595.28 841.89" enable-background="new 0 0 595.28 841.89" xml:space="preserve"> <path fill="#FFFFFF" d="M572.439,398.175H320.452V146.188c0-12.592-10.209-22.801-22.801-22.801 c-12.592,0-22.801,10.209-22.801,22.801v251.987H22.862c-12.592,0-22.801,10.21-22.801,22.801c0,12.592,10.21,22.801,22.801,22.801 h251.987v251.987c0,12.592,10.21,22.801,22.801,22.801c12.592,0,22.801-10.209,22.801-22.801V443.777h251.987 c12.592,0,22.801-10.209,22.801-22.801C595.24,408.384,585.031,398.175,572.439,398.175z"/> </svg>
                {% endif %}
              </button>
            </li>
           	<li class="product_price_cart_mobile">
              {{item.price | money}}
            	{% if settings.enable_total_saving %}
                
				{% if item.variant.compare_at_price > 0 %}
              	<br>
                <span class="money strip">
                    {{ item.variant.compare_at_price | money }}
                </span>
              {% endif %}
                {% endif %}
            </li>
            <li class="remove_cart_link">
              <a  href="/cart/change?line={{ forloop.index }}&quantity=0">{%include 'svg-definitions' with 'close'%}</a>
            </li>
             <li class="product_title_cart_mobile">
               {{ item.title }}
               {% assign property_size = item.properties | size %}
                {% if property_size > 0 %}
                  {% for p in item.properties %}
                    {% unless p.last == blank %}
                      {{ p.first }}:
                      {% if p.last contains '/uploads/' %}
                        <a href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
                      {% else %}
                        {{ p.last }}
                      {% endif %}
                      <br>
                    {% endunless %}
                  {% endfor %}
                {% endif %}
            </li>
          </ul>
        {%endfor%}
        
          
        {% assign isCheckedAllowd = true %}
        
        {% assign warningMsg = settings.free_product_limit_msg %}
        {% if settings.enable_free_product_limit %}
          	{% assign isCheckedAllowd = false %}
            {% if settings.free_product_limit >= free_total_product %}
            	{% assign isCheckedAllowd = true %}
            {% endif %}
          {% endif %}
        {% if settings.enable_free_product_limit_by_price and cart.total_price > 0 %}
        	{% assign isCheckedAllowd = true %}
        	{% assign allowedFreeLimit = cart.total_price | divided_by : 100 | divided_by : settings.free_product_limit_price %}
		    {% if allowedFreeLimit < free_total_product %}
        		{% assign isCheckedAllowd = false %}
        		{% assign warningMsg = settings.free_product_limit_by_price_msg %}
        	{% endif %}
        {% endif %}
        
          
        <h1 id="cartHeading">
          {% if totalDiscountAmount > 0 and settings.enable_total_saving %}
          <div class="cart-footer-saving">
              <span class="total_txt">{{ settings.cart_total_saving_text }} : </span>
              <span class="money" data-header-cart-saving>{{ totalDiscountAmount | money }}</span>
            </div>
          {%endif%}
          <span class="total_txt">{{ 'cart.general.subtotal' | t }}</span> <span id="cartTotal">{{cart.total_price|money}}</span>
        	
        </h1>
		{% assign instructions = shop.metafields.fl_bd_metadata %}     	
        {% if instructions['fl_bd_install'] == "true" %}
            {% include 'kolt-bundle', page: 'cart'%}
        {% endif %}
        {{ settings.cart_extra_text }}
        <div class="cartfoot">
          {% if settings.cart_terms_enable and isCheckedAllowd %}
          <div class="tac_wrapper">
            <input type="checkbox" id="agree" />
            <label for="agree">
              {{ settings.cart_terms_text }}
              <a href="#" data-getPopout="#termsPopup" class="hasPop terms_popup_trigger">
          		{{ settings.cart_terms_link_text }}
        	  </a>
            </label>
            <div class="cart_term_error" style="display:none;">
            	{{ settings.cart_terms_warning }}
            </div>
          </div>
          {% endif %}
          
          {% if isCheckedAllowd == false %}
          	<div style="color:red;">{{ warningMsg }}</div><br>
          {% endif %}
          <div class="abc">
            {% if settings.cart_extra_button_2_enable %}
                    <a {% if settings.cart_extra_button_2_link_back == true %}onclick="window.history.go(-1); return false;"{%endif%} class="button {% if settings.cart_extra_button_1_enable == false %}cart_extra_button_full{%endif%}" id="extra_button_2_id" href="{{ settings.extra_button_2_link }}">{{ settings.extra_button_2_text }}</a>
                  {% endif %}
            {% if settings.cart_extra_button_1_enable %}
                  <a class="button {% if settings.cart_extra_button_2_enable == false %}cart_extra_button_full{%endif%}" id="extra_button_1_id" href="{{ settings.extra_button_1_link }}">{{ settings.extra_button_1_text }}</a>
                  {% endif %}
          
           
          {% if isCheckedAllowd %}
            
            {% if settings.checkoutx_enable %}
            	<button id="goToCheckout" type="submit"  name="checkout" class="button">{% if settings.cart_enable_secure_lock_icon %} <span class="SecurityIcon">{% include 'security_icon_type' %}</span>{%endif%} {{ settings.cart_page_checkout_text }}</button>
          	{% else %}
            	<button id="goToCheckout" type="submit"  name="checkout" class="button">{% if settings.cart_enable_secure_lock_icon %} <span class="SecurityIcon">{% include 'security_icon_type' %}</span>{%endif%} {{ settings.cart_page_checkout_text }}</button>
            {% endif %}
          {% endif %}	
          </div>
          	<input id="updateCart" type="submit" name="update" class="button linkButton" value="{{ 'cart.general.update' | t }}">
			{% if settings.enable_cart_checkout_icon %}
              <img alt="Checkout Secure" src="{{ 'checkout_cart_icon.png' | asset_url }}" class="checkout_image" />
            {% endif %}
         
        </div>
      	
    	{% if settings.cart_paypal_btn == 'none' or settings.cart_paypal_btn == 'cart' %}
    		<div class="cart_additional_checkout_buttons">
                {% if additional_checkout_buttons %}<div class="additional-checkout-buttons">{{ content_for_additional_checkout_buttons }}</div>{% endif %}
        </div>
        {% endif %}
       
      </form>
    {%endif%}
  </div>
</div>