<script lang="ts">
  import BookingSection from '$lib/components/BookingSection.svelte';
  import Icon from '$lib/components/Icon.svelte';
  import InfoSection from '$lib/components/InfoSection.svelte';
  import PageHeader from '$lib/components/PageHeader.svelte';
  import type { BookingContent, InfoContent } from '$lib/types';

  export let booking: BookingContent;
  export let info: InfoContent;
  export let allowGeneralEnquiry = false;

  const email = 'info@goodwalk.co.nz';
  const phone = '(022) 642 1011';
  const phoneHref = `tel:${phone.replace(/[^0-9+]/g, '')}`;
</script>

<main class="booking-page">
  <PageHeader
    variant="green"
    title="Contact Us"
    subtitle={allowGeneralEnquiry
      ? "Book a Meet & Greet or send a general enquiry. We'll come back within 24 hours."
      : "Tell us a little about your dog and we'll be in touch within 24 hours to arrange a free Meet & Greet."}
  >
    <div class="booking-page-contact">
      <a href="mailto:{email}" class="booking-contact-link">
        <Icon name="fas fa-envelope" />
        {email}
      </a>
      <a href={phoneHref} class="booking-contact-link">
        <Icon name="fas fa-phone" />
        {phone}
      </a>
    </div>
  </PageHeader>

  <BookingSection {booking} {allowGeneralEnquiry} />
  <InfoSection {info} />
</main>

<style>
  .booking-page {
    background: var(--off-white);
  }

  .booking-page-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 28px;
  }

  .booking-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: #fff;
    transition: background 0.2s;
  }

  .booking-contact-link:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  @media (max-width: 768px) {
    .booking-page-contact {
      gap: 12px;
    }

    .booking-contact-link {
      font-size: 13px;
      padding: 9px 16px;
    }
  }
</style>
