/* =========================================================================
   Flux Checkout — Strip WooCommerce/theme chrome, just show fields
   ========================================================================= */

/* WHOSE CHECKOUT IS THIS (1.9.8).
   This sheet restyles the payment area, so it must only touch what is Flux's.
   `body.flux-sole-method` is set (PHP at load, flux-hosted-checkout.js after every
   checkout refresh) when Flux is the ONLY payment method offered: nothing else is on the
   page, so the whole payment area is ours to strip. When another gateway is offered too
   (Cash on Delivery, a second card processor) only FLUX'S OWN method box is restyled and
   the other method keeps its store styling. Before 1.9.8 every rule below applied to
   every gateway whenever Flux was enabled. */

/* Flux is the only method: kill all wrapper backgrounds */
body.flux-sole-method.woocommerce-checkout #payment,
body.flux-sole-method .woocommerce-checkout-payment,
body.flux-sole-method.woocommerce-checkout #payment .wc_payment_methods,
body.flux-sole-method.woocommerce-checkout #payment .wc_payment_methods .wc_payment_method,
body.flux-sole-method.woocommerce-checkout #payment .payment_box,
/* Flux alongside another method: only Flux's own box */
.woocommerce-checkout #payment .wc_payment_methods li.payment_method_flux_gateway .payment_box {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.flux-sole-method.woocommerce-checkout #payment {
  overflow: visible !important;
}

body.flux-sole-method.woocommerce-checkout #payment .payment_box::before,
.woocommerce-checkout #payment .wc_payment_methods li.payment_method_flux_gateway .payment_box::before {
  display: none !important;
}

/* Gateway label/icon row.
   Hidden ONLY when Flux is the sole payment method (`li:only-child`) — with one
   choice there is nothing to choose, so the "Flux Payments" heading and its
   radio are noise above the card fields. Scoped to Flux's own item
   (`li.payment_method_flux_gateway`): a store whose only method is another gateway
   (Cash on Delivery) must keep that method's label and radio.

   Do NOT drop the :only-child qualifier. A blanket rule (pre-1.8.0) left every
   method unlabelled and unpickable on stores offering more than one gateway. */
.woocommerce-checkout #payment .wc_payment_methods li.payment_method_flux_gateway:only-child > label,
.woocommerce-checkout #payment .wc_payment_methods li.payment_method_flux_gateway:only-child > input[type="radio"] {
  display: none !important;
}

/* Billing / shipping / customer details.
   The PHP filter (woocommerce_checkout_fields) already removes WooCommerce's
   OWN default billing + shipping inputs, so nothing needs hiding here.

   Do NOT re-add `#customer_details` or `form.checkout h3` to a display:none
   rule. #customer_details is the ENTIRE left column of the checkout, which is
   where most plugins render CUSTOM fields — hiding it made a live store's
   required "Select Referral" and membership questions invisible even after the
   PHP stopped deleting them. Anything still rendering in that column belongs to
   the merchant and must stay visible. */

/* Privacy text is NOT hidden.
   The old rule tried to, but themes commonly render the notice outside these
   selectors, so in practice the sentence still showed while the sibling
   `.place-order a` rule removed the policy LINK inside it — leaving
   "...described in our ." on a live store. A store's privacy notice is also
   something merchants may be legally required to surface, so we leave it
   entirely alone and let the theme render it. */

/* Place Order area - shared by every gateway, so only when Flux is the only one */
body.flux-sole-method.woocommerce-checkout #payment .place-order {
  padding: 16px 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
}

/* Hide stray controls in .place-order that aren't the pay button — themes drop
   "Edit" / "Edit order" / back links in here that make no sense next to a card
   form the customer is mid-way through.

   Links need a two-step rule, NOT a blanket `.place-order a`:
     1.8.1 and earlier hid every link here, which silently gutted the privacy
     policy link ("...described in our ." — a live store shipped like that).
     1.8.2 removed the blanket rule and the theme's unstyled "Edit" link
     reappeared. So: hide all links, then explicitly restore the privacy one,
     matched two ways (container class OR link class) so it survives whichever
     markup the theme uses. */
body.flux-sole-method.woocommerce-checkout #payment .place-order button:not(#place_order),
body.flux-sole-method.woocommerce-checkout #payment .place-order input:not(#place_order) {
  display: none !important;
}

/* LINKS ARE DELIBERATELY NOT TOUCHED HERE (1.8.6).
   Two attempts to hide the theme's stray "Edit" link via `.place-order a` both
   ended up hiding the PRIVACY POLICY link instead ("...described in our .")
   while leaving "Edit" untouched — which proves the Edit link lives OUTSIDE
   `.place-order`, and the privacy link lives inside it without the standard
   `woocommerce-privacy-policy-*` classes this theme was assumed to use.
   Do not re-add a link rule here without the actual checkout markup in hand;
   the privacy notice is the one element in this area that must never break. */

/* Place Order button — INTENTIONALLY UNSTYLED.
   The theme owns this button. We used to force ~20 !important declarations on
   #place_order (Poppins, our navy, 8px radius, max-width 200px, our shadow),
   which overrode whatever the store's theme had designed and made the pay
   button look foreign on every site. The only thing left below is the disabled
   state, because that communicates a real interaction state rather than a look.

   Do NOT re-add colors, fonts, radius or sizing here. If a merchant wants a
   Flux-coloured button they can style it from their theme; the `button_color`
   gateway setting still drives OUR own surfaces (hosted-field internals and the
   express-mode Pay Now button). */

#place_order:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

/* Review order table - shared by every gateway, so only when Flux is the only one */
body.flux-sole-method .woocommerce-checkout-review-order {
  width: fit-content !important;
}
