/*
Theme Name:   Legacy Diamonds
Theme URI:    https://legacydiamondsandgemstones.com
Description:  Custom child theme for Legacy Diamonds & Gemstones. Parent: Woodmart.
Author:       Legacy Diamonds & Gemstones
Author URI:   https://legacydiamondsandgemstones.com
Template:     woodmart
Version:      1.10.87
License:      GNU General Public License v2 or later
Text Domain:  legacy-diamonds
*/

/*
 * v1.7.0 (2026-05-31) — AI-native intelligence (pairs with plugin v2.8.7)
 * ----------------------------------------------------------------------
 * pv-form.js gains two capabilities:
 *
 *   1. VISITOR ATTRIBUTION CAPTURE — at page load, reads UTM/ref/gclid/
 *      fbclid from window.location.search, plus document.referrer,
 *      screen resolution (window.screen), and timezone offset. Bundled
 *      into a `meta` object on every form-submission POST so the plugin
 *      stores full provenance per lead.
 *
 *   2. SALESIQ VISITOR IDENTIFICATION — on successful OTP submit (new
 *      lead) AND on Sign In (returning customer), pushes name + email +
 *      phone + PVR token + advisor + source label to Zoho SalesIQ via
 *      $zoho.salesiq.visitor.{name,email,contactnumber,info}. Operator
 *      dashboard now sees identified buyers instead of anonymous visits.
 *      Silent no-op if SalesIQ isn't loaded on the page.
 *
 * Plugin v2.8.7 pairs this with:
 *   - Claude API intent scoring (0-100 + reasoning) for every lead
 *   - Gold-badge intent display in PV Requests admin queue
 *   - Unified email shell (internal notification now on LDS_Email_Engine)
 *
 * No layout/CSS changes — purely behavioural additions in the JS.
 */

/*
 * v1.6.0-rc10 (2026-05-30) — BRAND HOTFIX + MOBILE POLISH (Round-2 audit)
 * --------------------------------------------------------------------------
 * Round-2 audit (cross-cutting) found Catherine STILL hardcoded in three
 * customer-facing surfaces of the theme — every page of the site has been
 * shipping the violation. Fixed here.
 *
 *   1. footer-legacy.php:87 — "New arrivals, sent privately by Catherine."
 *      → "New arrivals, shared privately." (no name, brand-anonymous)
 *
 *   2. js/legacy.js:135 — WhatsApp pre-fill from the footer newsletter
 *      → was "Hello Catherine, please add me to the Legacy private list..."
 *      → now "Hello, please add me to the Legacy private list..."
 *
 *   3. page-private-viewing.php:48 — step 2 process copy
 *      → was "...from our atelier and trusted partners..."
 *      → now "...from Legacy's atelier and global archive..." (no
 *      supplier language — Legacy is fully vertically integrated per
 *      feedback_no_suppliers.md memory)
 *
 * Mobile polish:
 *
 *   4. .pv-input / .pv-textarea / .pv-signin-email-input bumped from
 *      15px → 16px font-size. iOS Safari auto-zooms any focused input
 *      below 16px, jarring buyers out of the hero context. 70% of
 *      traffic is mobile — this fix matters.
 *
 *   5. body.admin-bar .pv-signin-link { top: 56px } — the sign-in
 *      hero button no longer collides with the WP admin bar when an
 *      advisor previews /private-viewing/ while logged in.
 *
 * All five changes are surgical — no new components, no new CSS classes,
 * no template restructuring. Audit-driven hotfix release.
 */

/*
 * v1.6.0-rc9 (2026-05-30) — AUDIT FIXES (pairs with plugin v2.8.2)
 * ----------------------------------------------------------------------------
 * Quality + correctness pass after a code review found bugs:
 *
 *   - HIGH: submitFinal .catch in pv-form.js no longer re-enables the
 *     submit button on a network blip. If the fetch returned a success
 *     server-side but the response leg dropped, re-enabling submit would
 *     let the buyer double-fire and get a confusing "Please verify
 *     your email" because the OTP transient was already consumed (or
 *     create a duplicate lead row). Instead the button morphs into a
 *     "Reach us on WhatsApp" CTA pre-filled with the buyer's email,
 *     so their specialist can confirm by phone within seconds.
 *
 *   - LOW: belt-and-braces noindex on /private-viewing/ via filters
 *     for both `rank_math/frontend/robots` and `wp_robots`. Covers the
 *     synthetic-stub branch (no real WP page row) where Rank Math has
 *     no stored rank_math_robots meta to read.
 *
 * No CSS, no template, no modal structure changes. Purely the JS catch
 * branch + two functions.php filters.
 */

/*
 * v1.6.0-rc8 (2026-05-30) — SIGN IN FLOW for returning customers
 *                            (pairs with plugin v2.8.1)
 * ---------------------------------------------------------------------
 * Adds "Sign in to your viewing room" link in the hero (top-right) for
 * returning customers whose 30-day trusted-device cookie has expired or
 * who are on a new device.
 *
 * Flow:
 *   1. Click "Sign in to your viewing room" → small modal opens asking
 *      for email
 *   2. Enter email → click "Send verification code" → OTP request fires
 *   3. Sign-in modal closes, OTP modal opens in "login mode" with title
 *      "Welcome back."
 *   4. Enter 6-digit code → auto-verify → POST /private-viewing/login
 *      → plugin finds the customer's existing active PVR invitation →
 *      issues fresh 30-day cookie → returns pvr_url
 *   5. Page redirects to /pvr/[TOKEN]/ — they're back in their room
 *
 * If no room exists for the email (graceful fallback):
 *   - Modal shows "We could not find a viewing room for [email]"
 *   - "Request a private viewing" button appears
 *   - Click → modal closes, scrolls to the form, pre-fills email
 *
 * Plugin v2.8.1 also REMOVED the punitive 5/hour IP rate limit on OTP
 * requests + lead submission — UHNW buyers behind corporate NAT were
 * being blocked. Per-email cap (3 codes / 15 min) is the only remaining
 * gate, and it's friendly ("code already sent to your@email").
 *
 * No changes to the new-request form, success card, OTP modal core
 * structure, or PVR redirect. Sign In modal reuses the OTP modal's CSS
 * + DOM for code entry (one modal, two modes).
 */

/*
 * v1.6.0-rc7 (2026-05-30) — SELF-SERVE PVR REDIRECT (pairs with plugin v2.7.9)
 * ----------------------------------------------------------------------------
 * After successful OTP + form submit, the customer is now AUTO-REDIRECTED
 * into their newly-created PVR room at /pvr/[TOKEN]/ instead of seeing the
 * standalone success card. The plugin v2.7.9 also issues a 30-day trusted-
 * device cookie so the customer is "logged in" — they can return to the
 * PVR from email or directly without re-OTP.
 *
 * Modal briefly shows "Verified · entering your private viewing room…"
 * before the redirect (~600ms), so the transition feels intentional.
 *
 * Graceful fallback: if plugin returns no pvr_url (e.g. older plugin),
 * the standalone success card still renders as before.
 *
 * No CSS, modal, or template changes — only the JS submitFinal() success
 * branch. The PVR room itself is rendered by the existing
 * LPVR_V2_Runtime infrastructure (same /pvr/[TOKEN]/ surface used by
 * advisor-initiated invitations).
 */

/*
 * v1.6.0-rc6 (2026-05-30) — WORLD-CLASS FIX: external enqueued JS
 * ----------------------------------------------------------------
 * Bug: Even with rc5's `data-noptimize` attribute AND testing with
 * ?ao_noptimize=1 (Autoptimize's official bypass parameter), the
 * inline form JS still wasn't executing on production. Form fell
 * through to native POST → server-side OTP-required error.
 *
 * Root cause: unknown — possibly Rocket.net's Cloudflare Enterprise
 * edge optimizer, possibly a hosting-side worker script. Doesn't
 * matter — the cure is the same: stop using inline <script>.
 *
 * Fix: Move ALL form JS to assets/js/pv-form.js (external file).
 * Enqueue via wp_enqueue_script in functions.php, only on
 * /private-viewing/. Pass REST URLs + nonce via wp_add_inline_script
 * 'before' which prints `window.PVConfig = {...}` immediately before
 * the main script tag.
 *
 * External <script src> tags are immune to inline-script aggregation
 * mangling — aggregators concatenate intact file contents, never
 * break the IIFE syntax of an external file. WP-canonical pattern.
 *
 *   Theme version appended as ?ver= cache buster — each bump
 *   invalidates the cached JS automatically.
 *
 * The OTP modal HTML, CSS, server-side OTP gate, and 404 title fix
 * are unchanged from rc4/rc5 — only the script delivery mechanism
 * has changed.
 */

