<?php
    $style = isset($args['style']) ? $args['style'] : '';
?>
<section class="section <?php echo $style; ?>">
    <div class="container">
        <?php $our_dynamic_integrations = get_field('our_dynamic_integrations'); ?>
        <div class="text-cont slide-down">
            <h2 class="section-title"><?php echo $our_dynamic_integrations['heading']; ?></h2>
            <p class="section-content">
                <?php echo $our_dynamic_integrations['description']; ?>
            </p>
            <div class="input-group">
                <span class="input-group-text">
                    <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <g clip-path="url(#clip0_167_4341)">
                            <path d="M13.4111 19.7531C14.8086 19.7531 16.1182 19.3312 17.208 18.6105L21.0576 22.4689C21.3125 22.715 21.6377 22.838 21.9893 22.838C22.7188 22.838 23.2549 22.2667 23.2549 21.546C23.2549 21.212 23.1406 20.8868 22.8945 20.6407L19.0713 16.7999C19.8623 15.6749 20.3281 14.3126 20.3281 12.8361C20.3281 9.0304 17.2168 5.91907 13.4111 5.91907C9.61426 5.91907 6.49414 9.0304 6.49414 12.8361C6.49414 16.6417 9.60547 19.7531 13.4111 19.7531ZM13.4111 17.9073C10.625 17.9073 8.33984 15.6222 8.33984 12.8361C8.33984 10.0499 10.625 7.76477 13.4111 7.76477C16.1973 7.76477 18.4824 10.0499 18.4824 12.8361C18.4824 15.6222 16.1973 17.9073 13.4111 17.9073Z" fill="#3C3C43" fill-opacity="0.6" />
                        </g>
                    </svg>
                </span>
                <input type="text" class="form-control" id="integrationSearch" placeholder="Search Integration">
            </div>
        </div>
        <?php $ecommerce_platforms = get_field('ecommerce_platforms'); ?>
        <div class="text-content slide-down firstt">
            <div class="heading">
                <h2 class="section-title"><?php echo $ecommerce_platforms['heading']; ?></h2>
                <p class="section-content"><?php echo $ecommerce_platforms['description']; ?></p>
            </div>
            <?php if ( is_array($ecommerce_platforms['systems']) && count($ecommerce_platforms['systems']) ) : ?>
                <ul>
                    <?php foreach ($ecommerce_platforms['systems'] as $system) : ?>
					<?php
$link_value = !empty($system['logo_link']) ? $system['logo_link'] : '';

$trimmed_link = trim($link_value);

$final_link = !empty($trimmed_link) ? $trimmed_link : 'javascript:;';
?>

<li class="slide-down">
    <a href="<?php echo $final_link; ?>">
        <span><img src="<?php echo $system['logo']; ?>" alt="<?php echo $system['name'];?> platform logo" class="img-fluid" loading="lazy"></span>
        <?php echo $system['name']; ?>
    </a>
</li>
                      
                    <?php endforeach; ?>
                </ul>
            <?php endif; ?>

            <?php $erp_n_crm = get_field('erp_n_crm'); ?>
            <div class="heading">
                <h2 class="section-title"><?php echo $erp_n_crm['heading']; ?></h2>
                <p class="section-content"><?php echo $erp_n_crm['description']; ?></p>
            </div>
            <?php if ( is_array($erp_n_crm['systems']) && count($erp_n_crm['systems']) ) : ?>
                <ul>
                    <?php foreach ($erp_n_crm['systems'] as $system) : ?>
                        <?php
$link_value = !empty($system['logo_link']) ? $system['logo_link'] : '';

$trimmed_link = trim($link_value);

$final_link = !empty($trimmed_link) ? $trimmed_link : 'javascript:;';
?>

<li class="slide-down">
    <a href="<?php echo $final_link; ?>">
        <span><img src="<?php echo $system['logo']; ?>" alt="<?php echo $system['name'];?> platform logo" class="img-fluid" loading="lazy"></span>
        <?php echo $system['name']; ?>
    </a>
</li>
                    <?php endforeach; ?>
                </ul>
            <?php endif; ?>

            <?php $marketplaces = get_field('marketplaces'); ?>
            <div class="heading">
                <h2 class="section-title marketplace-title slide-down tt"><?php echo $marketplaces['heading']; ?></h2>
                <p class="section-content">
                    <?php echo $marketplaces['description']; ?>
                </p>
            </div>

            <?php if ( is_array($marketplaces['systems']) && count($marketplaces['systems']) ) : ?>
                <ul>
                    <?php foreach ($marketplaces['systems'] as $system) : ?>
                        <?php
$link_value = !empty($system['logo_link']) ? $system['logo_link'] : '';

$trimmed_link = trim($link_value);

$final_link = !empty($trimmed_link) ? $trimmed_link : 'javascript:;';
?>

