# Dynamic Website Conversion Plan

## Implemented Foundation

1. Added `platform_type` to categories, products, and sections.
2. Expanded banners to support `both`.
3. Added reusable `visibleOn()` model scopes.
4. Updated mobile catalog queries so `mobile` and `both` records are returned.
5. Added section schedule enforcement.
6. Added website catalog APIs under `/api/web/catalog` using the same service and tables as mobile.
7. Added admin persistence and selectors for platform visibility.

## Blade Conversion Sequence

1. Extract the existing product card markup into a Blade component without changing classes, attributes, or DOM nesting.
2. Extract banner, category tile, section heading, slider, video card, testimonial, and plan components from existing markup.
3. Bind homepage sections to `/api/web/catalog/sections` or server-side `HomeApiService` output.
4. Map section styles to the extracted existing templates; unknown styles should be hidden instead of rendered with a different design.
5. Replace category routes with stable slug/ID routes and bind category banner, description, sections, and offers.
6. Replace product detail route with a stable slug/ID route and bind pricing, stock, variants, images, recommendations, cart, and wishlist state.
7. Bind galleries/videos, testimonials, plans, blogs, and legal content to their existing admin tables.
8. Add cache tags/keys for catalog payloads and clear them from admin model events.

## Design Protection Rules

- Preserve every existing frontend CSS class and JavaScript hook.
- Replace only literal content and repeated blocks with loops/components.
- Keep current image aspect ratios, lazy-loading behavior, Swiper configuration, AOS attributes, and responsive breakpoints.
- Capture desktop/tablet/mobile screenshots before each page conversion and compare after data binding.

## Performance Plan

- Keep eager-loading and selected columns in `HomeApiService`.
- Paginate standalone product listing endpoints before binding category pages.
- Cache anonymous category and section payloads by platform, category, filter, and sort.
- Do not cache user cart/wishlist/personalization fragments in shared cache entries.
- Continue WebP conversion and lazy loading; add responsive `srcset` during the image pipeline phase.

## Acceptance Criteria

- One admin edit updates every selected platform without duplicate content entry.
- `mobile` records never appear on web; `web` records never appear in mobile; `both` appear in both.
- Disabled or out-of-schedule sections/banners do not render.
- Static fallback text/products are removed only after each dynamic section has data and empty-state behavior.
- Visual regression screenshots match the approved static pages at supported breakpoints.
