<div
  id="shop-container"
  phx-hook="CartPersist"
  class="shop-container min-h-screen pb-20 md:pb-0"
  style="background-color: var(--t-surface-base); font-family: var(--t-font-body); color: var(--t-text-primary);"
>
  <.skip_link />

  <%= if @theme_settings.announcement_bar do %>
    <.announcement_bar theme_settings={@theme_settings} />
  <% end %>

  <.shop_header
    theme_settings={@theme_settings}
    logo_image={@logo_image}
    header_image={@header_image}
    active_page="cart"
    mode={@mode}
    cart_count={@cart_count}
  />

  <main id="main-content" class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
    <.page_title text="Your basket" />

    <%= if @cart_items == [] do %>
      <.cart_empty_state mode={@mode} />
    <% else %>
      <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
        <div class="lg:col-span-2">
          <ul
            role="list"
            aria-label="Cart items"
            class="flex flex-col gap-4"
            style="list-style: none; margin: 0; padding: 0;"
          >
            <%= for item <- @cart_items do %>
              <li>
                <.shop_card class="p-4">
                  <.cart_item_row item={item} size={:default} show_quantity_controls mode={@mode} />
                </.shop_card>
              </li>
            <% end %>
          </ul>
        </div>

        <div>
          <.order_summary subtotal={@cart_page_subtotal} mode={@mode} />
        </div>
      </div>
    <% end %>
  </main>

  <.shop_footer theme_settings={@theme_settings} mode={@mode} />

  <.cart_drawer
    cart_items={@cart_items}
    subtotal={@cart_subtotal}
    cart_count={@cart_count}
    mode={@mode}
    open={assigns[:cart_drawer_open] || false}
    cart_status={assigns[:cart_status]}
  />
  <.search_modal hint_text={~s(Try a search – e.g. "mountain" or "notebook")} />

  <.mobile_bottom_nav active_page="cart" mode={@mode} />
</div>
