<!-- Parent: ../AGENTS.md -->
<!-- Generated: 2026-07-02 | Updated: 2026-07-02 -->

# templates

## Purpose
All Twig templates: public site pages, customer account area, admin back office, transactional emails, and legal pages. French-language content. Pages extend one of two layouts.

## Key Files
| File | Description |
|------|-------------|
| `base.html.twig` | Public site layout — SEO/OpenGraph meta, header/nav with product mega-menu, notification block; loads `public/styles/kycss.css` and `public/scripts/*.js` |
| `base-admin.html.twig` | Admin back-office layout |

## Subdirectories
Each subdirectory holds the templates for one feature area (usually rendered by the matching controller). Most contain a single `index.html.twig`.

| Directory | Purpose |
|-----------|---------|
| `accueil/` | Home page (`AccueilController`) |
| `presentation/` | Company presentation page |
| `produits/` | Product listing (`index`) and product detail (`produit`) |
| `panier/` | Cart page + add-to-cart success/error partials |
| `payment/` | PayPal confirmation and error pages |
| `facture/` | Invoice web page (`index.html.twig`, Design 2.0) + `pdf.html.twig` rendered by dompdf. Both read the view model built by `App\Service\Facture\FactureBuilder` — never re-derive amounts in the template |
| `compte/` | Customer account: dashboard, order detail, personal info |
| `client-login/` | Customer login |
| `client_register/` | Registration + activation-success + confirmation pages |
| `edit_password/` | Password reset flow (request email, enter new password, success) |
| `contact/` | Contact form page |
| `legal/` | Legal pages: CGV, CGU, mentions légales |
| `erreur/` | Error pages: 403, 404, global-error |
| `emails/` | Transactional emails: activation, order confirmation, registration, login, reset password |
| `mailer/` | Mailer test/preview page |
| `admin/` | Admin dashboard + statistics page |
| `admin-login/` | Admin login |
| `gestion_produit/` | Admin product management UI |
| `gestion_commande/` | Admin order management UI |

## For AI Agents

### Working In This Directory
- Extend `base.html.twig` for public pages, `base-admin.html.twig` for admin pages.
- Public pages override named blocks for SEO (`title`, `metaDesc`, `canonical`, `ogTitle`, `structuredData`, …) and to highlight the active nav item (`headerHome`, `headerProduit`, etc.).
- Styling classes come from the **custom `kycss.css` utility framework** (e.g. `dp-f-r`, `ft-s-18`, `gp-2`, `j-c-s-b`) — not Bootstrap/Tailwind. Reuse existing classes; check `public/styles/kycss.css` for available utilities.
- Interactivity is wired via inline `on...` handlers calling functions in `public/scripts/*.js` (e.g. `headerDeroule`, `toggleSubmenu`, `startSwiperHeader`). No Stimulus controllers are used.
- A custom Twig function `file_exists(path)` (from `src/Twig/AppExtension.php`) is available to guard optional asset includes.

### Common Patterns
- One folder per controller/feature; entry template usually named `index.html.twig`.
- Email templates render standalone HTML (no site layout).

## Dependencies

### Internal
- Rendered by `src/Controller/`. Assets referenced live in `public/styles/` and `public/scripts/`.

### External
- Twig 3, `twig/extra-bundle`. PDF path uses dompdf via the controller.

<!-- MANUAL: -->