<li class="slide-down">
    <a href="<?php echo $final_link; ?>">
        <span><img src="<?php echo $system['logo']; ?>" alt="<?php echo $system['name'];?> platform logo" class="img-fluid" loading="lazy"></span>
        <?php echo $system['name']; ?>
    </a>
</li>
                        <?php endforeach; ?>
                </ul>
            <?php endif; ?>

            <?php $shipping_carriers = get_field('shipping_carriers'); ?>
            <div class="heading">
                <h2 class="section-title slide-down tt"><?php echo $shipping_carriers['heading']; ?></h2>
                <p class="section-content">
                <?php echo $shipping_carriers['description']; ?>
                </p>
            </div>
            <?php if ( is_array($shipping_carriers['systems']) && count($shipping_carriers['systems']) ) : ?>
                <ul>
                    <?php foreach ($shipping_carriers['systems'] as $system) : ?>
                        <?php
$link_value = !empty($system['logo_link']) ? $system['logo_link'] : '';

$trimmed_link = trim($link_value);

$final_link = !empty($trimmed_link) ? $trimmed_link : 'javascript:;';
?>

<li class="slide-down">
    <a href="<?php echo $final_link; ?>">
        <span><img src="<?php echo $system['logo']; ?>" alt="<?php echo $system['name'];?> platform logo" class="img-fluid" loading="lazy"></span>
        <?php echo $system['name']; ?>
    </a>
</li>
                    <?php endforeach; ?>
                </ul>
            <?php endif; ?>

            <?php $returns_management = get_field('returns_management'); ?>
            <div class="heading">
                <h2 class="section-title slide-down tt"><?php echo $returns_management['heading']; ?></h2>
                <p class="section-content">
                <?php echo $returns_management['description']; ?>
                </p>
            </div>
            <?php if ( is_array($returns_management['systems']) && count($returns_management['systems']) ) : ?>
                <ul>
                    <?php foreach ($returns_management['systems'] as $system) : ?>
                        <?php
$link_value = !empty($system['logo_link']) ? $system['logo_link'] : '';

$trimmed_link = trim($link_value);

$final_link = !empty($trimmed_link) ? $trimmed_link : 'javascript:;';
?>

<li class="slide-down">
    <a href="<?php echo $final_link; ?>">
        <span><img src="<?php echo $system['logo']; ?>" alt="<?php echo $system['name'];?> platform logo" class="img-fluid" loading="lazy"></span>
        <?php echo $system['name']; ?>
    </a>
</li>
                    <?php endforeach; ?>
                </ul>
            <?php endif; ?>

            <?php $integrations_partners = get_field('integrations_partners'); ?>
            <div class="heading">
                <h2 class="section-title slide-down tt"><?php echo $integrations_partners['heading']; ?></h2>
                <p class="section-content">
                    <?php echo $integrations_partners['description']; ?>
                </p>
            </div>
            <?php if ( is_array($integrations_partners['systems']) && count($integrations_partners['systems']) ) : ?>
                <ul>
                    <?php foreach ($integrations_partners['systems'] as $system) : ?>
                        <?php
$link_value = !empty($system['logo_link']) ? $system['logo_link'] : '';

$trimmed_link = trim($link_value);

$final_link = !empty($trimmed_link) ? $trimmed_link : 'javascript:;';
?>

<li class="slide-down">
    <a href="<?php echo $final_link; ?>">
        <span><img src="<?php echo $system['logo']; ?>" alt="<?php echo $system['name'];?> platform logo" class="img-fluid" loading="lazy"></span>
        <?php echo $system['name']; ?>
    </a>
</li>
                    <?php endforeach; ?>
                </ul>
            <?php endif; ?>

            <?php $other_integrations = get_field('other_integrations'); ?>
            <div class="heading">
                <h2 class="section-title slide-down tt"><?php echo $other_integrations['heading']; ?></h2>
                <p class="section-content">
                    <?php echo $other_integrations['description']; ?>
                </p>
            </div>
            <?php if ( is_array($other_integrations['systems']) && count($other_integrations['systems']) ) : ?>
                <ul>
                    <?php foreach ($other_integrations['systems'] as $system) : ?>
                        <?php
$link_value = !empty($system['logo_link']) ? $system['logo_link'] : '';

$trimmed_link = trim($link_value);

$final_link = !empty($trimmed_link) ? $trimmed_link : 'javascript:;';
?>

<li class="slide-down">
    <a href="<?php echo $final_link; ?>">
        <span><img src="<?php echo $system['logo']; ?>" alt="<?php echo $system['name'];?> platform logo" class="img-fluid" loading="lazy"></span>
        <?php echo $system['name']; ?>
    </a>
</li>
                    <?php endforeach; ?>
                </ul>
            <?php endif; ?>
        </div>
    </div>
</section>