import Link from 'next/link';
import { ROUTES } from '@/lib/routes';

const FAQS = [
  {
    q: 'Who can become a vendor?',
    a: 'Sri Lankan artisans, makers, designers, small businesses, and brands offering authentic, high-quality products may apply. Every application is reviewed to ensure the products align with our marketplace and quality standards.',
  },
  {
    q: 'What types of products can I list?',
    a: 'We welcome handicrafts, locally designed products, home décor, gifts, lifestyle products, handmade creations, and other approved items. Products must be accurately described, legally permitted, and must not infringe another party’s intellectual property rights.',
  },
  {
    q: 'How do I apply?',
    a: 'Complete the vendor application form with your contact or business information, product categories, sample product photographs, and links to your website or social media pages, where available. We may contact you if additional information is required.',
  },
  {
    q: 'Is approval guaranteed after applying?',
    a: 'No. Submitting an application does not guarantee acceptance. CeylonHandicrafts.lk reserves the right to approve or decline applications based on product suitability, quality, authenticity, presentation, and marketplace requirements.',
  },
  {
    q: 'Are there any vendor fees?',
    a: 'Any applicable subscription, commission, or service details will be provided during onboarding or displayed inside the Vendor Portal. You will be able to review the applicable terms before activating your vendor account.',
  },
  {
    q: 'How are my products added to the website?',
    a: 'Approved vendors must provide clear product photographs, accurate descriptions, prices, available variations, stock information, and expected preparation or delivery times. We may review the information and request improvements before publishing a listing.',
  },
  {
    q: 'Who handles customer orders and enquiries?',
    a: 'CeylonHandicrafts.lk helps customers discover products and connect with vendors. Unless a product is clearly identified as being sold directly by CeylonHandicrafts.lk, the vendor remains responsible for confirming availability, accepting the order, arranging payment, fulfilling the order, and providing customer support.',
  },
  {
    q: 'How are customer payments handled?',
    a: 'CeylonHandicrafts.lk does not currently process online card payments. The available payment method and payment instructions must be confirmed directly between the vendor and the customer, unless the product is specifically identified as being sold directly by CeylonHandicrafts.lk.',
  },
  {
    q: 'Who is responsible for delivery?',
    a: 'Vendors are responsible for securely packaging and delivering their products, clearly communicating delivery charges and estimated timelines, and resolving delivery-related issues. Different arrangements may apply to products sold directly by CeylonHandicrafts.lk.',
  },
  {
    q: 'Who handles returns, refunds, or product complaints?',
    a: 'For marketplace vendor products, the relevant vendor is responsible for product quality, order fulfilment, returns, refunds, and customer complaints in accordance with the vendor’s published policy and applicable law. We may assist with communication where appropriate. Products sold directly by CeylonHandicrafts.lk are handled under our own Payment, Delivery, Returns and Cancellations Policy.',
  },
  {
    q: 'Can I update my products after they are published?',
    a: 'Yes. Vendors may request or make changes to product descriptions, photographs, prices, stock availability, and other listing details through the available vendor management process. Changes may be reviewed before publication.',
  },
  {
    q: 'Can a vendor account or product listing be suspended?',
    a: 'Yes. Listings or vendor accounts may be suspended or removed for misleading information, prohibited or counterfeit products, intellectual property violations, repeated customer complaints, poor order fulfilment, or breaches of the Vendor Agreement or platform policies.',
  },
  {
    q: 'Where can I get assistance?',
    a: 'For help with your application or vendor account, email hello@ceylonhandicrafts.lk or call/WhatsApp 071 942 4353.',
  },
];

// Plain <details>/<summary> — an accordion with zero client-side JS.
export function VendorFaq() {
  return (
    <section className="bg-beige py-16">
      <div className="container-page max-w-3xl">
        <h2 className="section-title">Frequently Asked Questions</h2>
        <p className="mx-auto mt-3 max-w-xl text-center text-sm text-navy-600">
          Everything you need to know before joining CeylonHandicrafts.lk as a vendor.
        </p>

        <div className="mt-8 space-y-3">
          {FAQS.map((item) => (
            <details key={item.q} className="group rounded-md border border-navy-100 bg-white p-4 open:shadow-sm">
              <summary className="flex cursor-pointer list-none items-center justify-between text-sm font-semibold text-navy-800">
                {item.q}
                <span aria-hidden="true" className="ml-4 shrink-0 text-gold-600 group-open:hidden">+</span>
                <span aria-hidden="true" className="ml-4 hidden shrink-0 text-gold-600 group-open:block">&minus;</span>
              </summary>
              <p className="mt-3 text-sm text-navy-600">{item.a}</p>
            </details>
          ))}
        </div>

        <div className="mt-10 text-center">
          <p className="text-sm font-semibold text-navy-800">Still have questions?</p>
          <p className="mt-1 text-sm text-navy-600">
            Our team is happy to guide you through the vendor application and onboarding process.
          </p>
          <Link href={ROUTES.vendorSignup} className="btn-primary mt-4 inline-flex">
            Apply to Become a Vendor
          </Link>
          <p className="mx-auto mt-6 max-w-xl text-xs text-navy-400">
            These FAQs provide general guidance. The{' '}
            <Link href={ROUTES.vendorTerms} className="font-semibold text-gold-600 hover:text-gold-700">
              Vendor Agreement and Listing Rules
            </Link>{' '}
            and applicable CeylonHandicrafts.lk policies govern all vendor accounts and listings.
          </p>
        </div>
      </div>
    </section>
  );
}
