---
name: thheritagecabinetry-storefront-engine
description: Dynamic customizer and wholesale local storage checkout client for premium B2B cabinetry and contractor distributor platforms.
---

## What I can accomplish
- **Product Customization & Variant Compilation**: Evaluates price modifiers based on cabinet box sizing, door styles (Classic Shaker, Modern Flat Slab), paint coatings, and core timber species (Maple, Walnut, Cherry).
- **Real-Time B2B Quantity Discount breaks**: Applies volume pricing breaks dynamically (10-24 units: 10% off; 25-49: 20% off; 50+: 30% B2B distributor pricing discount) on both unit and batch subtotals.
- **Copy B2B BOM for AI**: Formulates a complete, professional **Cabinetry Bill of Materials (BOM) Sourcing Specification Sheet** in structured Markdown, ready to copy to clipboard for AI sourcing assistants, listing compliance specs (FSC, TSCA Title VI) and applied wholesale discount percentages.
- **B2B Procurement Cart Syncing**: Stores and updates custom bulk orders inside a secure `localStorage` pipeline, syncing commercial flatbed shipping selectors ($350 standard wholesale, $750 dedicated flatbed builder shipping, $1200 flatbed with contractor unloading).

## Required inputs
- **Catalog Dataset**: `data/products.json` containing base cabinet prices, door styles, wood species, sizing price modifiers, and variant options.
- **Configurator URL Parameter**: `product.html?id=[product-id]` (e.g. `artisan-chesterfield-sofa` for Shaker Kitchen, `nordic-dining-table` for Modern Frameless).
- **Storefront CSS Stack**: Custom HSL color tokens and components stylesheets (`tokens.css`, `base.css`, `components.css`).

## Constraints
- **DOM Injection Security**: No raw `innerHTML` or `insertAdjacentHTML` injections allowed; all dynamic rendering must pass via secure browser `textContent` and `createElement` DOM sinks.
- **No Third-party Framework Dependencies**: Pure Vanilla ES6 JavaScript only.
- **WCAG AA Compliance**: Keep text contrast above 4.5:1 using predefined HSL tokens in `tokens.css`.

## Key documentation
- [TH Heritage Cabinetry B2B DESIGN.md](/DESIGN.md): Design tokens, custom properties, and UI specs.
- [AI Agent Developer Guidelines](/AGENTS.md): Coding guidelines and directories map.
- [llms.txt Sitemap Index](/llms.txt): Token-budgeted index of public pages and RAG specs.
