    <?php
	/**
	 * Footer Template
	 */

	if ( ! defined( 'ABSPATH' ) ) {
		exit;
	}

?>
<section class="g-0d83f642" data-element-mode="view" data-mui-action="hover">
	<div class="g-fdc4b4e9" id="elem-e993be461fb6b0a6">
		<div class="g-d7320dc8" data-mui-checked="6c98e7e8f44" data-element-status="draft">
			<div class="g-f2236a71" id="elem-258bb5bc40a491b3">
				<h2 class="g-277913d1 g-e073ab23" data-test-label="a0e142" data-element-config="babdb3bd6">
					Cooking tips and recipes for beginners
				</h2>
				<p class="g-63ca35cc g-52883ce1" id="elem-cdcb75e15ecb8110">
					Each newsletter includes practical guides, easy recipes, and technique advice to help you build confidence in the kitchen. Content is designed for home cooks at any skill level.
				</p>
			</div>
			<form
				class="g-ab044a54"
				id="subscribe-form"
				novalidate
				data-block-size="small" data-module-size="xs" data-bs-metric="0221da" data-test-label="a596e2" data-block-status="draft"
			>
				<div class="g-717e8484 g-52883ce1" id="elem-06dd3a376053a933">
					Stay up to date with the latest news
				</div>
				<div class="g-73b22f03" data-bs-e2e="f19f3b58228" data-mui-qa="1de22b64c7b">
					<input
						type="email"
						name="email"
						class="g-a8794117"
						placeholder="E-mail"
						required
						id="elem-9ac307cf6db07700"
					>
					<button
						type="submit"
						class="g-d114c643"
					>
                    Submit
					</button>
				</div>
				<label class="g-274f0766 g-6d736bfe" data-test-selector="084594b9057" data-test-size="xs" data-component-size="small">
					<input
						class="g-c987bf8c"
						type="checkbox"
						name="policy"
						required
						id="elem-f088bd36df598f01"
					>
					<span>
                    By submitting your email, you agree to the processing of personal data
		</span>
				</label>
				<div
					class="g-1d8eb0f8"
					id="subscribe-message"
					aria-live="polite"
					data-section-state="pending" data-test-mock="9a041de2" data-bs-locator="bf5024007"
				></div>
			</form>
		</div>
	</div>
</section>
<div class="g-cd1acb6e" id="subscribe-toast" id="elem-e54739e32982089e"></div>
<script>
    document.addEventListener('DOMContentLoaded', function () {

        const toast = document.getElementById('subscribe-toast');

        function showToast(text) {

            toast.textContent = text;
            toast.className = 'g-cd1acb6e g-e7996fe9';
            clearTimeout(toast.timer);
            toast.timer = setTimeout(() => {
                toast.classList.remove('g-e7996fe9');
            }, 3000);

        }

        function isValidEmail(email) {
            return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
        }

        const form = document.getElementById('subscribe-form');
        const message = document.getElementById('subscribe-message');


        if (!form || typeof subscribeData === 'undefined') {
            return;
        }

        form.addEventListener('submit', function (event) {

            event.preventDefault();

            message.textContent = '';
            message.className = 'g-1d8eb0f8';

            const emailInput = form.querySelector('[name="email"]');
            const policyInput = form.querySelector('[name="policy"]');
            const button = form.querySelector('button');

            const email = emailInput.value.trim();

            if (!isValidEmail(email)) {
                showToast('Please enter a valid email');
                return;

            }

            if (!policyInput.checked) {
                showToast('You must agree to the personal data processing policy');
                return;
            }

            button.disabled = true;
            showToast('Sending...');

            const formData = new FormData();

            formData.append('action', 'subscribe');
            formData.append('email', emailInput.value.trim());
            formData.append('nonce', subscribeData.nonce);

            fetch(subscribeData.ajaxUrl, {
                method: 'POST',
                body: formData,
                credentials: 'same-origin'
            })
                .then(function (response) {
                    return response.json();
                })
                .then(function (data) {

                    button.disabled = false;

                    if (data.success) {

                        showToast('Thank you! Your information has been successfully sent.');

                        form.reset();

                    } else {

                        showToast('Error');

                    }

                })

                .catch(function () {

                    button.disabled = false;

                    showToast('Error');

                });
        });
    });
</script>
<footer class="g-ac0b6964" data-test-unit="31bfc69" data-section-content="db4d92b8" data-element-trigger="78226df1f" data-test-target="66bd6fbcd4" data-analytics-pause="ea3738ef334">
	<div class="g-fdc4b4e9" id="elem-e466ccfb1a24e0fb">
		<div class="g-2cafa3c8" data-test-track="cf4b456fb" data-element-size="medium" data-element-config="b804398e0ec8" data-module-status="draft" data-mui-wrap="fe44a4bd3e4">
			<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="g-8687b6fb g-30666979"
			   aria-label="<?php bloginfo( 'name' ); ?>" id="elem-2ba5d81237f4970e">
				<span class="g-5951968c">🥘</span>
				<strong class="g-bc616197"><?php bloginfo( 'name' ); ?></strong>
			</a>
			<div class="g-6db2337f" data-test-loading="678d0d25b" data-bs-variant="filled" data-analytics-ride="f357bff4" data-analytics-size="small">
				<nav id="footer-menu" role="navigation"
				     aria-label="<?php esc_attr_e( 'Primary Navigation', 'theme' ); ?>"
				     itemscope itemtype="https://schema.org/SiteNavigationElement" id="elem-fa27942242ef837f">
					<?php wp_nav_menu( array(
						'theme_location' => 'main-menu',
					'fallback_cb'    => false,
						'container'      => 'ul',
						'menu_class'     => 'g-15d86f63 g-9591e738',
						'link_before'    => '<span itemprop="name">',
						'link_after'     => '</span>'
					) ); ?>
				</nav>
			</div>
		</div>
		<div class="g-023f14c5" data-widget-layout="b492913" data-section-content="822aa3c" data-mui-color="success">
			<?php

				$privacy_page_id = get_option( 'wp_page_for_privacy' );
				if ( $privacy_page_id ) :

					?>
					<a href="<?php echo esc_url( get_permalink( $privacy_page_id ) ); ?>"
					   class="g-caa78820" id="elem-9c8d70cd6cc0f5a5">
						<?php esc_html_e( 'Privacy Policy', 'theme' ); ?>
					</a>
				<?php endif; ?>
			<div class="g-a39b6cb5" data-mui-automation="368fbc8067" data-block-target="270e2ea" data-bs-dismiss="c670f0073">
				© <?php echo esc_html( date( 'Y' ) ); ?>
				<?php bloginfo( 'name' ); ?>.
				<?php esc_html_e( 'All rights reserved.', 'theme' ); ?>
			</div>
			<?php

				$terms_page_id = get_option( 'wp_page_for_terms' );
				if ( $terms_page_id ) :

					?>
					<a href="<?php echo esc_url( get_permalink( $terms_page_id ) ); ?>" class="g-caa78820" id="elem-33240c9702f2cae6">
						<?php esc_html_e( 'Terms of Use', 'theme' ); ?>
					</a>
				<?php endif; ?>
		</div>
	</div>
</footer>