---
import SectionHeader from "@components/base/SectionHeader.astro";
import { CONTACT_CONSTANTS } from "@constants/constants.ts";

interface Props {
  city?: string;
  title?: string;
  address?: string;
  mapUrl?: string;
}

const {
  city = "СУРГУТЕ",
  title = "Наш офис",
  address = CONTACT_CONSTANTS.address,
  mapUrl = "https://yandex.ru/map-widget/v1/?um=constructor%3Acdxezk6x&source=constructor",
} = Astro.props;
---

<section class="py-16 bg-gradient-to-b from-gray-50 to-white -mx-4 md:mx-0">
  <div class="w-full px-4 md:container md:mx-auto md:px-4 md:max-w-7xl">
    <!-- Заголовок секции -->
    <div class="text-center mb-12">
      <h2 class="text-3xl md:text-4xl font-bold text-gray-900 mb-4">
        Как нас <span class="text-[var(--color-gold)]">найти</span>
      </h2>
      <p class="text-gray-600 max-w-2xl mx-auto">
        Мы находимся в центре города, удобный подъезд и парковка
      </p>
    </div>

    <!-- Карта с информационной карточкой -->
    <div class="relative bg-white rounded-3xl shadow-2xl overflow-hidden">
      <div class="grid grid-cols-1 lg:grid-cols-3">
        <!-- Информационная панель -->
        <div
          class="bg-[var(--color-navy)] p-8 flex flex-col justify-center text-center lg:text-left"
        >
          <div class="mb-8">
            <div
              class="w-14 h-14 bg-[var(--color-gold)] rounded-xl flex items-center justify-center mx-auto lg:mx-0 mb-6"
            >
              <svg
                class="w-7 h-7 text-white"
                fill="none"
                stroke="currentColor"
                viewBox="0 0 24 24"
              >
                <path
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  stroke-width="2"
                  d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
                ></path>
                <path
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  stroke-width="2"
                  d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"></path>
              </svg>
            </div>
            <h3
              class="text-white font-bold text-xl uppercase tracking-wider mb-2"
            >
              {title}
            </h3>
            <p class="text-gray-400 text-sm">{city}</p>
          </div>

          <div class="space-y-4 text-center lg:text-left">
            <div
              class="flex flex-col items-center lg:flex-row lg:items-start gap-3"
            >
              <svg
                class="w-5 h-5 text-[var(--color-gold)] mt-1 flex-shrink-0"
                fill="none"
                stroke="currentColor"
                viewBox="0 0 24 24"
              >
                <path
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  stroke-width="2"
                  d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
                ></path>
                <path
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  stroke-width="2"
                  d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"></path>
              </svg>
              <div>
                <p class="text-gray-400 text-xs uppercase tracking-wider mb-1">
                  Адрес
                </p>
                <p class="text-white font-medium">{address}</p>
              </div>
            </div>

            <div
              class="flex flex-col items-center lg:flex-row lg:items-start gap-3"
            >
              <svg
                class="w-5 h-5 text-[var(--color-gold)] mt-1 flex-shrink-0"
                fill="none"
                stroke="currentColor"
                viewBox="0 0 24 24"
              >
                <path
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  stroke-width="2"
                  d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
              </svg>
              <div>
                <p class="text-gray-400 text-xs uppercase tracking-wider mb-1">
                  Режим работы
                </p>
                <p class="text-white font-medium">Пн-Пт: 09:00 - 18:00</p>
                <p class="text-gray-500 text-sm">Сб-Вс: По записи</p>
              </div>
            </div>

            <div
              class="flex flex-col items-center lg:flex-row lg:items-start gap-3"
            >
              <svg
                class="w-5 h-5 text-[var(--color-gold)] mt-1 flex-shrink-0"
                fill="none"
                stroke="currentColor"
                viewBox="0 0 24 24"
              >
                <path
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  stroke-width="2"
                  d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
                ></path>
              </svg>
              <div>
                <p class="text-gray-400 text-xs uppercase tracking-wider mb-1">
                  Телефон
                </p>
                <a
                  href={CONTACT_CONSTANTS.phoneHref}
                  class="text-white font-medium hover:text-[var(--color-gold)] transition-colors"
                >
                  {CONTACT_CONSTANTS.phone}
                </a>
              </div>
            </div>
          </div>

          <a
            href={mapUrl}
            target="_blank"
            rel="noopener noreferrer"
            class="mt-8 inline-flex items-center justify-center gap-2 px-6 py-3 bg-[var(--color-gold)] hover:bg-[var(--color-gold-hover)] text-white font-bold rounded-xl transition-all w-full lg:w-auto"
          >
            <span>Построить маршрут</span>
            <svg
              class="w-5 h-5"
              fill="none"
              stroke="currentColor"
              viewBox="0 0 24 24"
            >
              <path
                stroke-linecap="round"
                stroke-linejoin="round"
                stroke-width="2"
                d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
              ></path>
            </svg>
          </a>
        </div>

        <!-- Карта -->
        <div class="lg:col-span-2 relative h-[400px] lg:h-auto">
          <iframe
            src={mapUrl}
            width="100%"
            height="100%"
            style="border:0; min-height: 400px;"
            allowfullscreen
            loading="lazy"
            title="Карта проезда"
            class="absolute inset-0 w-full h-full"></iframe>
        </div>
      </div>
    </div>
  </div>
</section>