/*
 * v1.6.0-rc5 (2026-05-30) — ONE-CHARACTER HOTFIX: data-noptimize
 * ---------------------------------------------------------------
 * Bug: OTP modal never opened. Buyer filled form → clicked Request →
 * native POST (not AJAX) → server-side handler returned the no-JS
 * "Email verification is required" error. My JS submit handler was
 * never binding.
 *
 * Root cause: the Autoptimize bypass attribute is `data-noptimize`
 * (one word, "n"+"optimize"), NOT `data-no-optimize` with a hyphen.
 * rc4 used the wrong attribute → Autoptimize aggregated the inline
 * script into autoptimize_*.js → IIFE structure broke → addEventListener
 * never ran → form fell through to native POST.
 *
 * Fix: rename both `data-no-optimize="1"` attributes (on the JSON data
 * island AND the executable script) to `data-noptimize="1"`. Now
 * Autoptimize leaves them inline, in source order, and the OTP flow
 * runs end-to-end.
 *
 * Same `data-cfasync="false"` (Cloudflare Rocket Loader bypass) was
 * always correct — no change there.
 *
 * No template, no CSS, no functions.php changes — just two attribute
 * renames.
 */

/*
 * v1.6.0-rc4 (2026-05-30) — OTP HARD GATE + 404 TITLE FLASH FIX
 *                            (PAIRS WITH plugin v2.7.8)
 * -----------------------------------------------------------------
 * Two changes:
 *
 * (A) OTP HARD GATE on the /private-viewing/ form
 *
 *     World-class modal-after-submit pattern (Cartier/Tiffany-grade):
 *     buyer fills entire form → clicks Request → modal opens:
 *     "We've sent a 6-digit code to your@email" → enters code →
 *     auto-verifies on 6 digits → lead created + emails sent +
 *     success card swaps in. No verification, no lead — clean
 *     pipeline, advisors only see verified prospects.
 *
 *     UX details:
 *       - 6-digit input with letter-spacing, auto-focus on open
 *       - Auto-verify on 6 digits entered (no extra click)
 *       - Paste support (digits-only filter)
 *       - 60-second resend cooldown with live counter
 *       - Backdrop click + Escape close
 *       - Plain-language error messages (invalid / expired / too many)
 *       - WhatsApp fallback in modal fine print
 *       - Mobile-friendly: 480px panel, big touch targets
 *
 *     Backend:
 *       - Plugin v2.7.8 adds 'private_viewing' OTP context to
 *         LPVR_V2_Otp (CONTEXTS + subject + intro)
 *       - 2 REST endpoints: /private-viewing/otp/request + /verify
 *       - process_submission() refuses without verified-in-last-60-min
 *         transient (lds_pv_verified_{sha1(email)})
 *       - Verification consumed on use (single lead per OTP)
 *
 * (B) 404 TITLE FLASH FIX
 *
 *     Even though the rc2 template_redirect interceptor renders
 *     /private-viewing/ correctly, the tab title was stuck on
 *     "Page not found" — Rank Math/WoodMart emit document titles
 *     before the interceptor runs.
 *
 *     functions.php fixes:
 *       - parse_query (priority 1): clear is_404/set is_page on the
 *         landing URI, so anything downstream sees the right state
 *       - pre_get_document_title + wp_title + rank_math/frontend/title
 *         + wpseo_title filters force the title to "Private Viewing —
 *         Legacy Diamonds & Gemstones" when on /private-viewing/
 *
 *     The visible 1ms 404 flash itself is residual Cloudflare/Rocket
 *     edge cache from earlier failed submissions. After a full edge
 *     purge it should be gone permanently.
 */

/*
 * v1.6.0-rc3 (2026-05-30) — HOTFIX over v1.6.0-rc2 (PAIRS WITH plugin v2.7.7)
 * ------------------------------------------------------------------------------
 * Bug: Form submitted but nothing happened — no error visible, no email
 * sent. The AJAX submit handler wasn't binding (despite rc1 defenses
 * against Autoptimize + Rocket Loader), so the form fell back to its
 * native POST to /private-viewing/, where the rc2 template_redirect
 * interceptor caught the URL and re-rendered the page — silently
 * discarding the form data.
 *
 * Fix: Server-side POST handler in the interceptor. When a POST hits
 * /private-viewing/ with form fields, call the plugin's newly-public
 * LDS_Private_Viewing::process_submission() (plugin v2.7.7+), then
 * expose the result via $GLOBALS['legacy_pv_result']. The template
 * checks the global and renders the success state INSTEAD of the form
 * (or renders inline errors above the form).
 *
 * The form now works fully with ALL JavaScript disabled:
 *   - JS available: AJAX → /wp-json/legacy-pvr/v1/private-viewing-request,
 *     success card swap-in via fetch().
 *   - JS unavailable / broken / blocked: native POST → /private-viewing/,
 *     interceptor calls plugin, template renders success card on the
 *     reloaded page.
 *
 * Same plugin handler runs in both cases — same validation, same
 * advisor selection, same lead row, same Zoho forward, same emails.
 * JS becomes a UX nicety (no page reload), not a load-bearing dependency.
 *
 * REQUIRES plugin v2.7.7+ (which exposes LDS_Private_Viewing::process_submission()
 * as a public static method). On older plugin versions, the JS path
 * still works; only the no-JS fallback degrades to silent.
 */

/*
 * v1.6.0-rc2 (2026-05-30) — HOTFIX over v1.6.0-rc1
 * ---------------------------------------------------------------
 * Bug: /private-viewing/ returned 404 even when typed directly.
 * The auto-created WP page either never created (admin_init never
 * fired) OR got lost, OR Cloudflare/Rocket.net edge cached a 404
 * response from an earlier failed form submission and served it on
 * subsequent direct visits.
 *
 * Fix: template_redirect interceptor (priority 0) owns the URL
 * /private-viewing/ DIRECTLY via $_SERVER['REQUEST_URI'] match —
 * same pattern the PVR runtime uses to own /pvr/[token]/. No WP
 * page row required; no rewrite rules required; no cache trickery
 * required. Renders page-private-viewing.php and exits.
 *
 *   - Synthesizes a $post stub if no real WP page exists, so the
 *     template + Rank Math + theme helpers don't choke on missing
 *     post object.
 *   - Forces Cache-Control: no-store on the landing page so neither
 *     Rocket.net nor Cloudflare can ever cache a 404 again.
 *   - Auto-create-page logic kept as defense-in-depth (for SEO
 *     indexing, sitemap, admin "Edit Page" workflow).
 *
 * After install + cache purge, /private-viewing/ ALWAYS renders
 * — independent of WP page state.
 */

/*
 * v1.6.0-rc1 (2026-05-30) — HOTFIX over v1.6.0-beta
 * ---------------------------------------------------------------
 * Bug fix: v1.6.0-beta form submitted via GET → 404 (Autoptimize +
 * Cloudflare Rocket Loader were aggregating/deferring the inline
 * <script>, so the submit handler never bound to the form, and the
 * browser fell through to the default GET submission with form fields
 * in the URL — which 404'd because /private-viewing/?name=… has no
 * rewrite route.
 *
 * Three-way fix (any one would have prevented the 404):
 *   1. Form now has method="post" action="" — even if JS fails, the
 *      browser submits POST (no fields in URL, no 404).
 *   2. Inline <script> + <script type="application/json"> data island
 *      both carry data-no-optimize="1" and data-cfasync="false" so
 *      Autoptimize and Cloudflare Rocket Loader leave them untouched
 *      and inline, in source order.
 *   3. Init wrapped in a DOMContentLoaded guard so the handler binds
 *      even if some upstream optimizer defers the script.
 *
 * PHP-emitted REST URL + nonce moved out of the <script> body into a
 * pure-JSON data island. Optimizers can no longer rip the values out
 * of the IIFE because they're now in a separate <script type=json> tag.
 *
 * Same advisor-generalist match, success state, and error UI as
 * v1.6.0-beta — only the script-binding plumbing changed.
 */

/*
 * v1.6.0-beta (2026-05-30) — Delivery 2 of 3 for PVR Cutover Checkpoint 3
 * -----------------------------------------------------------------------
 * Wires the /private-viewing/ landing page form to the new plugin
 * backend (plugin v2.7.6+ class-private-viewing-v2.php REST endpoint).
 *
 * Changes vs v1.6.0-alpha:
 *   - Form submit now POSTs to /wp-json/legacy-pvr/v1/private-viewing-request
 *     instead of showing the "preview mode" message.
 *   - On success: form is replaced by a beautiful success state showing
 *     the assigned specialist's name + WhatsApp link.
 *   - On error: inline error message in form (with WhatsApp fallback CTA).
 *   - Client-side guard before submit (required-field check).
 *   - Loading state on submit button.
 *
 *   FIX: Landing page advisor selection now uses
 *   for_region_and_specialty($region, 'generalist') instead of
 *   for_region($region). Landing-page first impression should be a
 *   DIRECTOR (Margaret Ashford, Henry Sinclair, Sébastien Laurent, etc.),
 *   not a specialty advisor. Earlier v1.6.0-alpha could pick Felix
 *   Hartwell (UK Tennis Bracelets Specialist) for a no-context visitor —
 *   v1.6.0-beta always picks the regional generalist for landing.
 *
 * Same hero, 3-step process, advisor card, trust strip, footer as v1.6.0-alpha.
 * Same /private-viewing/ page auto-create + Rank Math noindex.
 */


