import type { Metadata } from "next";
import "./globals.css";
import { CarrinhoProvider } from "@/contexts/CarrinhoContext";
import { EmpresaProvider } from "@/contexts/EmpresaContext";
import { AuthProvider } from "@/contexts/AuthContext";

export const metadata: Metadata = {
  title: "SaveInMed - Marketplace B2B para farmácias",
  description: "Sistema inteligente para gestão médica e hospitalar",
  manifest: "/manifest.json",
  icons: {
    icon: [ 
      { url: "/favicon.ico", sizes: "any" },
      { url: "/favicon.png", sizes: "32x32", type: "image/png" },
      { url: "/favicon.png", sizes: "16x16", type: "image/png" },
    ],
    shortcut: "/favicon.ico",
    apple: [{ url: "/favicon.png", sizes: "180x180", type: "image/png" }],
  },
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="pt-BR">
      <head>
        <link rel="icon" href="/favicon.ico" sizes="any" />
        <link rel="icon" href="/favicon.png" type="image/png" />
        <link rel="apple-touch-icon" href="/favicon.png" />
        <link rel="manifest" href="/manifest.json" />
        <meta name="theme-color" content="#3b82f6" />
      </head>
      <body className="antialiased">
        <AuthProvider>
          <EmpresaProvider>
            <CarrinhoProvider>{children}</CarrinhoProvider>
          </EmpresaProvider>
        </AuthProvider>
      </body>
    </html>
  );
}
