import React from "react";
import type { Metadata } from "next";
import LegalDocument, { ContactLink, type LegalSection } from "@/components/sections/LegalDocument";

export const metadata: Metadata = {
  title: "Cookie Policy – Doormile",
  description:
    "How Doormile uses cookies and similar technologies when you visit our website, and how you can manage them.",
};

const sections: LegalSection[] = [
  {
    heading: "What Are Cookies?",
    blocks: [
      {
        type: "p",
        text: "Cookies are small text files stored on your device that help websites remember information about your visit and improve the browsing experience.",
      },
    ],
  },
  {
    heading: "Why We Use Cookies",
    blocks: [
      { type: "p", text: "We use cookies to:" },
      {
        type: "ul",
        items: [
          "Enable essential website functionality",
          "Improve website performance",
          "Analyze visitor behavior and traffic patterns",
          "Remember user preferences",
          "Enhance overall user experience",
          "Support website security",
        ],
      },
    ],
  },
  {
    heading: "Types of Cookies We Use",
    blocks: [
      { type: "h3", text: "Essential Cookies" },
      {
        type: "p",
        text: "These cookies are required for core website functionality and security features. The website may not function correctly without them.",
      },
      { type: "h3", text: "Performance Cookies" },
      {
        type: "p",
        text: "These cookies collect information about how visitors interact with the website and help us improve performance and usability.",
      },
      { type: "h3", text: "Analytics Cookies" },
      {
        type: "p",
        text: "Analytics cookies help us understand website traffic, visitor engagement, popular content, and user journeys.",
      },
      { type: "h3", text: "Functional Cookies" },
      {
        type: "p",
        text: "These cookies remember user preferences such as language, region, and other customization settings.",
      },
      { type: "h3", text: "Third-Party Cookies" },
      {
        type: "p",
        text: "Some third-party services integrated into our website, including analytics and performance monitoring tools, may place cookies on your device.",
      },
    ],
  },
  {
    heading: "Managing Cookies",
    blocks: [
      {
        type: "p",
        text: "Most web browsers allow users to control, block, or delete cookies through browser settings. Please note that disabling cookies may impact certain website features and functionality.",
      },
    ],
  },
  {
    heading: "Cookie Consent",
    blocks: [
      {
        type: "p",
        text: "Where required by applicable law, visitors may be presented with cookie consent options when accessing the website.",
      },
    ],
  },
  {
    heading: "Policy Updates",
    blocks: [
      {
        type: "p",
        text: "We may revise this Cookie Policy periodically to reflect changes in technology, regulations, or business practices. Updated versions will be published on this page.",
      },
    ],
  },
  {
    heading: "Contact Us",
    blocks: [
      {
        type: "p",
        text: <>If you have questions regarding this Cookie Policy or our use of cookies, please contact us through our <ContactLink />.</>,
      },
    ],
  },
];

export default function CookiePolicyPage() {
  return (
    <div className="content-wrapper content-wrapper-may-contain-elementor-code content-wrapper-sidebar-position-none">
      <div className="content">
        <div className="content-inner">
          <LegalDocument
            title="Cookie Policy"
            lastUpdated="June 2026"
            intro="This Cookie Policy explains how Doormile uses cookies and similar technologies when you visit our website."
            sections={sections}
          />
        </div>
      </div>
    </div>
  );
}
