{*
 * MÉRIDIAN — Barre de progression livraison offerte (ShipBar maquette)
 * Données : $amount_left (reste à atteindre), $free (seuil)
 *}
{assign var="sizeBar" value=($amount_left > 0) ? (100 - (($amount_left * 100) / $free)) : 100}
{if $sizeBar > 100}{assign var="sizeBar" value=100}{/if}
{if $sizeBar < 0}{assign var="sizeBar" value=0}{/if}

<div class="mrd-shipbar free-delivery">
  <div class="mrd-shipbar-text">
    {if $amount_left > 0}
      <span>Plus que <strong data-free="{$free}" data-amount="{$amount_left}">{$amount_left|string_format:"%.2f"}€</strong> pour la <strong>livraison offerte</strong></span>
    {else}
      <span class="is-unlocked">✦ Livraison offerte débloquée</span>
    {/if}
  </div>
  <div class="mrd-shipbar-track load_bar">
    <div class="mrd-shipbar-fill progress-delivery" style="width:{$sizeBar|round:0}%"></div>
  </div>
</div>
