<?php
$formIdPrefix = $formIdPrefix ?? 'service';
$defaultService = $defaultService ?? 'book-publishing';

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

<form class="service-banner-form" action="#" method="post">
  <h3 class="service-banner-form-title">Get a <em>Free Quote</em></h3>
  <p class="service-banner-form-desc">Tell us about your project and we'll respond within 24 hours.</p>

  <div class="service-banner-form-fields">
    <div class="service-banner-form-group">
      <label class="service-banner-form-label" for="<?= $formIdPrefix ?>-name">Your Name</label>
      <input class="service-banner-form-input" type="text" id="<?= $formIdPrefix ?>-name" name="name" placeholder="William Jacob" required>
    </div>

    <div class="service-banner-form-group">
      <label class="service-banner-form-label" for="<?= $formIdPrefix ?>-email">Email</label>
      <input class="service-banner-form-input" type="email" id="<?= $formIdPrefix ?>-email" name="email" placeholder="william.jacob@gmail.com" required>
    </div>

    <div class="service-banner-form-group">
      <label class="service-banner-form-label" for="<?= $formIdPrefix ?>-phone">Phone</label>
      <input class="service-banner-form-input" type="tel" id="<?= $formIdPrefix ?>-phone" name="phone" placeholder="+1 (123) 456 789">
    </div>

    <div class="service-banner-form-group">
      <label class="service-banner-form-label" for="<?= $formIdPrefix ?>-service">Service Interested In</label>
      <div class="service-banner-form-select-wrap">
        <select class="service-banner-form-input service-banner-form-select" id="<?= $formIdPrefix ?>-service" name="service">
          <?php foreach ($serviceMenuItems as $item): ?>
          <option value="<?= htmlspecialchars($item['slug']) ?>"<?= $defaultService === $item['slug'] ? ' selected' : '' ?>><?= htmlspecialchars($item['label']) ?></option>
          <?php endforeach; ?>
        </select>
      </div>
    </div>

    <div class="service-banner-form-group">
      <label class="service-banner-form-label" for="<?= $formIdPrefix ?>-message">Your Message</label>
      <textarea class="service-banner-form-input service-banner-form-textarea" id="<?= $formIdPrefix ?>-message" name="message" rows="4" placeholder="Tell us about your book project..."></textarea>
    </div>

    <button class="btn btn-primary service-banner-form-submit" type="submit">Request Free Consultation</button>
  </div>
</form>
