<?php
$banner = $banners[0] ?? ['title' => '科技降温 · 清凉一夏', 'subtitle' => '为高温作业人群定制', 'link' => '/products'];
?>
<section class="hero">
    <div class="hero-bg"></div>
    <div class="container">
        <div>
            <p class="eyebrow">❄ SQY COOLING APPAREL</p>
            <h1 class="hero-title"><?php echo e($banner['title']); ?><br><span class="hl">体感直降 8-12℃</span></h1>
            <p class="hero-sub"><?php echo e($banner['subtitle']); ?>。我们提供水冷循环、相变蓄冷、涡扇风冷三大降温方案，覆盖工业、户外、消防等高温场景。</p>
            <div class="hero-cta">
                <a class="btn btn-primary magnetic" href="<?php echo site_url('products'); ?>">浏览产品中心</a>
                <a class="btn btn-ghost" href="<?php echo site_url('contact'); ?>">获取免费方案</a>
            </div>
        </div>
        <div class="hero-visual">
            <div class="hero-orb"></div>
            <div class="hero-frost">❄</div>
        </div>
        <div class="hero-stats">
            <?php foreach ($stats as $s): ?>
                <div class="stat reveal"><b><?php echo e($s['n']); ?><span style="font-size:16px"><?php echo e($s['u']); ?></span></b><span><?php echo e($s['l']); ?></span></div>
            <?php endforeach; ?>
        </div>
    </div>
</section>

<section class="section">
    <div class="container">
        <div class="section-head reveal">
            <p class="eyebrow">产品系列</p>
            <h2 class="section-title">六大降温服系列，总有一款适合你</h2>
            <p class="section-sub">从长时间恒温作业到临时户外移动，覆盖不同降温原理与场景。</p>
        </div>
        <div class="cat-grid">
            <?php foreach ($categories as $c): ?>
                <a class="cat-card reveal" href="<?php echo site_url('products?cat=' . $c['id']); ?>">
                    <div class="cat-icon"><?php echo e($c['icon']); ?></div>
                    <h3><?php echo e($c['name']); ?></h3>
                    <p><?php echo e($c['description']); ?></p>
                </a>
            <?php endforeach; ?>
        </div>
    </div>
</section>

<section class="section" style="background:var(--c-surface)">
    <div class="container">
        <div class="section-head reveal">
            <p class="eyebrow">精品推荐</p>
            <h2 class="section-title">热门降温服</h2>
            <p class="section-sub">外贸级品质，支持企业 LOGO 绣字与一人一码量体。</p>
        </div>
        <div class="product-grid">
            <?php foreach ($products as $p): ?>
                <a class="product-card reveal" href="<?php echo site_url('products/' . $p['slug']); ?>">
                    <?php if (!empty($p['cover'])): ?>
                    <div class="product-thumb"><img src="<?php echo e(site_url($p['cover'])); ?>" alt="<?php echo e($p['name']); ?>"></div>
                    <?php else: ?>
                    <div class="product-thumb" style="background:<?php echo gradient($p['id']); ?>">❄</div>
                    <?php endif; ?>
                    <div class="product-body">
                        <div class="product-name"><?php echo e($p['name']); ?></div>
                        <div class="product-sum"><?php echo e($p['summary']); ?></div>
                        <div class="product-meta">
                            <div class="product-price">¥<?php echo e($p['price']); ?> <small>起</small></div>
                            <span class="tag">查看详情 →</span>
                        </div>
                    </div>
                </a>
            <?php endforeach; ?>
        </div>
        <div style="text-align:center"><a class="more-link" href="<?php echo site_url('products'); ?>">查看全部产品 →</a></div>
    </div>
</section>

<section class="section">
    <div class="container">
        <div class="section-head reveal">
            <p class="eyebrow">为什么选择我们</p>
            <h2 class="section-title">20 年服装经验，外贸级品质</h2>
        </div>
        <div class="adv-grid">
            <?php foreach ($advantages as $a): ?>
                <div class="adv-card reveal">
                    <div class="num"><?php echo e($a['n']); ?></div>
                    <h3><?php echo e($a['t']); ?></h3>
                    <p><?php echo e($a['d']); ?></p>
                </div>
            <?php endforeach; ?>
        </div>
    </div>
