# Homepage Dynamic Integration

## Website Data Flow

`HomeController@index` calls `WebsiteHomeService`, which loads every active `web`/`both` section assigned to the existing `All` category. Sections are ordered by their existing admin sort order and eager-load the same styles, variants, groups, products, tabs, pricing, and banners used by mobile.

The website composer is separate from the existing mobile API controllers and routes. Existing mobile endpoint names and response resources are unchanged.

## Automatic Style Mapping

| Existing section style/content | Website template |
| --- | --- | --- |
| Groups | Existing horizontal category/group slider classes. |
| Grid / Group Grid | Existing All Essentials slider/grid classes. |
| Individual / Card | Existing product card row and product-card component. |
| Tab | Bootstrap tab section containing existing product cards. |
| Poster with poster banner | Existing hero/poster banner classes. |
| Poster with promotional banners | Existing large-plus-two-small promotional banner layout. |

No section name is required by the website composer. A new active section under `All` with Display On set to Website or Both is automatically included and dispatched by its configured style/content relationships.

## Design Protection

- Existing section wrappers, Bootstrap columns, product-card classes, Swiper classes, AOS attributes, colors, and CSS hooks are retained.
- Product card values now come from product and pricing masters, including image, name, price, MRP, discount, variant, and unit label.
- Promotional images are applied as inline background images to the existing promo image classes.
- Empty website-only dynamic sections are not rendered.

## Mobile Isolation

- Website seed sections use `platform_type = web`.
- Website promotional banners use `platform = web`.
- Mobile catalog queries accept only `mobile` and `both` records.
- A runtime check confirmed the seeded website sections are absent from the mobile section payload.

## Runtime Validation

- Homepage response: HTTP 200.
- Explore Our Products, All Essentials, Deals, Frequently Ordered, and promotional banner content each rendered once.
- Four website-only section IDs checked against the mobile home payload: zero overlap.
- Blade view cache compiled successfully.
- Test suite passed with 6 tests and 10 assertions.