/*
 * v1.6.0-alpha (2026-05-30) — PRIVATE VIEWING ROOM landing page
 * --------------------------------------------------------------
 * Delivery 1 of 3 for PVR Cutover Checkpoint 3.
 *
 * NEW: /private-viewing/ landing page
 *   - page-private-viewing.php — full-page editorial template
 *     (video hero + 3-step process + dynamic advisor card +
 *      lead-capture form + trust strip + reassurance footer)
 *   - Mobile-first, matches /our-legacy/ + /about-us/ design system
 *   - Hero video: legacy-about-gemstone-01.mp4 (override via
 *     ACF pv_hero_video field once a bespoke clip is filmed)
 *   - Advisor card pulled live from LPVR_V2_Advisors::for_region()
 *     based on CF-IPCountry — same logic as v1.5.8 product pages
 *
 * NEW: functions.php legacy_pv_ensure_landing_page()
 *   - Creates the /private-viewing/ WP page if missing
 *   - Assigns the page-private-viewing.php template
 *   - Sets Rank Math noindex (page is reached via cutover redirects,
 *     not organic search)
 *
 * THIS DELIVERY DOES NOT YET:
 *   - Wire the form to a real backend (preview-mode handler shows
 *     a "backend ships next deploy" message on submit)
 *   - Redirect /pvr-collection/ → /private-viewing/ (checkpoint 4)
 *   - Redirect ld_page_54459 → /private-viewing/ (checkpoint 5)
 *
 * Those land in Deliveries 2 and 3.
 */


/*
 * v1.5.12 hotfix (2026-05-30) — Email body: clean URL + cross-client safe
 * -----------------------------------------------------------------------
 * v1.5.11 fixed WhatsApp but the Email body still suffered the same root
 * cause: Apple Mail's mailto handler strips %0A newlines, so the body
 * collapsed to:
 *   "Dear Penelope,I'm interested...Diamondshttps://.../Thank you."
 * → URL ran into adjacent text, recipient saw broken link, product name
 *   collided with the URL.
 *
 * v1.5.12 redesigns the email body to be robust:
 *   - Uses \r\n (RFC 5322 line ending) — Apple Mail honors this more
 *     reliably than \n alone.
 *   - Body reads as a clean paragraph EVEN IF line breaks are stripped.
 *   - URL placed on its own line, surrounded by sentence-ending periods
 *     and spaces, so URL auto-detection always terminates cleanly.
 *   - Product name removed from body — already in the subject line and
 *     encoded in the URL slug; redundant in the body and was the source
 *     of the previous "Diamondshttps://" concatenation bug.
 *
 * No other changes from v1.5.11.
 */


/*
 * v1.5.11 hotfix (2026-05-30) — fix broken URL in WhatsApp prefills
 * -----------------------------------------------------------------
 * v1.5.10 put the product URL in the MIDDLE of the WhatsApp message
 * with `\n\n` (newlines) on either side. Bug confirmed live by Sudeep:
 * WhatsApp's wa.me prefill strips %0A newlines, AND its URL
 * auto-detector grabs any adjacent text — so the URL absorbed "Could"
 * from the next sentence, producing
 *   https://.../18-carat-oval-diamond-tennis-bracelet/Could
 * which 404s.
 *
 * Fix: move URL to the END of every prefilled message, separated by a
 * single space. WhatsApp linkifies just the URL and renders the rich
 * preview card BELOW the text. Same pattern in all 9 surfaces:
 *   - meet_advisor WhatsApp prefill
 *   - meet_advisor Email body (still uses newlines — email clients
 *     honor them; only WhatsApp strips them)
 *   - floating_advisor trigger
 *   - floating_advisor video walkthrough
 *   - floating_advisor provenance
 *   - floating_advisor price
 *   - JS Make-Offer prompt
 *   - JS Message-Advisor prompt
 *   - JS Suggest-Price prompt (related cards)
 */


/*
 * v1.5.10 changelog (2026-05-30) — RICH-LINK PREVIEWS FOR SHARED CTAs
 * --------------------------------------------------------------------
 * Every Message / Email / WhatsApp CTA on a product page now includes
 * the product URL in the prefilled message text. Result: WhatsApp,
 * iMessage, Slack, Gmail and other clients auto-render the rich
 * Open Graph preview card (image + title + description) when the
 * buyer's message is opened — instead of a plain-text-only message.
 *
 * Edited surfaces in inc/stage3/stage3-render.php:
 *   - legacy_stage3_meet_advisor()      — Message + Email CTAs on the
 *                                          advisor card (the one buyers
 *                                          see most)
 *   - legacy_stage3_floating_advisor()  — floating bubble trigger +
 *                                          3 quick-action links (video
 *                                          walkthrough, provenance,
 *                                          negotiate price)
 *   - legacy_stage3_js()                — added LD_PRODUCT_URL JS
 *                                          global; used in Make-an-Offer
 *                                          prompt + Message Advisor
 *                                          prompt + Suggest-a-Price
 *                                          (related cards fall back to
 *                                          product name if URL not
 *                                          available on the card)
 *
 * Generic captures NOT touched (no piece context):
 *   - Alert signup ("add me to alerts for [category]")
 *   - Email signup ("add me to the Legacy private list")
 *
 * Why this matters: a buyer who messages "Hello Penelope, I'd like to
 * discuss the 18-Carat Oval Diamond Tennis Bracelet" via plain text
 * communicates 70% of the intent. The same message with the URL
 * embedded renders the piece's photograph + title + description as a
 * rich card — closer to 100% intent, looks professional, prevents
 * misidentification ("which piece?"), and reinforces the brand on every
 * shared message.
 */


/*
 * v1.5.9 changelog (2026-05-30) — REMOVED FAKE RATING DISPLAY
 * -----------------------------------------------------------------
 * The "★★★★★ 5.0 / View All Reviews (47)" badge on every product page
 * was misleading social proof:
 *   - Stars hardcoded to 5.0 regardless of any actual rating
 *   - Review count was a crc32 hash (47-69), not real reviews
 *   - Linked to /private-client-services/#reviews which doesn't host
 *     real reviews — clicking exposed the fake
 *
 * v1.5.9 removes the call site in legacy_stage3_render() and turns
 * legacy_stage3_view_all_reviews() into a no-op stub (kept for forward
 * compatibility; docblock has the future re-enablement path via real
 * WooCommerce reviews).
 *
 * The CSS classes (.ld-rating-row, .ld-view-all-reviews) are kept in
 * the stylesheet for the future real-reviews implementation.
 *
 * No other changes from v1.5.8.
 */


/*
 * v1.5.8 changelog (2026-05-30) — DYNAMIC ADVISOR ON PRODUCT PAGES
 * -----------------------------------------------------------------
 * Catherine Brennan was hardcoded on every product page (~3,648 pieces)
 * in three places inside inc/stage3/stage3-render.php:
 *   - legacy_stage3_meet_advisor()      — the editorial card
 *   - legacy_stage3_floating_advisor()  — the persistent chat bubble
 *   - legacy_stage3_js() (Make-an-Offer prompt)
 *
 * v1.5.8 replaces all three with dynamic resolution via the
 * LPVR_V2_Advisors plugin API (requires legacy-pvr-dashboard v1.8.0+).
 *
 * Selection model: per-VISITOR + per-CATEGORY.
 *   - Visitor cookie ld_visitor_id persists for 1 year.
 *   - Region detected via CloudFlare CF-IPCountry header.
 *   - Specialty inferred from product categories (fancy_colour / bridal /
 *     investment / bespoke / estate / generalist).
 *   - Same visitor + same category = same advisor (always).
 *   - Same visitor + different category = different specialist.
 *
 * Also fixed:
 *   - "Typical response time: 1 hour" REMOVED (always-available rule).
 *   - "52 successful acquisitions · 7 yrs at Legacy" REPLACED with the
 *     advisor's real title.
 *   - "Follow Catherine" REPLACED with "Email {first_name}" mailto link.
 *   - WhatsApp prefill text uses {advisor.first_name} dynamically.
 *
 * Graceful degradation: if the plugin is < v1.8.0 (no for_region method),
 * theme falls back to LPVR_V2_Advisors::for_email() with a synthetic
 * visitor+category seed. If the plugin is missing entirely, falls back
 * to a hardcoded Alexandra Reed record so the page never breaks.
 */


