=== Anatometal Gem Selector ===
Requires at least: 6.0
Requires PHP: 7.4
WC requires at least: 7.0
Stable tag: 2.2.2

Per-variation gem selection for Anatometal jewellery, with the gem catalogue
built in.

== Why this exists ==

Gem availability is not a property of a product; it is a property of each
*variation*, and a piece can have more than one gem position.

  * The Hera Gem End offers 4 gem types at 1.5mm but 9 at 4mm.
  * A Captive Gem Bead End offers 4 types in gold and 3 in stainless.
  * A 2-Tiered Navel Curve takes three stones: two 4mm in position "Gem 1"
    and one 6mm in "Gem 2" -- and the allowed types differ between stainless
    and titanium.

Native WooCommerce variations cannot express this. Folding gems into the
variation matrix would need roughly 5,900 variations for the Hera alone, and
about 36,700 product-gem combinations across the catalogue.

== The catalogue ships with the plugin ==

Gems are not WooCommerce products. Modelling them as products meant importing
2,314 rows, carrying 244 hidden products in the admin, and sideloading 480
images into the media library -- all for stones that are never browsed or sold
on their own.

Instead the plugin carries its own catalogue:

  data/gems.json          244 gem groups, 2,132 colours   (265 KB)
  data/variant-gems.json  variation SKU -> gem positions
  assets/gems/*.webp      448 swatches                    (~0.9 MB)

Nothing to import, no media library entries, and the whole plugin is about
1.2 MB. Bindings are keyed by variation SKU, so they survive re-imports and
never depend on post IDs.

== Pricing ==

The catalogue holds the supplier's list prices in USD. WooCommerce → Gem
Selector sets a multiplier -- currency conversion and margin in one number --
plus an optional rounding rule. Prices can therefore be adjusted without
regenerating the plugin. The settings screen shows worked examples.

== Cart behaviour ==

A chosen gem rides on the jewellery line item rather than becoming its own
line: one cart row, one packing-slip row. The gem's price is added to the line
(multiplied by the position count), and the gem SKUs are stored as order
line-item meta so staff know which stones to pull. A machine-readable copy is
kept in `_am_gems` for reporting.

Selections are re-validated server-side on add-to-cart: a posted gem SKU is
resolved only within the groups that position allows, and priced from the
catalogue rather than the form, so prices cannot be manipulated.

== Installation ==

1. Import the jewellery CSV. Gem products are NOT required.
2. Upload this folder to wp-content/plugins/ and activate.
3. Set the price multiplier under WooCommerce → Gem Selector.

Regenerate the bundled data with:

    python3 anatometal.py plugin     # gems.json + swatches
    python3 anatometal.py build      # variant-gems.json
