import Link from 'next/link';
import LegalPage from '@/components/LegalPage';

export const metadata = { title: 'Cookie Policy — Craft2Prints' };

export default function CookiesPage() {
  return (
    <LegalPage tag="Legal" title="Cookie Policy" lastUpdated="13 July 2026">
      <h2>The short version</h2>
      <p>
        We use two cookies, both strictly necessary to make logging in work. We use no advertising,
        analytics, or tracking cookies of any kind — which is why you don&apos;t see a cookie
        consent banner on this site: UK law only requires consent for cookies that aren&apos;t
        essential, and ours all are.
      </p>

      <h2>The cookies we set</h2>
      <div className="overflow-x-auto">
        <table className="w-full border-collapse text-left text-sm">
          <thead>
            <tr className="border-b border-line">
              <th className="py-2 pr-4 font-medium">Cookie</th>
              <th className="py-2 pr-4 font-medium">Purpose</th>
              <th className="py-2 font-medium">Lasts</th>
            </tr>
          </thead>
          <tbody className="text-muted">
            <tr className="border-b border-line">
              <td className="py-2 pr-4 font-mono text-xs">customer_session</td>
              <td className="py-2 pr-4">Keeps you signed in to your customer account</td>
              <td className="py-2">30 days</td>
            </tr>
            <tr className="border-b border-line">
              <td className="py-2 pr-4 font-mono text-xs">admin_session</td>
              <td className="py-2 pr-4">Keeps shop staff signed in to the admin area (only set if you log in as staff)</td>
              <td className="py-2">Until logout</td>
            </tr>
          </tbody>
        </table>
      </div>
      <p>
        Both are &quot;HTTP-only&quot; (scripts on the page can&apos;t read them) and contain only a
        signed session token — no personal details.
      </p>

      <h2>Other storage on your device</h2>
      <p>
        Like most modern shops, we also keep a few things in your browser&apos;s own storage rather
        than in cookies. None of this is sent to us until you act (e.g. check out):
      </p>
      <ul>
        <li>
          <strong>Your bag</strong> — the items and designs in your bag are stored on your device
          so they survive a page refresh.
        </li>
        <li>
          <strong>Preferences</strong> — your light/dark mode choice and display currency.
        </li>
      </ul>

      <h2>Third-party cookies</h2>
      <ul>
        <li>
          <strong>Stripe</strong> — when you proceed to payment you&apos;re taken to Stripe&apos;s
          secure checkout page, which sets its own cookies for fraud prevention. See{' '}
          <a href="https://stripe.com/gb/legal/cookies-policy" target="_blank" rel="noopener noreferrer">
            Stripe&apos;s cookie policy
          </a>
          .
        </li>
        <li>
          <strong>Cloudflare Turnstile</strong> — the bot-protection check on our forms may use
          similar technologies to tell humans from bots. It doesn&apos;t track you across other
          sites.
        </li>
      </ul>

      <h2>Managing cookies</h2>
      <p>
        You can delete or block cookies in your browser settings at any time — the only effect on
        this site is that you&apos;ll be signed out and will need to log in again. If we ever add
        non-essential cookies (such as analytics), we&apos;ll update this page and ask for your
        consent first.
      </p>

      <p>
        Questions? See our <Link href="/privacy">Privacy Policy</Link> or{' '}
        <Link href="/contact">get in touch</Link>.
      </p>
    </LegalPage>
  );
}
