{# Items list #}
{% if order and order.items %}
    <div class="rounded-2xl border border-stone-200 bg-white/80 p-4 sm:p-6">
      <h2 class="text-sm sm:text-base font-semibold mb-3">
        Items
      </h2>
      <ul class="divide-y divide-stone-100 text-xs sm:text-sm">
        {% for item in order.items %}
          <li>
            <a class="w-full py-2 flex gap-3" href="{{ market_product_url(item.product.slug) }}">
              {# Thumbnail #}
              <div class="w-12 h-12 sm:w-14 sm:h-14 rounded-md bg-stone-100 flex-shrink-0 overflow-hidden">
                {% if item.product and item.product.image %}
                  <img
                    src="{{ item.product.image }}"
                    alt="{{ item.product_title or item.product.title or 'Product image' }}"
                    class="w-full h-full object-contain object-center"
                    loading="lazy"
                    decoding="async"
                  >
                {% else %}
                  <div class="w-full h-full flex items-center justify-center text-[9px] text-stone-400">
                    No image
                  </div>
                {% endif %}
              </div>

              {# Text + pricing #}
              <div class="flex-1 flex justify-between gap-3">
                <div>
                  <p class="font-medium">
                    {{ item.product_title or (item.product and item.product.title) or 'Unknown product' }}
                  </p>
                  <p class="text-[11px] text-stone-500">
                    Product ID: {{ item.product_id }}
                  </p>
                </div>
                <div class="text-right whitespace-nowrap">
                  <p>Qty: {{ item.quantity }}</p>
                  <p>
                    {{ item.currency or order.currency or 'GBP' }}
                    {{ '%.2f'|format(item.unit_price or 0) }}
                  </p>
                </div>
              </div>
            </a>
          </li>
        {% endfor %}
      </ul>
    </div>
{% endif %}