## Captex Theme Plan

This document tracks the current multi-theme structure and the implementation path for keeping theme1, theme2, and theme3 isolated while sharing commerce/auth behavior.

### Current Structure

```text
resources/
  js/
    bootstrap/
      create-theme-app.jsx
    theme1/
      app.js
      components/
      hooks/
      layouts/
      pages/
      services/
      data/
    theme2/
      app.js
      components/
      hooks/
      layouts/
      pages/
      services/
      data/
    theme3/
      app.js
      components/
      hooks/
      layouts/
      pages/
```

```text
resources/views/fronted/
  theme1.blade.php
  theme2.blade.php
  theme3.blade.php
```

```text
app/helper/general.php
  frontend_theme_bootstrap()
  frontend_theme_bootstrap_clear()
  theme3initload()
  cache_reset_fun()
```

### What Is Shared

The following behaviors are shared across themes:

1. Commerce cart state
2. Wishlist state
3. Auth screens and layouts
4. Theme appearance persistence
5. Initial frontend brand/meta bootstrap data

### What Is Separate

Each theme keeps its own frontend entry and page tree:

1. `resources/js/theme1/app.js`
2. `resources/js/theme2/app.js`
3. `resources/js/theme3/app.js`

Each theme also keeps its own Blade shell:

1. `resources/views/fronted/theme1.blade.php`
2. `resources/views/fronted/theme2.blade.php`
3. `resources/views/fronted/theme3.blade.php`

### Theme3 Product Card

Theme3 uses a shared product card component for product tiles, wishlist tiles, and new-arrival grids.

1. Keep the visual styling inside `resources/js/theme3/components/product/ProductCard.jsx`.
2. Keep the product data contract unchanged so existing pages can still pass `product`, `layout`, `badgeLabel`, `statusLabel`, `subtitle`, and action labels.
3. Keep cart and wishlist behavior outside the card so the component stays presentation-only.
4. Reuse the same card across `Shop`, `NewIn`, `Wishlist`, and `Home` product sections.
5. Prefer style-only changes for future card updates unless a page explicitly needs new product metadata.
6. `Shop` must render through `resources/js/theme3/components/product/ProductGrid.jsx`, which renders `ProductCard`.
7. `Home` must render through `resources/js/theme3/pages/Home/components/FeaturedProductsSection.jsx`, which also renders `ProductCard`.
8. Keep the card visually standard, compact, and borderless, matching the reference-style product tile with image, title, and price as the main content.
9. Theme3 home featured products should show 5 cards on `xl` screens, 2 cards on `sm` screens, and 1 card on extra-small screens.

### Theme3 Home Hero

Theme3 home hero should stay lightweight and should not compete with the product grid on smaller screens.

1. Keep the hero section compact with reduced spacing and smaller typography.
2. Remove extra decorative clutter so the content reads faster.
3. Hide the hero on small devices and only render it from `lg` and up.
4. Keep the hero layout stable so it does not affect the shared product card or shop/home card logic.

### Bootstrap Flow

1. Blade loads the active theme shell.
2. The shell reads `frontend_theme_bootstrap()` once.
3. The helper caches meta data per theme.
4. The theme entry file loads only its own pages through `import.meta.glob()`.
5. Shared providers wrap the Inertia app.

### Cache Strategy

1. Setting updates clear the specific setting cache key.
2. Theme bootstrap cache is cleared for the active theme.
3. Theme3-specific setting memo keys are also cleared.
4. A manual cache clear should invalidate all theme bootstrap buckets.

### Next Checks

1. Confirm each theme shell points to its own Vite entry.
2. Confirm `frontend_theme_bootstrap()` returns the expected title, logo, favicon, and contact data.
3. Confirm admin setting changes refresh the active theme cache.
4. Confirm theme1, theme2, and theme3 still resolve their Inertia pages after the bundle split.
5. Confirm theme3 product tiles still render correctly in `Shop`, `NewIn`, `Wishlist`, and `Home`.
6. Confirm `Shop` and `Home` continue to use the same `ProductCard` implementation, not separate card components.
7. Confirm the simplified card still keeps wishlist/cart/product navigation behavior unchanged.
8. Confirm the product tile stays visually close to the reference screenshot and does not reintroduce decorative badges, borders, or action clutter.
9. Confirm the home featured products section shows 5 cards on `xl` and remains responsive on smaller screens.
