<?php
/**
 * Breadcrumbs component — with Lucide home icon and clean separators.
 *
 * @var array $items [['label'=>..., 'url'=>...]]
 */
$items = $items ?? [];
?>
<?php if (!empty($items)): ?>
<nav class="breadcrumbs">
    <a href="/" class="breadcrumb-item">
        <i data-lucide="home" style="width:15px;height:15px;"></i>
        الرئيسية
    </a>
    <?php foreach ($items as $i => $item): ?>
        <span class="breadcrumb-separator">
            <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>
        </span>
        <?php if ($i < count($items) - 1 && !empty($item['url'])): ?>
            <a href="<?= e($item['url']) ?>" class="breadcrumb-item"><?= e($item['label']) ?></a>
        <?php else: ?>
            <span class="breadcrumb-item current"><?= e($item['label']) ?></span>
        <?php endif; ?>
    <?php endforeach; ?>
</nav>
<?php endif; ?>
