"use client";

import { Toaster } from "react-hot-toast";
import { CartProvider } from "@/features/cart/components/cart-context";

export function Providers({ children }: { children: React.ReactNode }) {
  return (
    <CartProvider>
      {children}
      <Toaster
        position="top-right"
        toastOptions={{
          duration: 4000,
          style: {
            background: "#0f1f3a",
            color: "#e8eef6",
            border: "1px solid rgba(26, 45, 74, 0.5)",
            borderRadius: "0.75rem",
            fontSize: "14px",
          },
          success: {
            iconTheme: {
              primary: "#10b981",
              secondary: "#e8eef6",
            },
          },
          error: {
            iconTheme: {
              primary: "#ef4444",
              secondary: "#e8eef6",
            },
          },
        }}
      />
    </CartProvider>
  );
}