/*
 * All site-wide styles are intentionally left here so Woodmart controls
 * the global design. Page-specific styles live inside each page template.
 * The Our Diamonds page uses page-our-diamonds.php which is fully self-contained.
 *
 * v1.5.7 — Architecture Consolidation, Phase 3a finisher.
 *   ONE surgical change, no scope creep:
 *
 *     1. REMOVED  legacy_product_meta_description()  from functions.php.
 *        The function hooked wp_head at priority 1 and emitted a
 *        hard-coded `<meta name="description" content="… | Legacy Diamonds
 *        & Gemstones">`. It collided with Rank Math's own description
 *        emission at the same priority, producing two description tags
 *        in <head> on every product page. Identified 29 May 2026 via
 *        a one-off wp_head callback introspection trace.
 *
 *        Decision (recorded in v1.5.6, re-affirmed here): Rank Math owns
 *        SEO end-to-end. The theme owns rendering. The two never share
 *        a meta tag.
 *
 *     2. UPDATED  watermark comment in functions.php
 *        v1.5.6 → v1.5.7. Both PATH MARKER and VERSION MARKER are kept;
 *        they will be removed wholesale in v1.6.0 once the cutover soak
 *        completes.
 *
 *   Net: one named function deleted, one version-string bump. Stage 3
 *   cutover (Phase 3a) now reads CLEAN in view-source — exactly one
 *   description tag per product page, sourced from Rank Math.
 *
 * v1.5.6 — Architecture Consolidation, Phase 3a (Path Fix + SEO Decoupling).
 *   Two surgical changes plus two diagnostic markers:
 *
 *     1. MOVED  single-product.php  →  woocommerce/single-product.php
 *        Earlier theme had the template at theme root. WooCommerce's
 *        template_loader hierarchy only picks it up from /woocommerce/.
 *        With the snippet active this file is dormant (snippet's
 *        template_include filter intercepts first). With the snippet
 *        deactivated WooCommerce now correctly routes to the theme.
 *
 *     2. STRIPPED  legacy_stage3_emit_seo_meta()  CALL
 *        from inc/stage3/stage3-render.php — Rank Math is now the sole
 *        SEO source. The function definition is retained for emergency
 *        rollback but the call site is commented out. Decouples
 *        rendering from SEO and prevents the duplicate-emission problem
 *        observed 2026-05-29.
 *
 *     3. ADDED  v1.5.6 VERSION MARKER  via wp_head
 *        Emits an HTML comment <!-- LD theme v1.5.6 active --> on every
 *        page. Allows view-source verification that the new theme is
 *        installed BEFORE the snippet cutover.
 *
 *     4. ADDED  PATH MARKER  in woocommerce/single-product.php
 *        Emits an HTML comment confirming WooCommerce is actually
 *        loading the theme's template (vs falling through to WoodMart's
 *        or WooCommerce default).
 *
 *   Both markers are removed in v1.6.0 once the cutover is verified.
 *
  * v1.2.0 — Architecture Consolidation, Phase 2.
 *   Adds the site chrome as real theme templates:
 *     header-legacy.php     — gold marquee + sticky nav
 *     footer-legacy.php     — link grid + Private List + region bar
 *     css/legacy-chrome.css — chrome styles, lifted verbatim from the
 *                             legacy_stage3_css() snippet
 *   The chrome markup/CSS is byte-identical to what production renders
 *   today; only its home lives in the theme instead of a runtime snippet.
 *   The templates are OPT-IN — invoked via get_header('legacy') /
 *   get_footer('legacy') — so activating the theme changes nothing a
 *   customer sees. Each page type adopts the chrome when it is migrated.
 *
 * v1.3.0 — Architecture Consolidation, Phase 3a.
 *   Migrates the STAGE 3 v2.14 editorial product-page renderer into the
 *   theme as real WordPress templates:
 *     single-product.php          — the entry template WordPress routes
 *                                   single-product requests to
 *     inc/stage3/stage3-render.php — the legacy_stage3_* renderer, lifted
 *                                   verbatim from the runtime snippet
 *   Like the Phase 2 chrome, this is INERT until adopted: while the runtime
 *   "STAGE 3" snippet is active, its template_include filter intercepts
 *   product pages first and the theme renderer is never reached. The theme
 *   renderer takes over only when the snippet is deactivated — done on
 *   staging and verified pixel-for-pixel against production before promotion.
 *
 * v1.3.1 — Hotfix. v1.3.0 loaded the STAGE 3 renderer from functions.php;
 *   on sites where the theme loads before the runtime snippet, both declared
 *   the legacy_stage3_* functions and PHP fatalled (Cannot redeclare). The
 *   renderer is now lazy-loaded by single-product.php at template time only,
 *   so the declaration happens exactly once per request and can never
 *   collide with the snippet, whatever the plugin/theme load order.
 *
 * v1.3.2 — DIAGNOSTIC BUILD. single-product.php is instrumented to capture
 *   and print the exact PHP fatal the migrated renderer produces when it runs
 *   from the theme (instead of WordPress's generic critical-error page). This
 *   is a temporary build for diagnosis only; it is replaced with the clean
 *   single-product.php once the cause is fixed. While the STAGE 3 snippet is
 *   active this template is never reached, so the build is inert until the
 *   snippet is switched off.
 *
 * v1.3.3 — Fix. The v1.3.2 diagnostic identified the cause: an in-file
 *   function_exists()/return guard at the top of inc/stage3/stage3-render.php
 *   sat ABOVE the constant define() calls. PHP early-binds top-level function
 *   declarations at compile time, so that guard always saw legacy_stage3_render
 *   as defined and returned before the define() calls ran — leaving
 *   LEGACY_STAGE3_HOME_URL (and the other two constants) undefined and the
 *   renderer fatalling. The guard is removed; the caller (single-product.php)
 *   gates the require, which is the only correct place to do so. The on-screen
 *   error reporter is retained as a safety net for the cutover verification.
 *
 * v1.4.0 — Architecture Consolidation, Phase 4.
 *   Migrates the LEGACY_CATEGORIES renderer (the /our-collection/ category
 *   browse) into the theme as real WordPress templates:
 *     page-our-collection.php                   — the entry template
 *                                                 WordPress routes the
 *                                                 our-collection page to
 *     inc/legacy-collection/our-collection.html — the renderer, a complete
 *                                                 self-contained HTML
 *                                                 document lifted verbatim
 *                                                 from the wp_options blob
 *                                                 ld_page_54368
 *   The only change from the blob is structural: the 36 hard-coded staging
 *   domain prefixes are stripped so every URL is root-relative and the single
 *   theme file is correct on staging and production alike. The product grid
 *   is built client-side from the WooCommerce Store API, unchanged. Like the
 *   earlier phases this is INERT until adopted: the "Legacy Full Page
 *   Renderer" snippet intercepts the page first for as long as the wp_options
 *   row ld_page_54368 exists; renaming that option is the Phase 4 cutover.
 *
 * v1.4.1 — Phase 4 fix. The v1.4.0 build read the lifted blob in text mode,
 *   which silently normalised its 52 CRLF line endings to LF — a 52-byte,
 *   render-invisible drift from the source. v1.4.1 rebuilds our-collection.html
 *   from the raw bytes, so it is byte-verbatim with the wp_options blob save
 *   for the 36 deliberate domain-prefix removals.
 *
 * v1.5.5 — World-class OG card.
 *   v1.5.4 emitted all the SEO tags correctly but pointed `og:image` at
 *   the wide header logo PNG (1440x270). Social-share previews on
 *   WhatsApp / iMessage / Slack / Facebook / Twitter / LinkedIn cropped
 *   the logo badly, showing fragments like "EGAC" / "ONDS & GEMST"
 *   instead of a branded preview. OpenGraph.xyz flagged three issues:
 *   wrong aspect ratio, no headline in image, no CTA.
 *   Fix: bundle a proper 1200x630 Legacy OG card inside the theme at
 *   `assets/og/legacy-og-card.jpg`. The card carries the LEGACY wordmark
 *   in serif with letter-spacing, a round-brilliant diamond motif top
 *   centre, a "MAISON · ATELIER · COLLECTIONS" eyebrow with hairline
 *   flanks, the gold accent line and tagline, and a cities banner —
 *   NEW YORK · LONDON · PARIS · GENEVA · MILAN · TOKYO · HONG KONG ·
 *   SINGAPORE · DUBAI · SYDNEY. Auction-catalog frame and corner marks.
 *   `inc/legacy-collection/seo.php` `legacy_seo_fallback_image()` now
 *   resolves the child-theme stylesheet directory URI and serves the
 *   bundled JPG. Slug-route + cat-id pages still pull their first
 *   product hero when available (`legacy_seo_hero_image_for_cat`) — the
 *   bundled card is the fallback for the root `/our-collection/` and for
 *   any category where no product image is found.
 *
 * v1.5.4 — SEO unlock — require-gate fix.
 *   v1.5.3 emitted SEO tags via a template_redirect ob_start splice (correct
 *   pattern). But the require for `seo.php` lived INSIDE the
 *   `if (!function_exists('legacy_cat_map'))` gate that also gates all the
 *   other collection theme files. If anything on production still defined
 *   `legacy_cat_map` (a residual or reactivated snippet), the entire chain
 *   short-circuited and `seo.php` was never loaded. Hooks never registered.
 *   View-source showed no `<!-- Legacy SEO -->` marker.
 *   Fix: move the `require_once` for seo.php OUT of the gate. seo.php is
 *   uniquely namespaced (`legacy_seo_*`), has internal `function_exists`
 *   guards on the callers it depends on, and never redeclares anything.
 *   Loading it unconditionally is safe and makes the SEO emitter resilient
 *   to the state of the rest of the renderer stack.
 *
 * v1.5.3 — SEO unlock — bridge path fix.
 *   v1.5.2 wired the SEO emitter onto `wp_head`. But the entire Legacy
 *   collection family (root, slug-routed, and ?cat=N) renders through
 *   `page-our-collection.php` which does `readfile() + exit;` — WordPress's
 *   `wp_head()` is NEVER called on that path. The emitter ran on every
 *   non-collection page (where nothing matched its resolver) and ran on
 *   zero collection pages. Net effect: zero SEO output.
 *   Fix: emit through the same `template_redirect` ob_start mechanism the
 *   bridge payloads (template-injector.php) already use. Our buffer
 *   registers at priority 5 — AFTER template-injector's at priority 0 —
 *   so it wraps the injector's output. Our callback splices the SEO meta
 *   block before `</head>` in the final HTML, after the bridge payloads.
 *   Defensive `wp_head` hook also kept, no-op on collection pages.
 *   No other code touched.
 *
 * v1.5.2 — Category-page SEO unlock.
 *   Phase 4 v2 moved /our-collection/ and the 5 routed slugs (necklaces,
 *   bracelets, earrings, rings, fancy-colors) into the theme. v1.5.2 uses
 *   that consolidation to ship proper international SEO on every URL the
 *   collection renderer owns — bare /our-collection/, the 5 top-level
 *   slugs, and all 22 cat-id editorial slugs (?cat=N).
 *
 *   New file: `inc/legacy-collection/seo.php`.
 *
 *   On every Legacy collection URL, `wp_head` priority 1 now emits:
 *     - bespoke <meta name="description"> sourced from legacy_lux_meta()
 *     - canonical link to the clean slug (not the ?cat=N querystring form)
 *     - strong robots directive
 *     - Open Graph (type=website, title, description, url, image, locale)
 *     - Twitter card (summary_large_image)
 *     - geo + currency hints
 *     - hreflang for the 8 target markets (US/GB/EU/AU/CA/JP/KR/AE) +
 *       en catch-all + x-default — all pointing to the same English URL
 *       today, ready to redirect when we add localized variants
 *     - JSON-LD CollectionPage + BreadcrumbList schemas
 *
 *   Hero image picked automatically: the first published product in the
 *   resolved category. Falls back to the brand logo.
 *
 *   ADDITIVE ONLY. Zero customer-visible UI change. Yoast / Rank Math
 *   continue to emit their own tags lower in <head>; ours are first in
 *   source order so OG preview tools obey the "first occurrence" rule.
 *
 * v1.5.1 — Single-image product gallery fix.
 *   Bug: products with only one gallery image rendered as a tiny dot inside
 *   a 78-pixel box. Root cause: the gallery wrap carried the
 *   `has-vertical-thumbs` class unconditionally, which on viewports >=1024px
 *   activates a 2-column CSS Grid `78px 1fr`. When `$count === 1` the
 *   `ld-gallery-thumbs` rail is not output, but the surviving wrapper around
 *   `ld-gallery-main` becomes the single grid child — and falls into the
 *   first 78-pixel column. The main image, with `object-fit: contain`, then
 *   shrinks to a speck.
 *   Fix: one line in `inc/stage3/stage3-render.php` (line 1758) —
 *   `has-vertical-thumbs` is now conditional on `$count > 1`. Single-image
 *   products now render at full width as designed. No other changes.
 *
 * v1.5.0 — Architecture Consolidation, Phase 4 v2.
 *   After the staging refresh from production revealed that the real
 *   customer-facing /our-collection/ experience was built by a stack of
 *   runtime snippets that lived on top of the ld_page_54368 blob — not the
 *   blob alone — Phase 4 v2 absorbs that whole stack into the theme:
 *     inc/legacy-collection/category-meta.php       data for slug routing + lux meta
 *     inc/legacy-collection/slug-routing.php        parse_request rewrites for
 *                                                   /necklaces/, /bracelets/,
 *                                                   /earrings/, /rings/,
 *                                                   /fancy-colors/ onto page 54368
 *     inc/legacy-collection/rest-endpoints.php      /wp-json/legacy/v1/cut-products
 *                                                   and /search-products + their
 *                                                   callbacks
 *     inc/legacy-collection/bespoke-handler.php     /wp-json/legacy/v1/bespoke
 *                                                   POST handler + dual-email flow
 *     inc/legacy-collection/payload-*.php           the four payload string-
 *                                                   builders (global CSS,
 *                                                   private-viewing JS, refine JS,
 *                                                   bespoke modal JS) — lifted
 *                                                   verbatim from the snippet
 *     inc/legacy-collection/template-injector.php   the wp_head fallback hook +
 *                                                   the template_redirect ob_start
 *                                                   splice that injects the
 *                                                   bridge CSS/JS before </head> —
 *                                                   plus the SalesIQ widget
 *                                                   injection before </body>
 *                                                   (absorbed from "RENDERER v2 —
 *                                                   inject SalesIQ widget")
 *   functions.php gates the entire require chain on !function_exists('legacy_cat_map')
 *   so the legacy snippets and the theme can coexist without redeclaration
 *   collisions; deactivating the snippets is what flips the theme on.
 *   Cutover sequence: install v1.5.0 (inert) -> deactivate "Legacy necklaces
 *   use collection v1" -> deactivate "RENDERER v2 — inject SalesIQ widget" ->
 *   (optionally) rename ld_page_54368 so this template provides the frame
 *   directly. Each step independently rollbackable.
 */

