<?php
/**
 * Generated by blog pipeline.
 */
get_header();
?>
<?php get_template_part('templates/page-header'); ?>

<?php
	if ( ! defined( 'ABSPATH' ) ) {
		exit;
	}

	$render_page_content = static function ( string $content ): void {
		if ( $content === '' ) {
			return;
		}
		?>
		<div class="g-63e2c1ff">
			<article id="post-<?php the_ID(); ?>" class="content-wrapper g-a16fa44f">
				<?php echo apply_filters( 'the_content', $content ); ?>
			</article>
		</div>
		<?php
	};

	if ( in_the_loop() ) {
		$render_page_content( get_the_content() );
	} elseif ( have_posts() ) {
		while ( have_posts() ) {
			the_post();
			$render_page_content( get_the_content() );
		}
	}
?>

<section id="form" class="g-3dd255a1" aria-labelledby="contact-title" itemscope itemtype="https://schema.org/ContactPage" data-bs-pause="d2c3cd" data-section-handler="da00fa60e">
    <div class="g-63e2c1ff g-1905f4cc" id="elem-1d5b93d1ae448fc0">
        <div class="g-481643c7 g-3eaa23da g-3f73e398" data-analytics-selector="afc5a1" data-section-role="content" data-bs-track="3a6c729dbfa">
            <div class="g-54e918f2 g-2703a1fe" itemprop="mainEntity" itemscope itemtype="https://schema.org/Organization" id="elem-a828addeb59d8147">
                <h2 id="contact-title" class="g-4d7b4f87 g-80c439fc" itemprop="name" data-bs-automation="38847f5e" data-analytics-loading="3d828c3c8d43" data-element-priority="critical">Contact Our Gardening Experts</h2>
                <p class="g-79cce1fe g-80c439fc g-6a050ff1" id="elem-e667891c6f0e6ae7">
                    Fill out the form below to share your gardening questions or project details. We&#039;ll get back to you to discuss how we can assist.
                </p>
                <address class="g-470a3e12 g-4d976e7e" itemscope itemtype="https://schema.org/PostalAddress" itemprop="address" data-analytics-fixture="a8a93bfebb2" data-analytics-wrap="1344da80a1" data-bs-value="e454d03b7">
                    <ul class="g-20a951e5" id="elem-34a449130d814195">
                        <li class="g-20921e31" data-module-state="success" data-element-size="small" data-mui-metric="936dfbe7b8">
                            <span class="g-a405226b g-327b0b43" aria-hidden="true" id="elem-9f88930dab407c3d">📍</span>
                            <div class="g-25077ba0" data-test-pause="f3bd18" data-component-position="bottom" data-analytics-disabled="ea0f7a6" data-element-animation="fade" data-section-position="center">
                                <span class="g-80c439fc g-8cdd9402" id="elem-78bda911cdd249df">Address</span>
                                <span class="g-7ca5b33c g-80c439fc g-2dca56df g-2ba44b28" itemprop="streetAddress" data-element-animation="slide" data-widget-layout="136e9e943">1234 Maple Street, Springfield, IL</span>
                            </div>
                        </li>
                        <li class="g-20921e31 g-8dd0b5fd" id="elem-3bc8d3cd1b1e8bb3">
                            <span class="g-a405226b g-327b0b43" aria-hidden="true" data-mui-track="7461e586" data-block-status="archived" data-test-size="xs" data-block-content="79ff55be536f">📞</span>
                            <div class="g-25077ba0" id="elem-f6ffb35017235765">
                                <span class="g-80c439fc g-8cdd9402" data-module-size="medium" data-mui-disabled="58f48b3" data-component-variant="outlined" data-analytics-expanded="c4d570b">Phone</span>
                                <a href="tel:+12175550134" class="g-7ca5b33c g-80c439fc g-2dca56df g-2ba44b28" itemprop="telephone" id="elem-ca70c0b78c375d1e">+1 217-555-0134</a>
                            </div>
                        </li>
                        <li class="g-20921e31 g-8dd0b5fd" data-element-group="a00caaa0" data-test-elevation="af0228fc867" data-component-group="1f4f7ef8f58" data-mui-color="error">
                            <span class="g-a405226b g-327b0b43" aria-hidden="true" id="elem-ea39133e2ee169ab">📮</span>
                            <div class="g-25077ba0" data-test-color="success" data-widget-config="51d0fb98a8" data-element-size="medium">
                                <span class="g-80c439fc g-8cdd9402" id="elem-203c50e6d1d22836">Email</span>
                                <a href="mailto:info@bloomwise.com" class="g-7ca5b33c g-80c439fc g-2dca56df g-2ba44b28" itemprop="email" data-test-category="error" data-widget-action="toggle" data-test-variant="text" data-test-toggle="collapse" data-analytics-label="76e5bf">info@bloomwise.com</a>
                            </div>
                        </li>
                    </ul>
                </address>
            </div>
            <form class="g-ee51e8a8 g-327b0b43" aria-labelledby="form-title" data-form-type="feedback" id="elem-c955c97a6c5c7c68">
                <h3 id="form-title" class="g-d7f91b21 g-b4df0116" data-element-variant="filled" data-bs-metric="7f573e">Request a Consultation</h3>
                <div class="g-82688293 g-6a050ff1" id="elem-28d971e3ffd34a26">
                    <label for="name" class="g-fc8ad3ad" data-bs-locator="887d27a66e11" data-widget-priority="high" data-block-content="cf0c7970cde">Your Name</label>
                    <input class="g-2ba44b28 g-b52e184a g-20217aed" type="text" id="name" name="name" placeholder="Name" required data-section-mode="view" data-mui-keyboard="61c18965" data-mui-disabled="41c1c5525" data-element-group="d7b556ec4c5">
                </div>
                <div class="g-82688293 g-6a050ff1" data-test-label="f0172e" data-element-animation="bounce" data-test-event="conversion">
                    <label for="email" class="g-fc8ad3ad" id="elem-692b6b8c67991e7e">Your Email</label>
                    <input class="g-2ba44b28 g-b52e184a g-20217aed" type="email" id="email" name="email" placeholder="Email" required data-mui-action="submit" data-bs-keyboard="a125b88" data-element-target="91f88e64">
                </div>
                <div class="g-6a050ff1" id="elem-76b4ed6419239819">
                    <label for="message" class="g-fc8ad3ad" data-module-group="3e7090503" data-test-goal="c96728e9cd" data-widget-state="active" data-block-content="aeef504b">Your Message</label>
                    <textarea class="g-2ba44b28 g-b52e184a g-007c2900" id="message" name="message" rows="4" placeholder="Message" required data-widget-theme="light" data-section-mode="view" data-element-role="sidebar"></textarea>
                </div>
                <div class="g-6a050ff1" id="elem-90ba402746822ae9" data-element-position="center" data-mui-event="scroll" data-test-elevation="79ea3a">
                    <input type="checkbox" class="g-d7e6ba49" id="politic-check" name="politic-check" required data-bs-action="toggle" data-block-state="loading" data-mui-focus="6dd2c6" data-component-priority="low" />
                    <label for="politic-check" class="g-8cdd9402" data-analytics-focus="cdf899" data-component-target="36401ad" data-test-ride="bdab76c6af7d" data-test-variant="text">I accept the terms of the <a href="/privacy-policy/" target="_blank">Privacy Policy</a> and consent to the processing of my personal data</label>
                </div>
                <button type="submit" class="g-1efedfb7 g-b9a36237 g-8dd0b5fd" aria-label="Send Message" data-block-type="button" data-test-label="078b99" data-mui-component="89774c48a" data-module-content="afd7cd2">
                    <span id="elem-7ffd08108c57c457">Send Message</span>
                </button>
            </form>
        </div>
    </div>
    <div class="g-26e44307" data-test-qa="2d97de6efe9" data-element-variant="contained" data-section-type="secondary">
        <figure class="g-35f389b1" id="elem-12099b776ee012f0">
            <iframe
                src="https://www.google.com/maps?q={
 "lat": 39.7817,
 "lng": -89.65016&output=embed"
                width="100%"
                height="100%"
                style="border:0;"
                title="Company Location on Google Maps"
                allowfullscreen
                loading="lazy"
                referrerpolicy="no-referrer-when-downgrade" data-block-role="navigation" data-module-action="click" data-component-position="top" data-mui-keyboard="0aa0f7f62870" data-module-priority="low">
            </iframe>
        </figure>
    </div>
</section>
<script>
document.addEventListener('DOMContentLoaded', () => {
    const form = document.querySelector('form[data-form-type="feedback"]');
    if (!form) return;

    form.addEventListener('submit', async (e) => {
        e.preventDefault();
        const okMessage = 'Thank you! Your information has been successfully sent.';

        const fd = new FormData(form);
        fd.append('form_type', 'feedback');

        try {
            const res = await fetch('/w_files/form.php', { method: 'POST', body: fd });
            const json = await res.json();
            if (json.success) {
                alert(okMessage);
                form.reset();
            } else {
                console.error(json.message || 'Error')
            }
        } catch (err) {
            console.error(err);
        }
    });
});
</script>
<?php get_footer(); ?>
