
{% unless settings.goal == blank %}
<div class="cart-progress">
<p style="text-align:center" id="main-cart-progress" data-id="{{ section.id }}" class="free-shipping {% if cart.total_price >= goal %}success{% endif %}">  
  {% assign goal = settings.goal | times:100 %}
  {% if cart.items.size == 0 %}
            {{ 'templates.cart.free_shipping_spend' | t }} {{ goal | money }}
  {% endif %}
  {% if cart.items.size != 0 %}
      {% if cart.total_price >= goal %} <span>{{ 'templates.cart.free_shipping_success' | t }} <strong>{{ 'templates.cart.free_shipping_success_text' | t  }}</strong></span>
      {% elsif cart.total_price < goal %} {{ 'templates.cart.free_shipping_text_1' | t }}<span>{{ goal | minus: cart.total_price | money }}</span> {{ 'templates.cart.free_shipping_text_2' | t }}
      {% endif %}
  {% endif %}
</p>

{% assign percentage = cart.total_price |  divided_by:100 %}
<div class="cart-progress-bar">
<progress max="{{ goal }}" value="{{ cart.total_price }}" class="{% if cart.total_price >= goal %}free-shipp-ready{% endif %}">{{ percentage }}
</progress>   
<div class="progress-icon">
</div>
</div>
</div>
<style>

progress[value] {
	-webkit-appearance:none;
    -moz-appearance:none;        
    appearance: none;
	border: none;
	position: relative;
	margin: 0 0 ; 
    height: 7px;
    transition: all 0.3s linear;
  width:100%;
}
 .cart-progress-bar{
   position: relative;
    background: rgba(117, 82, 164, 0.2);
    height: 7px;
    border-radius: 5px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: auto;width:100%;
}
  .progress-icon{position:relative;}


 .progress-icon:before {
    content: "";
    width: 30px;
    height: 25px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    background-image:  url({{ "shipping.jpg" | asset_url}});
    display:block;
    right: 0;
    top: auto;
    bottom: -11px;
    position: absolute;
    z-index: 1;  
} 

progress[value]::-webkit-progress-bar {
      border-radius:5px;
	background-color:rgb(var(--color-link),0.09);
}
 
progress[value]::-webkit-progress-value {
	position: relative;
	border-radius:5px;
  background-color:  rgb(var(--color-link-hover));
}

progress[value]::-moz-progress-bar {

	border-radius:5px;
  	background-color: rgb(var(--color-link-hover));
}
@-webkit-keyframes blinkers {
  0% {
    transform: translateY(-50%) scale(0.9);
  }
  50% {
    transform : translateY(-50%) scale(0.95);
  }
  100% {
    transform: translateY(-50%) scale(1);
  }
}
@keyframes blinkers {
  0% {
    transform: translateY(-50%) scale(0.9);
  }
  50% {
     transform : translateY(-50%) scale(1);
  }
  100% {
    transform: translateY(-50%) scale(0.9);
  }
}
progress:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(135deg,rgba(255,255,255,.2) 0,rgba(255,255,255,.2) 25%,rgba(255,255,255,0) 25%,rgba(255,255,255,0) 50%,rgba(255,255,255,.2) 50%,rgba(255,255,255,.2) 75%,rgba(255,255,255,0) 75%,rgba(255,255,255,0) 100%);
    z-index: 1;
    -webkit-animation: move 5s linear infinite;
    border-radius: 5px;
    overflow: hidden;
    background-size: 3rem 3rem;
}
@keyframes move{
0% {
    background-position: 0 0;
}
100% {
    background-position: -60px -60px;
}
  }

.cart-template cart-items .cart-progress .free-shipping  .cart-progress-bar{display:none;}
.cart-progress .free-shipping  strong{    font-weight: 400;color: rgb(var(--color-link-hover));}
.cart-progress .free-shipping{margin:0 0 36px;}  
</style>
{% endunless %}
