<?php $ends = strtotime((string) $s['ends_at']) ?>
<?php if ($ends && $ends > time()): ?>
<div class="relative overflow-hidden rounded-[var(--radius-panel)] px-6 py-14 text-center text-white sm:px-12 sm:py-20" style="background-color: <?= e(hex_color($s['color'], '#0a0a0a')) ?>">
    <?php if ($s['image']): ?>
        <img src="<?= e(upload_url($s['image'])) ?>" alt="" class="absolute inset-0 h-full w-full object-cover opacity-40" loading="lazy">
    <?php else: ?>
        <div class="absolute -top-24 left-1/2 size-[30rem] -translate-x-1/2 rounded-full bg-accent-600/40 blur-[120px]"></div>
    <?php endif ?>
    <div class="relative mx-auto max-w-2xl">
        <?php if ($s['eyebrow']): ?><p class="eyebrow text-white/60"><?= e($s['eyebrow']) ?></p><?php endif ?>
        <h2 class="font-display mt-4 text-4xl <?= heading_weight_class() ?> tracking-tight sm:text-5xl"><?= e($s['title']) ?></h2>
        <?php if ($s['text']): ?><p class="mt-4 text-white/75"><?= e($s['text']) ?></p><?php endif ?>
        <div data-countdown="<?= date('c', $ends) ?>" class="mt-10 flex justify-center gap-3 sm:gap-5">
            <?php foreach (['d' => 'Gün', 'h' => 'Saat', 'm' => 'Dakika', 's' => 'Saniye'] as $unit => $label): ?>
                <div class="w-20 rounded-2xl bg-white/10 py-4 ring-1 ring-white/15 backdrop-blur sm:w-24">
                    <span data-unit="<?= $unit ?>" class="font-display block text-3xl font-semibold tabular-nums sm:text-4xl">00</span>
                    <span class="mt-1 block text-[11px] tracking-wider text-white/60 uppercase"><?= $label ?></span>
                </div>
            <?php endforeach ?>
        </div>
        <?php if ($s['button_text']): ?>
            <a href="<?= e(section_link($s['link']) ?: url('urunler')) ?>" class="btn mt-10 bg-white px-7 py-4 text-ink hover:bg-zinc-100"><?= e($s['button_text']) ?><?= icon('arrow', 'size-4', '2') ?></a>
        <?php endif ?>
    </div>
</div>
<?php endif ?>