/* ============================================================================
   v1.9.9 — Branded "My Account" (kills the WoodMart account cliff)
   All rules scoped to .woocommerce-account so they only affect account pages.
   ========================================================================== */
.woocommerce-account .lds-acct{font-family:"Cormorant Garamond",Georgia,serif;color:#f4efe6;max-width:880px}
.woocommerce-account .lds-acct__eyebrow{font-family:"Jost","Helvetica Neue",Arial,sans-serif;letter-spacing:.28em;text-transform:uppercase;font-size:.72rem;color:#c9a44c;margin:0 0 .6rem}
.woocommerce-account .lds-acct__title{font-size:2.6rem;font-weight:300;line-height:1.05;margin:0 0 .5rem;color:#fff}
.woocommerce-account .lds-acct__sub{font-size:1.15rem;line-height:1.6;color:#bcae97;max-width:60ch;margin:0 0 2rem}
.woocommerce-account .lds-acct__cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem;margin:0 0 2rem}
.woocommerce-account .lds-acct__card{display:block;padding:1.6rem 1.5rem;border:1px solid rgba(201,164,76,.32);border-radius:4px;background:linear-gradient(160deg,rgba(201,164,76,.05),rgba(0,0,0,0));text-decoration:none;transition:border-color .25s ease,transform .25s ease,background .25s ease}
.woocommerce-account .lds-acct__card:hover{border-color:#c9a44c;transform:translateY(-2px);background:linear-gradient(160deg,rgba(201,164,76,.12),rgba(0,0,0,0))}
.woocommerce-account .lds-acct__card--primary{background:linear-gradient(160deg,rgba(201,164,76,.16),rgba(0,0,0,0));border-color:rgba(201,164,76,.55)}
.woocommerce-account .lds-acct__card-k{display:block;font-family:"Jost",sans-serif;letter-spacing:.2em;text-transform:uppercase;font-size:.66rem;color:#c9a44c;margin-bottom:.5rem}
.woocommerce-account .lds-acct__card-t{display:block;font-size:1.5rem;color:#fff;margin-bottom:.35rem}
.woocommerce-account .lds-acct__card-d{display:block;font-size:1rem;color:#9d927d;line-height:1.5}
.woocommerce-account .lds-acct__advisor{border-top:1px solid rgba(201,164,76,.22);padding:1.4rem 0;margin:0 0 1.6rem;display:flex;flex-direction:column;gap:.25rem}
.woocommerce-account .lds-acct__advisor-k{font-family:"Jost",sans-serif;letter-spacing:.22em;text-transform:uppercase;font-size:.66rem;color:#c9a44c}
.woocommerce-account .lds-acct__advisor-n{font-size:1.5rem;color:#fff}
.woocommerce-account .lds-acct__advisor-d{font-size:1rem;color:#9d927d;font-style:italic}
.woocommerce-account .lds-acct__manage{display:flex;flex-wrap:wrap;gap:.5rem 1.75rem}
.woocommerce-account .lds-acct__manage a{font-family:"Jost",sans-serif;letter-spacing:.12em;text-transform:uppercase;font-size:.72rem;color:#bcae97;text-decoration:none;border-bottom:1px solid transparent;padding-bottom:2px;transition:color .2s ease,border-color .2s ease}
.woocommerce-account .lds-acct__manage a:hover{color:#c9a44c;border-color:#c9a44c}

/* --- Brand the surrounding WooCommerce account chrome (nav + sub-pages) --- */
.woocommerce-account .woocommerce{color:#e8e0d2}
.woocommerce-account .woocommerce-MyAccount-navigation ul{list-style:none;margin:0;padding:0;border:1px solid rgba(201,164,76,.20);border-radius:4px;overflow:hidden}
.woocommerce-account .woocommerce-MyAccount-navigation li{margin:0;border-bottom:1px solid rgba(201,164,76,.12)}
.woocommerce-account .woocommerce-MyAccount-navigation li:last-child{border-bottom:0}
.woocommerce-account .woocommerce-MyAccount-navigation li a{display:block;padding:.85rem 1.1rem;font-family:"Jost",sans-serif;letter-spacing:.14em;text-transform:uppercase;font-size:.74rem;color:#bcae97;text-decoration:none;transition:background .2s ease,color .2s ease}
.woocommerce-account .woocommerce-MyAccount-navigation li a:hover{background:rgba(201,164,76,.08);color:#f4efe6}
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--dashboard.is-active a{background:rgba(201,164,76,.16);color:#fff;box-shadow:inset 3px 0 0 #c9a44c}
.woocommerce-account .woocommerce-MyAccount-content{color:#e8e0d2}
.woocommerce-account .woocommerce-MyAccount-content h2,
.woocommerce-account .woocommerce-MyAccount-content h3{font-family:"Cormorant Garamond",Georgia,serif;font-weight:300;color:#fff}
.woocommerce-account .woocommerce-MyAccount-content a{color:#c9a44c}
.woocommerce-account .woocommerce-table,
.woocommerce-account table.shop_table{border-color:rgba(201,164,76,.20)}
.woocommerce-account .woocommerce-table th,
.woocommerce-account table.shop_table th{color:#c9a44c;font-family:"Jost",sans-serif;letter-spacing:.1em;text-transform:uppercase;font-size:.72rem}
.woocommerce-account .woocommerce-table td,
.woocommerce-account table.shop_table td{border-color:rgba(201,164,76,.12)}
.woocommerce-account .woocommerce form .form-row label{color:#bcae97;font-family:"Jost",sans-serif;letter-spacing:.06em;font-size:.8rem}
.woocommerce-account .woocommerce form .form-row input.input-text,
.woocommerce-account .woocommerce form .form-row input[type=email],
.woocommerce-account .woocommerce form .form-row input[type=password],
.woocommerce-account .woocommerce form .form-row input[type=tel],
.woocommerce-account .woocommerce form .form-row select,
.woocommerce-account .woocommerce-Address-title + address,
.woocommerce-account .select2-container .select2-selection{background:#0d1117;border:1px solid rgba(201,164,76,.28);color:#f4efe6;border-radius:3px}
.woocommerce-account .woocommerce-Button,
.woocommerce-account .woocommerce button.button,
.woocommerce-account .woocommerce a.button{background:#c9a44c;color:#10131a;border:0;border-radius:3px;font-family:"Jost",sans-serif;letter-spacing:.14em;text-transform:uppercase;font-size:.74rem;padding:.8rem 1.6rem;transition:filter .2s ease}
.woocommerce-account .woocommerce-Button:hover,
.woocommerce-account .woocommerce button.button:hover,
.woocommerce-account .woocommerce a.button:hover{filter:brightness(1.08)}
@media (max-width:782px){
  .woocommerce-account .lds-acct__title{font-size:2.1rem}
  .woocommerce-account .lds-acct__sub{font-size:1.05rem}
}

/* v1.9.11 — Full-brand My Account shell (legacy-account.php) */
body.woocommerce-account{background:#0a0e14}
.ld-account-main{background:#0a0e14;min-height:62vh;padding:56px 20px 96px}
.ld-account-shell{max-width:1180px;margin:0 auto}
.ld-account-shell .woocommerce-MyAccount-navigation{width:26%}
.ld-account-shell .woocommerce-MyAccount-content{width:70%}
@media (max-width:782px){
  .ld-account-main{padding:32px 16px 72px}
  .ld-account-shell .woocommerce-MyAccount-navigation,
  .ld-account-shell .woocommerce-MyAccount-content{width:100%;float:none}
}

/* ============================================================================
   v1.9.12 — My Account polish: neutralise WoodMart button bleed on the Legacy
   chrome (WoodMart forces #f3f3f3 on <button>), tidy spacing both views.
   ========================================================================== */
/* Header save/share icon buttons — restore transparent Legacy chrome look */
.ld-header .ld-header-save,
.ld-header .ld-header-save.lds-saved-on,
.ld-header button.ld-icon-btn,
.ld-header .ld-icon-btn{background:transparent !important;box-shadow:none !important}
.ld-header .ld-icon-btn:hover{border-color:var(--lg-gold,#c9a44c) !important}

/* Footer accordion toggles — transparent, gold label (was white) */
.ld-footer .ld-footer-col-toggle,
.ld-footer button.ld-footer-col-toggle{background:transparent !important;border:none !important;border-bottom:1px solid var(--lg-line,rgba(201,164,76,.18)) !important;color:var(--lg-gold,#c9a44c) !important;box-shadow:none !important}

/* Footer newsletter submit — transparent w/ cream border, gold on hover */
.ld-footer .ld-footer-newsletter-btn,
.ld-footer button.ld-footer-newsletter-btn{background:transparent !important;border:1px solid var(--lg-cream,#e8dfce) !important;color:var(--lg-cream,#e8dfce) !important;box-shadow:none !important}
.ld-footer .ld-footer-newsletter-btn:hover,
.ld-footer button.ld-footer-newsletter-btn:hover{background:var(--lg-gold,#c9a44c) !important;border-color:var(--lg-gold,#c9a44c) !important;color:#10131a !important}

/* Tidy the account shell: clear floated WC columns + sensible min-height so the
   Legacy footer sits right under the content (kills the large empty gap). */
.ld-account-main{min-height:46vh}
.ld-account-main .woocommerce::after{content:"";display:table;clear:both}
.ld-account-main .woocommerce-MyAccount-content{min-height:0}
@media (max-width:1199px){
  /* On tablet/mobile the WC nav stacks above content with breathing room */
  .ld-account-shell .woocommerce-MyAccount-navigation{width:100%;float:none;margin:0 0 1.5rem}
  .ld-account-shell .woocommerce-MyAccount-content{width:100%;float:none}
}

/* ============================================================================
   v1.9.13 — PC: stop the account nav/content being cropped under the sticky
   Legacy header. WoodMart can set the MyAccount navigation to position:sticky
   (or cap its height), which tucks "Dashboard / Orders / Downloads…" behind our
   sticky header. Force normal flow, no height cap, and clear the header + admin
   bar at the top.
   ========================================================================== */
.ld-account-main .woocommerce-MyAccount-navigation,
.ld-account-main .woocommerce-MyAccount-content{
  position:static !important; top:auto !important;
  max-height:none !important; overflow:visible !important;
}
.ld-account-main .woocommerce-MyAccount-navigation ul{max-height:none !important;overflow:visible !important}
html{scroll-padding-top:140px}
@media (min-width:1200px){ .ld-account-main{padding-top:72px} }
.admin-bar .ld-account-main{padding-top:96px}
@media (max-width:1199px){ .admin-bar .ld-account-main{padding-top:64px} }

/* ============================================================================
   v1.9.14 — My Account world-class pass. Neutralise WoodMart interference on
   the Legacy chrome (header logo/nav overlap, doubled footer columns), clean
   borderless header icons, widen + centre the account grid.
   ========================================================================== */
/* HEADER: constrained three-zone flex so nav never crowds the logo */
.ld-header .ld-header-bar{max-width:1480px !important;margin:0 auto !important}
.ld-header .ld-header-left{flex:0 0 auto !important}
.ld-header .ld-header-right{flex:0 0 auto !important}
.ld-header .ld-nav{flex:1 1 auto !important;min-width:0;justify-content:center;position:static !important;margin:0 28px}
.ld-header .logo{position:static !important;float:none !important;width:auto !important}
/* HEADER ICONS: clean, borderless, transparent (kills the empty "box" look) */
.ld-header .ld-icon-btn{background:transparent !important;border:0 !important;box-shadow:none !important;width:auto !important;min-width:38px;padding:0 8px !important}
.ld-header .ld-icon-btn svg{display:block}
.ld-header .ld-icon-counter,.ld-header .ld-cart-total,.ld-header .ld-cart-badge{color:var(--lg-gold,#c9a44c)}

/* FOOTER: desktop shows clean columns; hide the mobile accordion toggles that
   WoodMart was leaving visible (the doubled COLLECTIONS/DIAMONDS/… labels) */
@media (min-width:700px){
  .ld-footer .ld-footer-col-toggle{display:none !important}
  .ld-footer .ld-footer-collapsible-col h4{display:block !important}
  .ld-footer .ld-footer-col-body{display:block !important}
}

/* ACCOUNT GRID: centre + use more width on large screens */
.ld-account-shell{max-width:1400px;margin-left:auto !important;margin-right:auto !important}
.ld-account-shell .woocommerce{width:100%}
@media (min-width:1200px){
  .ld-account-shell .woocommerce-MyAccount-navigation{width:24%}
  .ld-account-shell .woocommerce-MyAccount-content{width:72%}
}

/* ============================================================================
   v1.9.15 — Account nav must FILL its column at every width. On very wide
   screens the bordered nav box shrank to content width (narrow lines); force
   the ul/li/links to 100% so the box + dividers span the full column.
   ========================================================================== */
.ld-account-main .woocommerce-MyAccount-navigation{box-sizing:border-box;display:block}
.ld-account-main .woocommerce-MyAccount-navigation ul{width:100% !important;display:block !important;float:none !important;box-sizing:border-box}
.ld-account-main .woocommerce-MyAccount-navigation li{width:100% !important;display:block !important;float:none !important;margin:0}
.ld-account-main .woocommerce-MyAccount-navigation li a{display:block !important;width:100% !important;box-sizing:border-box}
.ld-account-main .woocommerce-MyAccount-content{box-sizing:border-box}
.ld-account-main .woocommerce-MyAccount-content .lds-acct{max-width:none}

/* ============================================================================
   v1.9.16 — Definitive account layout (flexbox) + header-right tidy.
   The WC account NAVIGATION CONTAINER was collapsing to content width on wide
   screens (so ul:100% still looked narrow). Lay the account out with flexbox:
   fixed 300px nav, content fills the rest. Plus align the header icon cluster.
   ========================================================================== */
@media (min-width:1200px){
  .ld-account-main .woocommerce{display:flex !important;flex-wrap:nowrap;gap:48px;align-items:flex-start}
  .ld-account-main .woocommerce-MyAccount-navigation{flex:0 0 300px !important;width:300px !important;max-width:300px !important;float:none !important}
  .ld-account-main .woocommerce-MyAccount-content{flex:1 1 auto !important;width:auto !important;max-width:none !important;min-width:0;float:none !important}
}
@media (max-width:1199px){
  .ld-account-main .woocommerce{display:block}
}

/* Header right cluster — even alignment + spacing, neat cart badge/total */
.ld-header .ld-header-right{display:flex !important;align-items:center;gap:16px}
.ld-header .ld-header-save{display:inline-flex !important;align-items:center;gap:6px}
.ld-header .ld-header-cart{display:inline-flex !important;align-items:center;gap:7px}
.ld-header .ld-icon-counter{position:static !important;font-size:11px;font-weight:500;line-height:1}
.ld-header .ld-cart-total{font-size:12px;letter-spacing:.03em;line-height:1}
.ld-header .ld-header-cart .ld-cart-badge{position:absolute;top:-3px;right:-6px;background:var(--lg-gold,#c9a44c);color:#10131a;border-radius:999px;min-width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;padding:0 4px}

/* ============================================================================
   v1.10.0 — Canonical chrome rollout. WooCommerce + non-WC pages now render
   inside the Legacy chrome (woocommerce.php / header.php / footer.php). Base
   shell so content sits centred on the brand background; per-page WooCommerce
   styling (shop grid, cart, checkout) refined in follow-ups.
   ========================================================================== */
.ld-site-main,.ld-wc-main{background:#0a0e14;min-height:60vh;padding:48px 22px 96px}
.ld-wc-shell{max-width:1400px;margin:0 auto}
.ld-wc-shell .woocommerce, .ld-wc-shell .woocommerce-page{color:#e8e0d2}
.ld-wc-shell h1,.ld-wc-shell h2,.ld-wc-shell h3{font-family:"Cormorant Garamond",Georgia,serif;font-weight:300;color:#fff}
@media (max-width:782px){ .ld-site-main,.ld-wc-main{padding:28px 16px 72px} }

/* ============================================================================
   v1.10.1 — Mobile menu for the canonical Legacy chrome (header-legacy.php).
   The desktop nav (.ld-nav) only shows >=1200px; below that there was NO menu
   on shop/search/cart/account. This adds a pure-CSS hamburger + slide-in panel
   so navigation is consistent across the whole site on mobile/tablet.
   ========================================================================== */
.ld-mnav-toggle{position:absolute;width:0;height:0;opacity:0;pointer-events:none}
.ld-header .ld-burger{display:none}
@media (max-width:1199px){ .ld-header .ld-burger{display:inline-flex} }
.ld-mnav{position:fixed;inset:0;z-index:2000;visibility:hidden;opacity:0;transition:opacity .25s ease,visibility .25s ease}
.ld-mnav-backdrop{position:absolute;inset:0;background:rgba(5,10,16,.62);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
.ld-mnav-panel{position:absolute;top:0;right:0;height:100%;width:min(86vw,360px);background:#0a1520;border-left:1px solid rgba(201,164,76,.25);box-shadow:-20px 0 60px rgba(0,0,0,.55);transform:translateX(100%);transition:transform .28s ease;display:flex;flex-direction:column;padding:16px 22px 32px;overflow-y:auto}
.ld-mnav-toggle:checked ~ .ld-mnav{visibility:visible;opacity:1}
.ld-mnav-toggle:checked ~ .ld-mnav .ld-mnav-panel{transform:translateX(0)}
.ld-mnav-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;padding-bottom:12px;border-bottom:1px solid rgba(201,164,76,.18)}
.ld-mnav-brand{font-family:'Helvetica Neue',Arial,sans-serif;font-weight:700;letter-spacing:.02em;color:#fff;font-size:20px;text-transform:uppercase}
.ld-mnav-x{font-size:30px;line-height:1;color:#c9a44c;cursor:pointer;padding:0 4px}
.ld-mnav-panel a{display:block;padding:13px 2px;color:#e8dfce;text-decoration:none;font-family:'Jost','Helvetica Neue',Arial,sans-serif;letter-spacing:.16em;text-transform:uppercase;font-size:12px;border-bottom:1px solid rgba(201,164,76,.10)}
.ld-mnav-panel a:hover{color:#c9a44c}
.ld-mnav-circle{color:#c9a44c !important}
.ld-mnav-sep{height:8px;border:0}
.ld-mnav-cta{margin-top:16px !important;background:#c9a44c;color:#10131a !important;text-align:center;border-radius:3px;border-bottom:0 !important;font-weight:600;letter-spacing:.18em !important}

/* ============================================================================
   v1.10.2 — Mobile menu (native <details>, display-driven, no JS), world-class
   product-loop cards (search/shop/archives), and the single-product fix lives
   in woocommerce.php.
   ========================================================================== */
/* ---- Mobile menu (native details; panel under header z-index so burger closes) ---- */
.ld-m{display:none}
@media (max-width:1199px){ .ld-header .ld-m{display:inline-flex;align-items:center} }
.ld-m-burger{list-style:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.ld-m-burger::-webkit-details-marker{display:none}
.ld-m-burger::marker{content:""}
.ld-m-panel{display:none}
.ld-m[open] .ld-m-panel{display:block;position:fixed;inset:0;z-index:90;background:#0a1520;padding:96px 26px 48px;overflow-y:auto}
.ld-m[open] .ld-m-burger svg{display:none}
.ld-m[open] .ld-m-burger::after{content:"\00d7";font-size:26px;color:#c9a44c;line-height:1}
.ld-m-nav a{display:block;padding:14px 2px;color:#e8dfce;text-decoration:none;font-family:'Jost','Helvetica Neue',Arial,sans-serif;letter-spacing:.16em;text-transform:uppercase;font-size:12px;border-bottom:1px solid rgba(201,164,76,.12)}
.ld-m-nav a:hover{color:#c9a44c}
.ld-m-circle{color:#c9a44c !important}
.ld-m-cta{margin-top:16px;background:#c9a44c;color:#10131a !important;text-align:center;border-radius:3px;border-bottom:0 !important;font-weight:600;letter-spacing:.18em !important}

/* ---- Legacy product cards for WooCommerce loops (search / shop / archives) ---- */
.ld-wc-shell .woocommerce ul.products,.woocommerce ul.products.columns-1,.woocommerce ul.products.columns-2,.woocommerce ul.products.columns-3,.woocommerce ul.products.columns-4{display:grid !important;grid-template-columns:repeat(auto-fill,minmax(258px,1fr));gap:22px;margin:0 0 40px;padding:0;list-style:none}
.woocommerce ul.products::before,.woocommerce ul.products::after{content:none !important;display:none !important}
li.ld-pcard{list-style:none;margin:0 !important;width:auto !important;float:none !important;background:#0e1722;border:1px solid rgba(201,164,76,.16);border-radius:4px;overflow:hidden;display:flex;flex-direction:column}
.ld-pcard-media{position:relative;padding-top:100%;background:#fff;overflow:hidden}
.ld-pcard-imgwrap{position:absolute;inset:0;display:block}
.ld-pcard-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:none}
.ld-pcard-img.is-active{display:block}
.ld-pcard-arrow{position:absolute;top:50%;transform:translateY(-50%);width:34px;height:34px;border:0;background:rgba(10,16,24,.55);color:#fff;font-size:20px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:2;opacity:0;transition:opacity .2s}
.ld-pcard-media:hover .ld-pcard-arrow{opacity:1}
.ld-pcard-prev{left:8px}.ld-pcard-next{right:8px}
.ld-pcard-body{padding:18px;display:flex;flex-direction:column;gap:6px;flex:1}
.ld-pcard-eyebrow{font-family:'Jost',sans-serif;letter-spacing:.2em;text-transform:uppercase;font-size:9.5px;color:#c9a44c}
.ld-pcard-title{font-family:'Cormorant Garamond',Georgia,serif;font-size:1.35rem;line-height:1.18;color:#fff;text-decoration:none}
.ld-pcard-title:hover{color:#c9a44c}
.ld-pcard-spec{font-size:12px;color:#9d927d;line-height:1.5;margin:0}
.ld-pcard-price{margin:6px 0 12px;color:#f4efe6;font-size:1.05rem}
.ld-pcard-price del{color:#6f7a86;font-size:.85em;margin-right:6px}
.ld-pcard-price ins{text-decoration:none;color:#fff}
.ld-pcard-buy{display:block;text-align:center;background:#c9a44c;color:#10131a !important;padding:11px;font-family:'Jost',sans-serif;letter-spacing:.16em;text-transform:uppercase;font-size:11px;text-decoration:none;border-radius:2px;margin-top:auto}
.ld-pcard-buy:hover{filter:brightness(1.07)}
.ld-pcard-offer{display:block;text-align:center;border:1px solid rgba(201,164,76,.4);color:#c9a44c !important;padding:10px;margin-top:8px;font-family:'Jost',sans-serif;letter-spacing:.16em;text-transform:uppercase;font-size:11px;text-decoration:none;border-radius:2px}
.ld-pcard-offer:hover{border-color:#c9a44c;background:rgba(201,164,76,.08)}

/* ===== Legacy My Account — world-class account chrome (v1.10.5) ===== */
.woocommerce-account .ld-wc-shell{color:#f3eedb}
.woocommerce-account .woocommerce{max-width:1100px;margin:0 auto;padding:8px 16px 48px}
.woocommerce-account .woocommerce-MyAccount-navigation ul{list-style:none;margin:0 0 30px;padding:0 0 18px;display:flex;flex-wrap:wrap;gap:10px;border-bottom:0.5px solid rgba(201,160,80,0.25)}
.woocommerce-account .woocommerce-MyAccount-navigation li{margin:0}
.woocommerce-account .woocommerce-MyAccount-navigation li a{display:inline-block;padding:10px 18px;border:0.5px solid rgba(201,160,80,0.3);background:rgba(255,255,255,0.015);color:rgba(255,255,255,0.78);font-family:"Montserrat","Helvetica Neue",sans-serif;font-size:11px;font-weight:600;letter-spacing:0.18em;text-transform:uppercase;text-decoration:none;transition:border-color .2s,color .2s,background .2s}
.woocommerce-account .woocommerce-MyAccount-navigation li a:hover{border-color:#C9A050;color:#fff}
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a{background:#C9A050;border-color:#C9A050;color:#0c1824}
.woocommerce-account .woocommerce-MyAccount-content{color:rgba(255,255,255,0.82);font-family:"Montserrat","Helvetica Neue",sans-serif;font-size:14px;line-height:1.7}
.woocommerce-account .woocommerce-MyAccount-content a{color:#C9A050}
.woocommerce-account .woocommerce-MyAccount-content h1,.woocommerce-account .woocommerce-MyAccount-content h2,.woocommerce-account .woocommerce-MyAccount-content h3,.woocommerce-account legend{font-family:"Cormorant Garamond",Georgia,serif;color:#fff;font-weight:400;letter-spacing:0.01em}
.woocommerce-account form label{color:rgba(255,255,255,0.8);font-size:12px;letter-spacing:0.04em}
.woocommerce-account input[type=text],.woocommerce-account input[type=email],.woocommerce-account input[type=password],.woocommerce-account input[type=tel],.woocommerce-account input[type=number],.woocommerce-account select,.woocommerce-account textarea{background:#10151f !important;border:0.5px solid rgba(201,160,80,0.28) !important;color:#fff !important;border-radius:4px !important;padding:12px 14px !important}
.woocommerce-account input:focus,.woocommerce-account select:focus,.woocommerce-account textarea:focus{border-color:#C9A050 !important;box-shadow:0 0 0 3px rgba(201,160,80,0.16) !important;outline:none !important}
.woocommerce-account .button,.woocommerce-account button[type=submit],.woocommerce-account .woocommerce-Button{background:#C9A050 !important;color:#0c1824 !important;border:0 !important;border-radius:0 !important;padding:13px 26px !important;font-family:"Montserrat","Helvetica Neue",sans-serif !important;font-size:11px !important;font-weight:700 !important;letter-spacing:0.22em !important;text-transform:uppercase !important;box-shadow:none !important;transition:background .2s,color .2s !important}
.woocommerce-account .button:hover,.woocommerce-account button[type=submit]:hover,.woocommerce-account .woocommerce-Button:hover{background:#fff !important;color:#0c1824 !important}
.woocommerce-account table.shop_table,.woocommerce-account .woocommerce-orders-table{background:transparent !important;border:0.5px solid rgba(201,160,80,0.18) !important}
.woocommerce-account table.shop_table th{color:#C9A050 !important;font-family:"Montserrat","Helvetica Neue",sans-serif !important;font-size:10px !important;letter-spacing:0.2em !important;text-transform:uppercase !important;border-color:rgba(201,160,80,0.18) !important;background:transparent !important}
.woocommerce-account table.shop_table td{color:rgba(255,255,255,0.82) !important;border-color:rgba(255,255,255,0.06) !important;background:transparent !important}
.woocommerce-account .woocommerce-Address address,.woocommerce-account address{color:rgba(255,255,255,0.7);font-style:normal}
.woocommerce-account .woocommerce-message,.woocommerce-account .woocommerce-info,.woocommerce-account .woocommerce-notice{background:rgba(201,160,80,0.06) !important;border-top:2px solid #C9A050 !important;color:#f3eedb !important}
.woocommerce-account .woocommerce-error{background:rgba(220,68,53,0.08) !important;border-top:2px solid #dc4435 !important;color:#f3eedb !important}

/* Hide third-party social logins on account/login (v1.10.8) — we use the PVR sign-in */
.woocommerce-account .nsl-container,
.woocommerce-form-login .nsl-container,
.woocommerce-account .nsl-container-buttons,
.woocommerce-account div[class^="nsl-"],
.woocommerce-account .wd-social-login,
.woocommerce-account .social-login-buttons,
.woocommerce-account .googlesitekit-sign-in-with-google__frontend-output-button,
.woocommerce-form-login .googlesitekit-sign-in-with-google__frontend-output-button{display:none !important;}

/* Remove WoodMart built-in social login (Facebook/Google + "Or login with") on account — Legacy uses its own sign-in (v1.10.12) */
.woocommerce-account .wd-social-login,
.woocommerce-account .wd-login-divider,
.woocommerce-account a[href*="social_auth"],
.woocommerce a[href*="social_auth"],
.woocommerce-form-login .wd-social-login{display:none !important;}
