import type { Metadata } from 'next'
import InternalPageTemplate from '@/components/InternalPageTemplate'
import BreadcrumbJsonLd from '@/components/BreadcrumbJsonLd'
import Link from 'next/link'
import { getTranslations } from 'next-intl/server'
import { buildAlternates } from '@/lib/seo'

export async function generateMetadata({
  params,
}: {
  params: Promise<{ locale: string }>
}): Promise<Metadata> {
  const { locale } = await params
  const t = await getTranslations('seo')
  const { canonical, languages } = buildAlternates(locale, '/guides/booking-com-price-by-country')
  return {
    title: t('guideBookingComCountry'),
    description:
      "Booking.com shows different hotel prices depending on which country you search from. Here's how to check the price your country sees versus the cheapest available rate.",
    openGraph: {
      title: 'Booking.com Price by Country: How to Find the Cheapest Rate',
      description:
        "The same Booking.com hotel listing can cost 10–40% more depending on your search country. Here's how to check all country prices at once.",
      type: 'article',
    },
    alternates: { canonical, languages },
  }
}

const articleSchema = {
  '@context': 'https://schema.org',
  '@type': 'Article',
  headline: 'Booking.com Price by Country: How to Check and Find the Cheapest Rate',
  description:
    "Booking.com shows different hotel prices depending on which country you search from. Here's how to check the price your country sees versus the cheapest available rate.",
  author: { '@type': 'Organization', name: 'CahooTravel' },
  publisher: {
    '@type': 'Organization',
    name: 'CahooTravel',
    logo: { '@type': 'ImageObject', url: 'https://www.cahootravel.com/cahootravel-logo.svg' },
  },
  datePublished: '2025-01-20',
  dateModified: '2025-01-20',
  mainEntityOfPage: 'https://www.cahootravel.com/guides/booking-com-price-by-country',
}

