/* ========================================================================
   BLAUW FILMS — Storefront CSS fixes
   Hosted on R2; loaded site-wide via one <link> in Site Settings > head.
   A home for small, surgical storefront CSS patches.
   ======================================================================== */

/* ------------------------------------------------------------------------
   Fix: stuck false add-to-cart error label.
   The Smootify add-to-cart error block (.add-to-card_error.w-form-fail —
   note the "card" typo in the class name is Webflow's, not ours) is being
   forced visible by an inline `display: block` on load, showing the wrong
   copy "Enter a valid discount code" even though add-to-cart works fine.
   This appears on the product page and on every CMS product card.

/* We hide ONLY this error block, sitewide. `!important` is required to win
   against the inline `display: block` Webflow/Smootify writes. The success
   block (.add-to-cart_success / "Thank you!") is untouched.

   IMPORTANT: Webflow created numbered combo-class variants of this block on
   different templates (add-to-card_error, add-to-card_error 4, etc. — "14 on
   other pages"). So we cannot target a single exact class. We instead match:
     1) any .w-form-fail inside the Smootify add-to-cart wrapper, AND
     2) any element whose class starts with add-to-card_error (the typo'd
        base class, shared by every numbered variant).
   Either condition catches the stuck error on product pages, store grid,
   and the homepage cards.

   Note: this suppresses the error block unconditionally, including genuine
   add-to-cart failures (e.g. out of stock). Acceptable for now because the
   message text is already wrong for that case and add-to-cart is reliable.
   The real root fix is template-side (why the block renders display:block
   on load) — a Smootify-template question, tracked separately.
   ------------------------------------------------------------------------ */

/* a) Any form-fail block inside a Smootify add-to-cart wrapper. */
.add-to-cart_form-wrapper .w-form-fail {
  display: none !important;
}

/* b) Any numbered variant of the typo'd error base class, anywhere. */
[class^="add-to-card_error"],
[class*=" add-to-card_error"] {
  display: none !important;
}

/* ------------------------------------------------------------------------
   Donation field: hide visually, keep in the DOM.
   Smootify's name-your-price feature only renders if its visible input
   (.add-to-cart_form .form-field, name="##ignore") is present in the
   published DOM. Webflow's "Hidden" visibility REMOVES it from the DOM,
   which makes Smootify drop the whole name-your-price feature (and any
   custom embed nested inside it). So the field's Webflow visibility must
   stay VISIBLE; we hide it from users here with CSS instead. The donate
   control (blauw-donate.js) still writes into it programmatically.
   ------------------------------------------------------------------------ */
.add-to-cart_form .form-field[name="##ignore"] {
  display: none !important;
}
