{assign var="sizeBar" value=($amount_left > 0) ? 100 - (($amount_left * 100) / $free) : 100}
{if $sizeBar > 100}
    {assign var="sizeBar" value=100}
{/if}

<div class="free-delivery">
    {if $amount_left > 0}
        <div class="delivery-text">
            <p>
                <span class="first-txt">Livraison offerte à partir de {$free}€.</span>
                Plus que <span data-free="{$free}" data-amount="{$amount_left}">{$amount_left}€</span> pour en bénificier !
            </p>
        </div>
    {else}
        <div class="delivery-text">
            <p>Livraison gratuite</p>
        </div>
    {/if}
    <div class="load_bar">
        <div class="progress-delivery" style="width: {if $amount_left > 0}{$sizeBar|round:0}%{else}100%{/if};"></div>
        {if $amount_left > 0}
            <span>
                {$free}€
            </span>
        {/if}
    </div>
</div>