export default function BookingComPriceByCountry() {
  return (
    <InternalPageTemplate>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(articleSchema) }}
      />

      <article className="max-w-3xl">
        <div className="mb-10">
          <div className="flex items-center gap-3 mb-4">
            <span className="text-xs font-medium text-brand-purple bg-brand-purple-light px-2.5 py-1 rounded-full">
              Platform Guide
            </span>
            <span className="text-xs text-gray-400">6 min read</span>
          </div>
          <h1 className="text-4xl font-bold text-gray-900 mb-4 leading-tight">
            Booking.com Price by Country: How to Check and Find the Cheapest Rate
          </h1>
          <p className="text-gray-500 text-lg leading-relaxed">
            Booking.com is the world&apos;s largest hotel booking platform — and one of the most
            aggressive practitioners of geo-pricing. The same hotel on the same night can appear
            at a different price depending on which country your search originates from. Here&apos;s
            how to check all available country prices and find the cheapest one.
          </p>
        </div>

        <div className="mb-10 rounded-2xl overflow-hidden aspect-[16/7]">
          <img
            src="/guides/booking-com-price-by-country.jpg"
            alt="Booking.com hotel listing open on a laptop"
            className="w-full h-full object-cover"
          />
        </div>

        <div className="prose prose-gray max-w-none text-sm leading-relaxed space-y-8">

          <section>
            <h2 className="text-2xl font-bold text-gray-900 mb-3">
              Does Booking.com charge different prices by country?
            </h2>
            <p className="text-gray-600">
              Yes, definitively. Booking.com uses IP geolocation as the primary signal for price
              targeting. A user in Germany searching for a hotel in Bangkok sees a different price
              than a user in Thailand searching for the exact same room on the same night.
            </p>
            <p className="text-gray-600 mt-3">
              Price gaps of 15–30% are typical for international destinations. For Southeast Asian
              hotels — where Booking.com competes with Agoda and local platforms for
              budget-conscious regional travellers — gaps of 35–45% between the cheapest and most
              expensive markets are not uncommon.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-gray-900 mb-3">
              How Booking.com sets country-specific prices
            </h2>
            <p className="text-gray-600">
              Booking.com&apos;s pricing engine considers multiple factors when determining the price a
              specific user sees:
            </p>
            <ul className="list-disc pl-5 space-y-2 text-gray-600 mt-3">
              <li>
                <strong>Purchasing power of the user&apos;s country</strong> — users from high-income
                countries are shown higher prices; users from lower-income markets are shown more
                competitive rates.
              </li>
              <li>
                <strong>Local market competition</strong> — in markets where Booking.com competes
                with Agoda, Ctrip, or local OTAs, prices are reduced to remain competitive.
              </li>
              <li>
                <strong>Genius loyalty tier</strong> — Booking.com Genius discounts are applied on
                top of the market-specific base price, meaning a Genius member in the UK still
                pays more than a non-member user in Thailand for the same room.
              </li>
              <li>
                <strong>Country-targeted promotions</strong> — Booking.com regularly runs
                promotions visible only in specific markets, creating temporary price advantages
                in those countries.
              </li>
            </ul>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-gray-900 mb-3">
              Country price comparison: an example
            </h2>
            <p className="text-gray-600">
              To illustrate how large the gap can be, here is a representative comparison of how
              a mid-range Booking.com hotel in Bali, Indonesia might be priced across different
              countries for a standard double room:
            </p>
            <div className="bg-gray-50 rounded-xl border border-gray-100 overflow-hidden mt-4">
              <table className="w-full text-sm">
                <thead>
                  <tr className="bg-gray-100 text-left">
                    <th className="px-4 py-3 font-semibold text-gray-700">Country of search</th>
                    <th className="px-4 py-3 font-semibold text-gray-700">Booking.com price</th>
                    <th className="px-4 py-3 font-semibold text-gray-700">vs. cheapest</th>
                  </tr>
                </thead>
                <tbody className="divide-y divide-gray-100">
                  <tr>
                    <td className="px-4 py-3 text-gray-600">Indonesia (local)</td>
                    <td className="px-4 py-3 font-medium text-green-600">€44</td>
                    <td className="px-4 py-3 text-green-600">cheapest</td>
                  </tr>
                  <tr>
                    <td className="px-4 py-3 text-gray-600">India</td>
                    <td className="px-4 py-3 text-gray-700">€49</td>
                    <td className="px-4 py-3 text-gray-500">+11%</td>
                  </tr>
                  <tr>
                    <td className="px-4 py-3 text-gray-600">Australia</td>
                    <td className="px-4 py-3 text-gray-700">€58</td>
                    <td className="px-4 py-3 text-gray-500">+32%</td>
                  </tr>
                  <tr>
                    <td className="px-4 py-3 text-gray-600">United Kingdom</td>
                    <td className="px-4 py-3 text-gray-700">€63</td>
                    <td className="px-4 py-3 text-red-500">+43%</td>
                  </tr>
                </tbody>
              </table>
            </div>
            <p className="text-gray-500 text-xs mt-2">
              Illustrative example. Actual gaps vary by property, season, and dates.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-gray-900 mb-3">
              How to check Booking.com price by country
            </h2>
            <p className="text-gray-600">
              The straightforward method:
            </p>
            <ol className="list-decimal pl-5 space-y-3 text-gray-600 mt-3">
              <li>
                Find the hotel you want on Booking.com and copy the URL from your browser address
                bar. Include any date parameters already in the URL.
              </li>
              <li>
                Go to CahooTravel and paste the URL. CahooTravel fetches the Booking.com page as
                it would appear to users in 100+ different countries simultaneously.
              </li>
              <li>
                Review the price list sorted cheapest to most expensive. Note which country offers
                the lowest rate and how it compares to the price you were originally shown.
              </li>
              <li>
                Click the cheapest result to open Booking.com at that country&apos;s price and complete
                your booking normally.
              </li>
            </ol>
            <p className="text-gray-600 mt-3">
              The entire process takes under two minutes and requires no VPN, no foreign accounts,
              and no technical setup.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-gray-900 mb-3">
              Does this also work for Booking.com Genius rates?
            </h2>
            <p className="text-gray-600">
              Partially. CahooTravel fetches the public (non-personalised) price for each country
              — it cannot see Genius discounts, which Booking.com applies privately at checkout
              based on your account. This means CahooTravel may show a slightly higher price than
              what you personally see when logged in. However, once you open Booking.com in the
              cheapest country, your Genius discount is applied on top of that already-lower base
              price — so your final rate will typically be lower than your Genius rate in your
              home market.
            </p>
          </section>

          {/* CTA */}
          <div className="rounded-2xl bg-brand-purple text-white p-8 flex flex-col md:flex-row items-center justify-between gap-6 mt-4">
            <div>
              <h3 className="text-lg font-bold mb-1">Check your Booking.com price by country</h3>
              <p className="text-purple-200 text-sm">
                Paste any Booking.com URL and compare the price across 100+ countries in seconds.
                Find the cheapest available rate — free.
              </p>
            </div>
            <Link
              href="/"
              className="flex-shrink-0 bg-brand-yellow hover:bg-brand-yellow-dark text-gray-900 font-medium text-sm px-6 py-2.5 rounded-md transition-colors whitespace-nowrap"
            >
              Compare prices →
            </Link>
          </div>
        </div>
      </article>

      <BreadcrumbJsonLd
        items={[
          { name: 'Guides', path: '/guides' },
          { name: 'Booking.com Price by Country' },
        ]}
      />
    </InternalPageTemplate>
  )
}
