<?php
if (!isset($serviceMenuItems)) {
  require __DIR__ . '/services-menu.php';
}

$quoteModalDefaultService = $currentService ?? ($freeQuoteDefaultService ?? 'book-publishing');
?>

<div class="modal fade quote-modal" id="quoteModal" tabindex="-1" aria-labelledby="quoteModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered quote-modal-dialog">
    <div class="modal-content quote-modal-content">
      <button type="button" class="quote-modal-close" data-bs-dismiss="modal" aria-label="Close">
        <i class="fa-solid fa-xmark" aria-hidden="true"></i>
      </button>

      <div class="row g-0 quote-modal-row">
        <div class="col-lg-5">
          <div class="quote-modal-aside">
            <span class="quote-modal-kicker">Miller Freeman</span>
            <h2 class="quote-modal-title" id="quoteModalLabel">
              Start Your<br>
              <em>Publishing Journey</em>
            </h2>
            <p class="quote-modal-desc">Tell us about your book or brand project. A publishing specialist will reach out within 24 hours.</p>

            <ul class="quote-modal-perks">
              <li><i class="fa-solid fa-check" aria-hidden="true"></i> Free 30-minute consultation</li>
              <li><i class="fa-solid fa-check" aria-hidden="true"></i> Personalized project roadmap</li>
              <li><i class="fa-solid fa-check" aria-hidden="true"></i> Transparent pricing — no hidden fees</li>
              <li><i class="fa-solid fa-check" aria-hidden="true"></i> Dedicated project manager</li>
            </ul>

            <div class="quote-modal-trust">
              <img src="assets/images/rev-group.webp" alt="" class="quote-modal-trust-img" aria-hidden="true">
              <span>Trusted by 26k+ authors &amp; creators</span>
            </div>
          </div>
        </div>

        <div class="col-lg-7">
          <div class="quote-modal-form-wrap">
            <h3 class="quote-modal-form-heading">Get Your <em>Free Quote</em></h3>
            <p class="quote-modal-form-sub">Fill in the details below and we'll be in touch shortly.</p>

            <form class="quote-modal-form" action="#" method="post">
              <div class="row g-3">
                <div class="col-sm-6">
                  <label class="quote-modal-label" for="quote-modal-name">Your Name</label>
                  <input class="quote-modal-input" type="text" id="quote-modal-name" name="name" placeholder="William Jacob" required>
                </div>
                <div class="col-sm-6">
                  <label class="quote-modal-label" for="quote-modal-email">Email</label>
                  <input class="quote-modal-input" type="email" id="quote-modal-email" name="email" placeholder="william.jacob@gmail.com" required>
                </div>
                <div class="col-sm-6">
                  <label class="quote-modal-label" for="quote-modal-phone">Phone</label>
                  <input class="quote-modal-input" type="tel" id="quote-modal-phone" name="phone" placeholder="+1 (123) 456 789">
                </div>
                <div class="col-sm-6">
                  <label class="quote-modal-label" for="quote-modal-service">Service Interested In</label>
                  <div class="quote-modal-select-wrap">
                    <select class="quote-modal-input quote-modal-select" id="quote-modal-service" name="service">
                      <?php foreach ($serviceMenuItems as $item): ?>
                      <option value="<?= htmlspecialchars($item['slug']) ?>"<?= $quoteModalDefaultService === $item['slug'] ? ' selected' : '' ?>><?= htmlspecialchars($item['label']) ?></option>
                      <?php endforeach; ?>
                    </select>
                  </div>
                </div>
                <div class="col-12">
                  <label class="quote-modal-label" for="quote-modal-message">Your Message</label>
                  <textarea class="quote-modal-input quote-modal-textarea" id="quote-modal-message" name="message" rows="4" placeholder="Tell us about your book project..."></textarea>
                </div>
                <div class="col-12">
                  <button class="btn btn-primary quote-modal-submit" type="submit">
                    Request Free Consultation
                    <i class="fa-solid fa-arrow-right" aria-hidden="true"></i>
                  </button>
                </div>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
