"use client";

import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
import ProductCardThree from "@/components/sections/product/ProductCardThree";
import FooterBaseCard from "@/components/sections/footer/FooterBaseCard";
import Link from "next/link";

const CartPage = () => {
  const navItems = [
    { name: "Home", id: "home" },
    { name: "Categories", id: "categories" },
    { name: "Featured", id: "featured" },
    { name: "Deals", id: "deals" },
    { name: "About", id: "about" },
    { name: "Contact", id: "contact" },
  ];

  const footerColumns = [
    {
      title: "Shop",
      items: [
        { label: "All Products", href: "/categories" },
        { label: "Electronics", href: "/categories#electronics" },
        { label: "Fashion", href: "/categories#fashion" },
        { label: "Home & Garden", href: "/categories#home" },
        { label: "Food & Groceries", href: "/categories#food" },
      ],
    },
    {
      title: "Customer Service",
      items: [
        { label: "Contact Us", href: "/contact" },
        { label: "Track Order", href: "/account" },
        { label: "Returns & Exchanges", href: "#faq" },
        { label: "Shipping Info", href: "#faq" },
        { label: "FAQ", href: "#faq" },
      ],
    },
    {
      title: "Company",
      items: [
        { label: "About Us", href: "/about" },
        { label: "Blog", href: "/blog" },
        { label: "Careers", href: "/careers" },
        { label: "Partners", href: "/partners" },
        { label: "Press", href: "/press" },
      ],
    },
    {
      title: "Legal",
      items: [
        { label: "Privacy Policy", href: "#" },
        { label: "Terms of Service", href: "#" },
        { label: "Cookie Policy", href: "#" },
        { label: "Accessibility", href: "#" },
      ],
    },
  ];

  return (
    <ThemeProvider
      defaultButtonVariant="text-stagger"
      defaultTextAnimation="background-highlight"
      borderRadius="soft"
      contentWidth="mediumSmall"
      sizing="mediumLargeSizeMediumTitles"
      background="aurora"
      cardStyle="glass-depth"
      primaryButtonStyle="gradient"
      secondaryButtonStyle="solid"
      headingFontWeight="bold"
    >
      <div id="nav" data-section="nav">
        <NavbarStyleFullscreen
          navItems={navItems}
          brandName="Uzum Market"
          bottomLeftText="Global Marketplace Community"
          bottomRightText="support@uzummarket.com"
        />
      </div>

      <div id="cart-products" data-section="cart-products">
        <ProductCardThree
          title="Your Shopping Cart"
          description="Review and manage the items in your cart. Proceed to checkout when ready to complete your purchase."
          tag="Cart Review"
          tagIcon="ShoppingCart"
          tagAnimation="slide-up"
          products={[
            {
              id: "cart-001",
              name: "Premium Wireless Headphones",
              price: "89,999 UZS",
              imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3BFXLk9BIVZ4EdOfJDPnXCjvU6t/professional-product-photograph-of-premi-1774085816049-d2579199.png?_wi=3",
              imageAlt: "Wireless Headphones",
              initialQuantity: 1,
            },
            {
              id: "cart-002",
              name: "Smart Watch Pro",
              price: "299,999 UZS",
              imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3BFXLk9BIVZ4EdOfJDPnXCjvU6t/professional-product-photograph-of-a-sma-1774085815157-1df38171.png?_wi=3",
              imageAlt: "Smart Watch",
              initialQuantity: 1,
            },
            {
              id: "cart-003",
              name: "Elegant Winter Jacket",
              price: "199,999 UZS",
              imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3BFXLk9BIVZ4EdOfJDPnXCjvU6t/professional-product-photograph-of-an-el-1774085816136-5f1258a0.png?_wi=3",
              imageAlt: "Winter Jacket",
              initialQuantity: 2,
            },
          ]}
          gridVariant="three-columns-all-equal-width"
          animationType="slide-up"
          textboxLayout="default"
          useInvertedBackground={false}
          buttons={[
            {
              text: "Continue Shopping",
              href: "/categories",
            },
            {
              text: "Proceed to Checkout",
              href: "/checkout",
            },
          ]}
          buttonAnimation="slide-up"
        />
      </div>

      <div id="cart-summary" data-section="cart-summary">
        <section className="mx-auto px-4 md:px-6 py-16 md:py-24">
          <div className="max-w-2xl mx-auto">
            <h2 className="text-2xl md:text-3xl font-bold mb-8">Order Summary</h2>
            <div className="space-y-4 p-6 rounded-lg bg-card border border-accent">
              <div className="flex justify-between text-base">
                <span>Subtotal (4 items):</span>
                <span className="font-semibold">589,997 UZS</span>
              </div>
              <div className="flex justify-between text-base">
                <span>Shipping:</span>
                <span className="font-semibold text-green-600">Free</span>
              </div>
              <div className="flex justify-between text-base">
                <span>Estimated Tax:</span>
                <span className="font-semibold">47,200 UZS</span>
              </div>
              <div className="border-t border-accent pt-4 flex justify-between text-lg font-bold">
                <span>Total:</span>
                <span>637,197 UZS</span>
              </div>
              <Link
                href="/checkout"
                className="w-full mt-6 px-6 py-3 bg-primary-cta text-primary-cta-text rounded-lg font-semibold hover:opacity-90 transition-opacity text-center block"
              >
                Proceed to Checkout
              </Link>
              <Link
                href="/categories"
                className="w-full px-6 py-3 bg-secondary-cta text-secondary-cta-text rounded-lg font-semibold hover:opacity-90 transition-opacity text-center block border border-accent"
              >
                Continue Shopping
              </Link>
            </div>
          </div>
        </section>
      </div>

      <div id="footer" data-section="footer">
        <FooterBaseCard
          logoText="Uzum Market"
          columns={footerColumns}
          copyrightText="© 2025 Uzum Market. All rights reserved. | Made with ❤️ for Central Asia"
        />
      </div>
    </ThemeProvider>
  );
};

export default CartPage;