/* PP — hide the header cart count badge while the cart is empty.

   Gate: pp_cart_empty_badge_hide_v1 (default ON).
   Delivered by inc/sections/cart-empty-badge-hide-v1.php via
   pp_print_section_stylesheet_link() at wp_head:1003.

   ── What the owner saw ──────────────────────────────────────────────────────
   A solid blue dot beside the desktop header cart on /my-account/ while logged
   out with an empty cart. Desktop only.

   ── The markup (fetched from inside the host, bypassing Cloudflare) ─────────
     <a class="cart-contents shopping-cart has-svg-icon">
       <span class="gp-icon shopping-cart">…svg…</span>
       <span class="number-of-items no-items">0</span>
       <span class="amount"></span></a>

   Note `no-items`: GeneratePress emits its own empty-state marker, server-side,
   present on first paint. WooCommerce's AJAX fragment for this node keeps it —
   the refreshed fragment is `<span class="number-of-items no-items"></span>` —
   so the class survives a cart-fragment refresh and is safe to key off.

   ── What paints the dot ─────────────────────────────────────────────────────
   Our own rule in assets/css/pp-v2-header-footer.css:
     body.pp-theme-v2 .shopping-cart .number-of-items{
       background-color:var(--pp-blue,#003D82)!important; color:#fff!important;
       min-width:18px!important; height:18px!important; border-radius:9px!important; }
   An 18x18 filled circle reads as a dot whether it contains "0" or a real count.
   Nothing suppressed it in the empty state, so the badge announced a quantity
   that did not exist.

   ── Why a section stylesheet and not css/overrides.css ──────────────────────
   This is the substantive delivery decision. `css/overrides.css` is a GENERATED
   source: per AGENTS.md it is split into css/overrides-{base,product,checkout,
   cart,account}.css by tools/scripts/split-overrides-css.js, and only the splits
   plus css/pp-bundle-base.css are actually enqueued. Editing overrides.css
   without running that generator ships nothing — the rule is never delivered.
   The generator is ESM and needs Node, which is not installed on this workstation
   or on the box, so it cannot be run here.

   Beyond tooling, the splitter would route these selectors by pattern, and
   `.cart-contents` is cart-flavoured — landing them in overrides-cart.css, which
   only loads on the cart route. The header cart badge is on EVERY page, so a
   cart-scoped split would leave the dot everywhere except /cart/.

   A section stylesheet is hand-authored, globally printed, gate-controlled, and
   automatically cache-busted by pp_asset_v(). It is the theme's supported path
   for new global CSS and it sidesteps both problems.

   ── Cascade ────────────────────────────────────────────────────────────────
   (0,4,1) with !important versus (0,3,1) for the painting rule it must beat, and
   printed at wp_head:1003 — after the header/footer stylesheet — so source order
   agrees with specificity.

   Mobile already hid this element unconditionally
   (#mobile-header .menu-bar-items .cart-contents .number-of-items), which is
   exactly why the dot was desktop-only. Mobile behaviour is unchanged.

   A populated cart is unaffected: GeneratePress drops `no-items` the moment the
   cart has contents, so the badge returns with its real count. */

body.pp-theme-v2 .cart-contents .number-of-items.no-items,
body.pp-theme-v2 .shopping-cart .number-of-items.no-items,
.cart-contents .number-of-items.no-items,
.shopping-cart .number-of-items.no-items {
	display: none !important;
}

/* The sibling `<span class="amount"></span>` is genuinely empty when the cart is
   empty. It carries no background of its own, so it paints nothing — but it can
   still contribute inline whitespace beside the icon. Hiding it while empty
   costs nothing and cannot affect a populated cart, which is not :empty. */
.cart-contents .amount:empty {
	display: none !important;
}
