<!DOCTYPE html>
<html lang="<%= current_locale %>">
  <head>
    <%= favicon_link_tag 'solidus_admin/favicon.ico' %>

    <title><%= solidus_admin_title %></title>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>

    <%= stylesheet_link_tag SolidusAdmin::Config.theme_path(session[:admin_light_theme]), media: '(prefers-color-scheme: light)', "data-turbo-track": "reload" %>
    <%= stylesheet_link_tag SolidusAdmin::Config.theme_path(session[:admin_dark_theme]), media: '(prefers-color-scheme: dark)', "data-turbo-track": "reload" %>
    <%= javascript_importmap_tags "solidus_admin/application", shim: false, importmap: SolidusAdmin.importmap %>
    <meta name="turbo-refresh-scroll", content="preserve">
  </head>

  <body class="bg-gray-15 font-sans">
    <%= render component("layout/skip_link").new(href: "#main") %>
    <div class="flex gap-0">
      <div class="min-w-[240px] border-r border-r-gray-100 relative">
        <div class="min-h-screen top-0 sticky flex">
          <%= render component("layout/navigation").new(store: current_store) %>
        </div>
      </div>

      <main id="main" class="flex-grow">
        <%= yield %>
      </main>
    </div>

    <div class="fixed inset-x-0 bottom-3 flex items-center justify-center flex-col gap-3 pointer-events-none" role="alert">
      <% flash.each do |key, message| %>
        <%= render component("ui/toast").new(text: message, scheme: key.to_sym == :error ? :error : :default) %>
      <% end %>
    </div>
  </body>
</html>
