<div class="modal fade" id="whatsapp" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <div class="modal-title">Message on WhatsApp</div>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <form method="post" target="_blank" id="whatsapp_form">
                    <span class="text-danger wht_error_message"></span>
                    <span class="text-success wht_success_message"></span>
                    <div class="row">
                        <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                            <div class="form-group">
                                <input class="form-control" type="text" name="name" placeholder="Full Name*" value="" onkeyup="validateOnlyTextField(this)" pattern="[a-zA-Z\s]+" required>
                            </div>
                        </div>
                        <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                            <div class="form-group">
                                <input type="hidden" name="countryName" class="countryName" value="">
                                <input type="hidden" name="code" class="code" value="">
                                <!-- <input type="hidden" name="code" class="country-code" value="">  -->
                                <input class="form-control phone-input" type="tel" name="mobile" value="" placeholder="Mobile Number*" maxlength="10" minlength="10" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" required>
                            </div>
                        </div>
                        <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                            <button type="submit" name="whatsapp_submit" class="read_more_btn_2">Submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <div class="modal-title">Quick Enquiry</div>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <form id="enq_pop_form1" method="post">
                    <div id="enq_pop_up"></div>
                    <!-- <script src="https://www.google.com/recaptcha/api.js" async defer></script> -->
                    <div class="form-group">
                        <input class="form-control" type="text" name="name" placeholder="Full Name*" onkeyup="validateOnlyTextField(this)" pattern="[a-zA-Z\s]+" value="" required>
                    </div>

                    <div class="form-group">
                        <input class="form-control" type="email" name="email" value="" placeholder="Email ID*" required>
                    </div>

                    <div class="form-group">
                        <input type="hidden" name="countryName" class="countryName" value="">
                        <input type="hidden" name="code" class="code" value="">
                        <!-- <input type="hidden" name="code" class="country-code" value="">  -->
                        <input class="phone-input form-control" type="tel" name="mobile" value="" placeholder="Mobile Number*" maxlength="10" minlength="10" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" required>
                    </div>

                    <div class="form-group">
                        <input class="form-control" type="text" name="location" value="" placeholder="Your Location*" required>
                    </div>

                    <div class="form-group">
                        <textarea class="form-control" name="message" placeholder="Your Message*" required onkeyup="validateMessageField(this)"></textarea>
                    </div>

                    <div class="form-group" style="margin-bottom: 0;">
                        <div class="g-recaptcha" data-sitekey="<?=site_key;?>"></div>
                    </div>

                    <button type="submit" name="submit_enq" class="read_more_btn_2">Submit</button>
                </form>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="productID" tabindex="-1">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <div class="modal-title">Send Enquiry</div>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-xxl-7 col-xl-7 col-lg-7 col-md-7 col-sm-7 col-12">
                        <div class="product_popup">
                        <div class="product_popup_image">
                                <img class="catImg" src="<?= site_url; ?>/designer/images/image4.jpg" alt="<?=COMPANY;?>" title="<?=COMPANY;?>">
                            </div>
                            <div class="fs-6 fw-bold catName"><?=COMPANY;?></div>
                        </div>
                    </div>
                    <div class="col-xxl-5 col-xl-5 col-lg-5 col-md-5 col-sm-5 col-12">

                        <form name="contact-form" method="post" id="product_pop_form">
                            <div id="cat_pop_up"></div>
                            <!-- <script src="https://www.google.com/recaptcha/api.js" async defer></script> -->
                            <div class="form-group">
                                <input class="form-control" type="text" name="name" placeholder="Full Name*" value="" onkeyup="validateOnlyTextField(this)" 
                                pattern="[a-z A-Z]+" required>
                            </div>

                            <div class="form-group">
                                <input class="form-control" type="email" name="email" placeholder=" Email ID*" value="" required>
                            </div>

                            <div class="form-group">
                                <input type="hidden" class="countryName countryName" name="countryName" value="">
                                <input type="hidden" name="code" class="code" value="">
                                <!-- <input type="hidden" name="code" class="country-code" value="">  -->
                                <input class="phone-input form-control" type="tel" name="mobile" placeholder=" Phone No*" value="" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')"  minlength="10" maxlength="10"  autocomplete="off" required>
                            </div>

                            <div class="form-group">
                                <input class="form-control" type="text" name="location" placeholder="Location*" value="" pattern="[a-z A-Z]+" autocomplete="off" required>
                            </div>

                            <div class="form-group">
                                <input type="text" class="form-control" name="quantity" placeholder="Minimum Order Value*"  value=""  maxlength="7"
                              onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" required>
                            </div>

                            <div class="form-group">
                                <textarea class="form-control" name="message" placeholder=" Message*" required  onkeyup="validateMessageField(this)"></textarea>
                            </div>

                            <div class="form-group" style="margin-bottom: 0;">
                                <div class="g-recaptcha" data-sitekey="<?=site_key;?>"></div>
                            </div>

                            <div class="form-group">
                                <button type="submit" name="submit_cat_popup" class="read_more_btn_2">Submit</button>
                            </div>
                        </form>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="callback" tabindex="-1">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <div class="modal-title">Get Callback Quickly</div>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-xxl-5 col-xl-5 col-lg-5 col-md-5 col-sm-5 col-12">
                        <div class="product_popup">
                            <div class="product_popup_image">
                                <img class="catImg" src="<?= site_url; ?>/designer/images/image4.jpg" alt="<?=COMPANY;?>" title="<?=COMPANY;?>">
                            </div>
                            <div class="fs-6 fw-bold catName"><?=COMPANY;?></div>
                        </div>
                    </div>
                    <div class="col-xxl-7 col-xl-7 col-lg-7 col-md-7 col-sm-7 col-12">

                        <form name="contact-form" method="post" id="callback_form">
                            <div id="cpop_up"></div>
                            <!-- <script src="https://www.google.com/recaptcha/api.js" async defer></script> -->
                            <div class="form-group">
                                <input class="form-control" type="text" name="name" placeholder="Full Name*" value="" pattern="[a-z A-Z]+" required>
                            </div>


                            <div class="form-group">
                                <input type="hidden" class="countryName countryName" name="countryName" value="">
                                <input type="hidden" name="code" class="code" value="">
                                <!-- <input type="hidden" name="code" class="country-code" value="">  -->
                                <input class="form-control phone-input" type="tel" name="mobile" placeholder=" Phone No*" value="" maxlength="10" minlength="10" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" required>
                            </div>
                            <p>We will contact you on this number</p>

                            <div class="form-group">
                                <button type="submit" name="submit_callback" class="read_more_btn_2">Submit</button>
                            </div>
                        </form>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>

function validateMessageField(field) {
    let value = field.value;

    // 1️⃣ Remove URLs (http, https, www)
    value = value.replace(/(https?:\/\/[^\s]+|www\.[^\s]+)/gi, '');

    // 2️⃣ Remove disallowed characters
    value = value.replace(/[^a-zA-Z0-9\s.,!?-]/g, '');

    // Symbols allowed only once
    const symbols = ['..', ',,', '!!', '??', '--'];
    symbols.forEach(sym => {
        const firstIndex = value.indexOf(sym);
        if (firstIndex !== -1) {
            // Keep first occurrence and remove all others
            value = value.substring(0, firstIndex + 0) +
                    value.substring(firstIndex + 1).replace(new RegExp('\\' + sym, 'g'), '');
        }
    });

    field.value = value;
}
</script>