
<div class="faq_section">
    <div class="container">
        <div class="sec-title with-text text-center">
            <div class="title">Common Queries</div>
            <div class="border-box center"></div>
            <span>Got questions? We’ve got answers! Our FAQs section covers everything you need to know about our scaffolding products, usage, safety guidelines, and services. Whether it’s specifications, installation, or maintenance, find clear and concise solutions here. Explore expert insights and make informed decisions for your projects with confidence. Your queries are answered instantly!</span>
        </div>
        <div class="clearfix"></div>
        <div class="accordion" id="accordionExample">
            <?php
            $i = 1;
            $faq_sql = mysqli_query($GLOBALS['dbconn'], "SELECT answer, slno, question FROM faq_tbl WHERE category_id IS NULL OR category_id='' ORDER BY slno desc");
            $companyName = isset($admin_res['companyName']) ? $admin_res['companyName'] : 'Your Company';
            while ($faq_res = mysqli_fetch_array($faq_sql)) { ?>
                <div class="accordion-item">
                    <div class="accordion-header">
                        <button
                            class="accordion-button <?= $i === 1 ? '' : 'collapsed'; ?>"
                            type="button"
                            data-bs-toggle="collapse"
                            data-bs-target="#collapse<?= htmlspecialchars($faq_res['slno']); ?>"
                            aria-expanded="<?= $i === 1 ? 'true' : 'false'; ?>"
                            aria-controls="collapse<?= htmlspecialchars($faq_res['slno']); ?>">
                            <?= htmlspecialchars(str_ireplace('{companyName}', $companyName, $faq_res['question'])); ?>
                        </button>
                    </div>
                    <div
                        id="collapse<?= htmlspecialchars($faq_res['slno']); ?>"
                        class="accordion-collapse collapse <?= $i === 1 ? 'show' : ''; ?>"
                        data-bs-parent="#accordionExample">
                        <div class="accordion-body">
                        <?= htmlspecialchars(str_ireplace('{companyName}', $companyName, $faq_res['answer'])); ?>
                        </div>
                    </div>
                </div>
            <?php $i++;
            } ?>
        </div>
    </div>

</div>