</section>

<section class="section" style="background:var(--c-surface)">
    <div class="container">
        <div class="section-head reveal">
            <p class="eyebrow">交付流程</p>
            <h2 class="section-title">28 天快速定制，省心交付</h2>
        </div>
        <div class="process">
            <?php foreach ($process as $s): ?>
                <div class="step reveal"><h4><?php echo e($s['t']); ?></h4><p><?php echo e($s['d']); ?></p></div>
            <?php endforeach; ?>
        </div>
    </div>
</section>

<section class="section">
    <div class="container">
        <div class="section-head reveal">
            <p class="eyebrow">新闻动态</p>
            <h2 class="section-title">最新资讯与案例</h2>
        </div>
        <div class="news-grid">
            <?php foreach ($news as $n): ?>
                <a class="news-card reveal" href="<?php echo site_url('news/' . $n['slug']); ?>">
                    <div class="news-thumb" style="background:<?php echo gradient($n['id']); ?>">📰</div>
                    <div class="news-body">
                        <div class="news-date"><?php echo e(format_date($n['published_at'])); ?></div>
                        <div class="news-title"><?php echo e($n['title']); ?></div>
                        <div class="news-sum"><?php echo e($n['summary']); ?></div>
                    </div>
                </a>
            <?php endforeach; ?>
        </div>
        <div style="text-align:center"><a class="more-link" href="<?php echo site_url('news'); ?>">更多资讯 →</a></div>
    </div>
</section>

<section class="section" style="background:var(--c-surface)">
    <div class="container">
        <div class="section-head reveal">
            <p class="eyebrow">客户案例</p>
            <h2 class="section-title">他们都在用酷冰甲降温服</h2>
            <p class="section-sub">覆盖钢铁、消防、化工、环卫等高温行业，提供定制化降温方案。</p>
        </div>
        <div class="news-grid">
            <?php foreach ($cases as $c): ?>
                <a class="news-card reveal" href="<?php echo site_url('cases/' . $c['slug']); ?>">
                    <div class="news-thumb" style="background:<?php echo gradient($c['id']); ?>">🤝</div>
                    <div class="news-body">
                        <div class="news-date"><?php echo e($c['industry'] ?? ''); ?> · <?php echo e($c['customer'] ?? ''); ?></div>
                        <div class="news-title"><?php echo e($c['title']); ?></div>
                        <div class="news-sum"><?php echo e($c['summary']); ?></div>
                    </div>
                </a>
            <?php endforeach; ?>
        </div>
        <div style="text-align:center"><a class="more-link" href="<?php echo site_url('cases'); ?>">查看全部案例 →</a></div>
    </div>
</section>

<section class="section" style="background:var(--c-surface)">
    <div class="container">
        <div class="section-head reveal">
            <p class="eyebrow">常见问题</p>
            <h2 class="section-title">关于降温服，您可能想了解</h2>
            <p class="section-sub">高频疑问一站式解答，定制与选型更省心。</p>
        </div>
        <div class="faq-list">
            <?php foreach ($faqs as $f): ?>
            <details class="faq-item reveal">
                <summary><?php echo e($f['q']); ?><span class="faq-ico">+</span></summary>
                <div class="faq-a"><?php echo e($f['a']); ?></div>
            </details>
            <?php endforeach; ?>
        </div>
    </div>
</section>

<section class="section">
    <div class="container">
        <div class="cta-banner reveal">
            <h2>免费拿样 · 5 天出设计方案</h2>
            <p>提交您的需求，专属顾问 1 对 1 为您提供降温服装定制方案，支持企业 LOGO 绣字。</p>
            <a class="btn btn-primary magnetic" href="<?php echo site_url('contact'); ?>">立即咨询</a>
        </div>
    </div>
</section>
