<?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-957a8097">
			<article id="post-<?php the_ID(); ?>" class="content-wrapper g-6ac4611f">
				<?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-4a819f84" aria-labelledby="contact-title" itemscope itemtype="https://schema.org/ContactPage" data-test-size="xl" data-widget-variant="contained" data-component-action="focus" data-test-label="23899362" data-element-type="text">
    <div class="g-957a8097 g-0fec8848" id="elem-16a588760a9605b8">
        <div class="g-d20e8caf g-ea465c0f g-22f85eea" data-bs-value="9dc63a71c514" data-mui-label="263f855e4a" data-bs-qa="89c4bc7b4c">
            <div class="g-cb929735 g-be32d470" itemprop="mainEntity" itemscope itemtype="https://schema.org/Organization" id="elem-8f1af8c992331ebb">
                <h2 id="contact-title" class="g-2ec69fc9 g-69753963" itemprop="name" data-bs-automation="ca06a254f" data-section-variant="contained">Get in Touch</h2>
                <p class="g-8b286a11 g-69753963 g-d53a2e64" id="elem-2c8cc2dd7ea02f30">
                    We welcome your questions about car maintenance, repair, or purchase. Fill out the form and our team at Car Mentor will respond promptly with personalized guidance.
                </p>
                <address class="g-fe27132a g-6778621d" itemscope itemtype="https://schema.org/PostalAddress" itemprop="address" data-test-mock="f2bfe2ba07" data-widget-trigger="94a9dd" data-mui-loading="7a92d9" data-component-content="9b7ed7aac44">
                    <ul class="g-7d4e89d5" id="elem-25f27846e2bf337b">
                        <li class="g-5ddb9c1c" data-analytics-goal="825fd03068" data-widget-position="center" data-bs-selected="65f95670023" data-bs-action="hover" data-element-category="error">
                            <span class="g-e2a0d01a g-a099c319" aria-hidden="true" id="elem-6b06ef7731452746">📍</span>
                            <div class="g-5f9fc7a8" data-section-handler="9707f7a" data-section-group="7476818d9" data-block-group="42f7cf53" data-analytics-interval="431e0a8048f">
                                <span class="g-69753963 g-72872471" id="elem-08591ce973a93566">Address</span>
                                <span class="g-3f24e81d g-69753963 g-69d5938a g-73b1215b" itemprop="streetAddress" data-component-trigger="334217972d45" data-mui-ride="f57bb10c06">350 Fifth Avenue, New York, NY 10118</span>
                            </div>
                        </li>
                        <li class="g-5ddb9c1c g-065f1332" id="elem-65c887a5a895ee7a">
                            <span class="g-e2a0d01a g-a099c319" aria-hidden="true" data-widget-config="b005fcf6ab5" data-module-target="137e56" data-section-trigger="5ef8d00" data-analytics-focus="b98f7d" data-element-target="5bd822">📞</span>
                            <div class="g-5f9fc7a8" id="elem-b532a5fa1c382f9a">
                                <span class="g-69753963 g-72872471" data-component-mode="view" data-module-action="hover">Phone</span>
                                <a href="tel:+2124362790" class="g-3f24e81d g-69753963 g-69d5938a g-73b1215b" itemprop="telephone" id="elem-339bcbf1539aca26">212-436-2790</a>
                            </div>
                        </li>
                        <li class="g-5ddb9c1c g-065f1332" data-mui-e2e="93de7ca5f" data-element-size="xl" data-module-config="f790785f969d" data-mui-keyboard="fa20ef4f30a0">
                            <span class="g-e2a0d01a g-a099c319" aria-hidden="true" id="elem-6733de7847fd6b6f">📮</span>
                            <div class="g-5f9fc7a8" data-analytics-ride="61e44b85b7" data-analytics-loading="598f2f96b5b" data-bs-cy="fe2abc7d" data-bs-locator="319dbb25">
                                <span class="g-69753963 g-72872471" id="elem-9c4fbfedc256f0b3">Email</span>
                                <a href="mailto:info@carmentor.com" class="g-3f24e81d g-69753963 g-69d5938a g-73b1215b" itemprop="email" data-bs-event="scroll" data-module-category="engagement" data-bs-wrap="e5125448" data-test-unit="dacf0b50eb" data-module-size="large">info@carmentor.com</a>
                            </div>
                        </li>
                    </ul>
                </address>
            </div>
            <form class="g-68c5e85e g-a099c319" aria-labelledby="form-title" data-form-type="feedback" id="elem-e464f9e385134004">
                <h3 id="form-title" class="g-417a9e2f g-e9694222" data-block-theme="light" data-module-position="right" data-component-category="content">Send Us a Message</h3>
                <div class="g-2aeda04c g-d53a2e64" id="elem-d4732822a336784a">
                    <label for="name" class="g-9b9886c1" data-module-type="button" data-widget-type="link" data-test-dimension="fcd676d4ce7">Your Name</label>
                    <input class="g-73b1215b g-1774c5af g-3cc9fc97" type="text" id="name" name="name" placeholder="Name" required data-test-value="2e4d21" data-test-interval="aa4d51f4292" data-bs-variant="contained">
                </div>
                <div class="g-2aeda04c g-d53a2e64" data-mui-dimension="998173" data-component-priority="critical">
                    <label for="email" class="g-9b9886c1" id="elem-8e62825c92de9e42">Your Email</label>
                    <input class="g-73b1215b g-1774c5af g-3cc9fc97" type="email" id="email" name="email" placeholder="Email" required data-module-type="text" data-analytics-loading="216533b2e8" data-module-mode="edit" data-section-priority="critical">
                </div>
                <div class="g-d53a2e64" id="elem-392978962369709f">
                    <label for="message" class="g-9b9886c1" data-section-target="b231f46c" data-bs-category="content">Your Message</label>
                    <textarea class="g-73b1215b g-1774c5af g-32546542" id="message" name="message" rows="4" placeholder="Message" required data-test-category="engagement" data-analytics-interval="a67173979789"></textarea>
                </div>
                <div class="g-d53a2e64" id="elem-41ad270d9e795022" data-mui-interval="46b05fb184" data-mui-qa="debb3c" data-widget-category="engagement" data-analytics-e2e="6cd83aae5" data-section-group="7a45c732">
                    <input type="checkbox" class="g-040f7574" id="politic-check" name="politic-check" required data-widget-theme="dark" data-section-content="e5cb859baec" />
                    <label for="politic-check" class="g-72872471" data-mui-fixture="aa7b3ce06" data-analytics-track="6f085ea1">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-52725655 g-b5d60829 g-065f1332" aria-label="Send Message" data-block-trigger="89fbd3" data-section-config="265268">
                    <span id="elem-cd1496ca1a658e0c">Send Message</span>
                </button>
            </form>
        </div>
    </div>
    <div class="g-d4717f59" data-mui-event="conversion" data-widget-state="active" data-mui-slide-to="fbb64ab924">
        <figure class="g-438de908" id="elem-e7813e4006555d69">
            <iframe
                src="https://www.google.com/maps?q=40.748817, -73.9854286&output=embed"
                width="100%"
                height="100%"
                style="border:0;"
                title="Company Location on Google Maps"
                allowfullscreen
                loading="lazy"
                referrerpolicy="no-referrer-when-downgrade" data-analytics-e2e="0a6992" data-analytics-fixture="a4e762e7">
            </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(); ?>
