/* HM-1035 checkout fold. Loaded only when the fold is on (no kill file, or ?hm1035=1). */
/* ---- HM-1035 checkout fold: email first, preamble cut ----
   Target: #billing_email top ≤ 600 at 390×844 and ≤ 500 at 1440×900.
   Legal consent, Pro bump and wallets stay on the Details step, after the email field.
   CSS only plus a small reorder script in functions.php. No price or Place order changes. */

/* Drop the empty 149–155px express-pay reservation. Wallets, when present, sit after the email (script). */
html body.woocommerce-checkout .flux-step--details::before,
html body.woocommerce-checkout .flux-step::before,
html:not(.hmf-ex-done) body.woocommerce-checkout .flux-step--details:has(> #wc-stripe-express-checkout-element[style*="none"])::before,
html.hmf-ex-done body.woocommerce-checkout .flux-step--details::before{
  content:none!important;display:none!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important
}

/* Compact the early-bird / sale note on checkout to one tight strip. Do not edit hm-bf-surfaces.php. */
html body.woocommerce-checkout .hm-bf-cart-note--checkout,
html body.woocommerce-checkout .flux-checkout > .hm-bf-cart-note.hm-bf-cart-note--compact{
  margin:8px 16px 0!important;padding:8px 12px!important;font-size:13px!important;line-height:1.35!important;
  overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;max-height:none
}
html body.woocommerce-checkout .hm-bf-cart-note--checkout .hm-bf-bag,
html body.woocommerce-checkout .flux-checkout > .hm-bf-cart-note.hm-bf-cart-note--compact .hm-bf-bag{display:none!important}
@media (min-width:1000px){
  html body.woocommerce-checkout .hm-bf-cart-note--checkout,
  html body.woocommerce-checkout .flux-checkout > .hm-bf-cart-note.hm-bf-cart-note--compact{
    margin:8px 32px 0!important
  }
}
/* Staging-only keyed-preview warning; never part of a real purchase. */
html body.woocommerce-checkout #hm-bf-preview-block{display:none!important}

/* Slimmer brand row: name + nav on one line. */
html body.woocommerce-checkout .hm-r18-co-header{padding:8px 12px!important;gap:4px!important}
html body.woocommerce-checkout .hm-r18-co-header__name{font-size:16px!important;margin:0!important;line-height:1.2!important}
html body.woocommerce-checkout .hm-r18-co-header__row,html body.woocommerce-checkout .hm-r18-co-header__nav{gap:12px!important;margin:0!important}
html body.woocommerce-checkout .hm-r18-co-header__nav a{padding:2px 0!important}

/* Tighter Checkout heading + stepper so the field follows immediately. */
html body.woocommerce-checkout .flux-checkout__header{padding:0 0 8px!important;margin:0 0 8px!important}
html body.woocommerce-checkout h1.header__title,html body.woocommerce-checkout .flux-checkout__header .header__title{font-size:28px!important;line-height:1.15!important;margin:0 0 6px!important}
html body.woocommerce-checkout .flux-stepper{margin:0!important;padding:0!important}
html body.woocommerce-checkout .flux-step--details,html body.woocommerce-checkout .flux-checkout__steps{margin-top:0!important;padding-top:0!important}
html body.woocommerce-checkout #billing_email_field{margin:0 0 14px!important}

/* Phones: brand, summary, then the form. Consent is moved into the step after email (script). Fallback: after the form, never above it. */
@media (max-width:999px){
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce:has(> form.checkout){display:flex!important;flex-direction:column!important}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > *{order:8}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > .hm-r18-co-header{order:1}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > .flux-checkout__sidebar-header{order:2}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > form.checkout{order:3}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > :is(#hm-express-consent-gate,#hmf-gate-ph){order:4}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > #hm_mkt_opt_in_field{order:5!important;margin-top:16px!important}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > .hm-util-licence-line{order:6}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > .hm-r4b-trust{order:7!important;margin-top:16px!important}
}

/* Desktop r2: form shares row 1 with the header so the h1 sits just under the pill
   (the old grid-row:2 waited on the tall chips and left a 252px empty band).
   Payment chips are moved under the cart total by the fold script; CSS fallback
   parks a still-sibling .hm-r4b-trust on row 2, never on row 1. */
@media (min-width:1000px){
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce:has(> form.checkout){display:grid!important;grid-template-columns:60% 40%;align-items:start}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > *{grid-column:1}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > :is(.hm-r18-co-header,.hm-co-slim-header){grid-column:1;grid-row:1;z-index:2;align-self:start;margin:16px 0 0 32px!important;width:calc(60% - 64px)!important;max-width:none!important}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > form.checkout{grid-column:1 / -1;grid-row:1;margin-top:0!important}
  html body.woocommerce-checkout .woocommerce > form.checkout,
  html body.woocommerce-checkout .flux-checkout__content-wrapper{width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important}
  html body.woocommerce-checkout .flux-checkout__content-wrapper{display:flex!important}
  html body.woocommerce-checkout .flux-checkout__content-left,
  html body.woocommerce-checkout .flux-checkout__content-wrapper .flux-checkout__content-left{flex:1 1 60%!important;width:60%!important;max-width:60%!important;min-width:0!important;box-sizing:border-box!important;padding-top:var(--hmf-co-hdr,5.5rem)!important}
  html body.woocommerce-checkout .flux-checkout__content-right{flex:1 1 40%!important;width:40%!important;max-width:40%!important;min-width:0!important;box-sizing:border-box!important}
  html body.woocommerce-checkout .flux-checkout__content-left .flux-checkout__steps,
  html body.woocommerce-checkout .flux-checkout__content-left .flux-step,
  html body.woocommerce-checkout .flux-checkout__content-left .flux-step--details,
  html body.woocommerce-checkout .flux-checkout__content-left .flux-step__content,
  html body.woocommerce-checkout .flux-checkout__content-left .flux-heading,
  html body.woocommerce-checkout .flux-checkout__content-left .form-row,
  html body.woocommerce-checkout .flux-checkout__content-left :is(#billing_email_field,#hm924-xb-co,#hm924-lic,#hm-express-consent-gate,#hmf-gate-ph){
    max-width:100%!important;min-width:0!important;box-sizing:border-box!important
  }
  html body.woocommerce-checkout .flux-checkout__content-left .flux-step__content{width:100%!important}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > :is(.hm-r4b-trust,.hm-co-trust,.hm-wc-co-trust){grid-column:2!important;grid-row:2;margin:16px 32px 0 33px!important;width:auto!important;max-width:none!important}
  html body.woocommerce-checkout .flux-checkout__content-right :is(.hm-r4b-trust,.hm-co-trust,.hm-wc-co-trust),
  html body.woocommerce-checkout [class*="flux-checkout__sidebar"] :is(.hm-r4b-trust,.hm-co-trust,.hm-wc-co-trust){margin:16px 0 0!important;width:auto!important;max-width:none!important}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > .hm-util-licence-line{grid-column:2!important;grid-row:3;margin:12px 32px 0 33px!important;width:auto!important;max-width:none!important}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > #hm_mkt_opt_in_field{grid-column:1!important;grid-row:3;margin:12px 0 0 32px!important;width:calc(60% - 64px)!important;max-width:none!important}
  html body.woocommerce-checkout .flux-checkout__content > .woocommerce > :is(#hm-express-consent-gate,#hmf-gate-ph){grid-column:1!important;grid-row:4;margin:12px 0 0 32px!important;width:calc(60% - 64px)!important;max-width:none!important}
}

/* #hm924-lic: a complete short teaser (no nowrap, no ellipsis) + the existing disclosure.
   The original legal sentence is moved inside the details by the fold script, wording unchanged. */
html body.woocommerce-checkout #hm924-lic{padding:8px 14px!important;margin:0 0 14px!important}
html body.woocommerce-checkout #hm924-lic .hmf-lic-teaser,html.hmf-co-fold body.woocommerce-checkout #hm924-lic .hmf-lic-teaser{margin:0 0 4px!important;font-size:14px!important;line-height:1.35!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;font-family:"Source Sans 3",system-ui,-apple-system,"Segoe UI",sans-serif!important}
html body.woocommerce-checkout #hm924-lic .hm924-lic__line{margin:6px 0 8px!important;font-size:14px!important;line-height:1.35!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
html body.woocommerce-checkout #hm924-lic details.hm924-lic__d{margin:0!important}
html body.woocommerce-checkout #hm924-lic details.hm924-lic__d summary{min-height:0!important;padding:0!important;font-size:14px!important;line-height:1.35!important;font-weight:600}

/* 32–40 px of air between the withdrawal-consent card and "Customer Details". */
html body.woocommerce-checkout .flux-step__content > :is(#hm-express-consent-gate,#hmf-gate-ph){margin-bottom:0!important}
html body.woocommerce-checkout .flux-heading.hmf-co-cust{margin-top:36px!important}

/* Merged merchant card: a little tighter so "Licence at pay" stays in the first 900 px. */
html body.woocommerce-checkout .flux-checkout__content-right .hm-r4b-trust .hm-co-licence{margin-top:10px!important;padding:10px 12px!important}

/* HM-876: Flux ships Inter on fields and the cookie bar; the rest of checkout is already Source Sans 3. */
html.hmf-co-fold body.woocommerce-checkout .form-row,
html.hmf-co-fold body.woocommerce-checkout .form-row label,
html.hmf-co-fold body.woocommerce-checkout .form-row input,
html.hmf-co-fold body.woocommerce-checkout .form-row textarea,
html.hmf-co-fold body.woocommerce-checkout .form-row select,
html.hmf-co-fold body.woocommerce-checkout .form-row .optional,
html.hmf-co-fold body.woocommerce-checkout #billing_email,
html.hmf-co-fold body.woocommerce-checkout #billing_email_field,
html.hmf-co-fold body.woocommerce-checkout #billing_email_field label,
html.hmf-co-fold body.woocommerce-checkout input.input-text,
html.hmf-co-fold body.woocommerce-checkout textarea.input-text,
html.hmf-co-fold body.woocommerce-checkout .woocommerce-input-wrapper,
html.hmf-co-fold body.woocommerce-checkout .woocommerce-input-wrapper input,
html.hmf-co-fold body #hm-r15-consent,
html.hmf-co-fold body #hm-r15-consent *,
html.hmf-co-fold body #hm-r15-consent p,
html.hmf-co-fold body.woocommerce-checkout #hm924-lic .hmf-lic-teaser,
html.hmf-co-fold body #hm-r15-consent button{
  font-family:"Source Sans 3",system-ui,-apple-system,"Segoe UI",sans-serif!important
}

/* Inside the Details step: fields first; wallets after the email (script also reorders). */
html body.woocommerce-checkout .flux-step--details{display:flex!important;flex-direction:column!important}
html body.woocommerce-checkout .flux-step--details > *{order:5}
html body.woocommerce-checkout .flux-step--details > .flux-step__content{order:1}
html body.woocommerce-checkout .flux-step--details > :is(#wc-stripe-express-checkout-element,.wc-stripe-express-checkout-element,.flux-express-checkout-wrap,#wc-stripe-express-checkout-button-separator,.hm-co-express-or){order:2;margin-top:12px}
html body.woocommerce-checkout .flux-step--details > :is(.flux-footer,footer.flux-footer){order:8!important}

/* Pro bump / pack offer, when the live funnel is present: compact, after the email (script). Override HM-924 order:-1/-2. */
html body.woocommerce-checkout .flux-step__content > :is(#hm924-xb-co,.hm924-xb,.hm924-co-swap,#hm924-lic,.hm924-lic){order:2;margin:0 0 14px!important}
html body.woocommerce-checkout .flux-step__content > #billing_email_field{order:0}
html body.woocommerce-checkout :is(#hm924-xb-co,.hm924-xb){padding:10px 14px!important}
html body.woocommerce-checkout :is(#hm924-xb-co,.hm924-xb) .hm924-xb__h{margin:0 0 8px!important;font-size:14px!important;line-height:1.35!important}

/* Hide restored duplicate merchant cards (legacy theme prints more than one). */
html body.woocommerce-checkout [data-hmf-trust-dup]{display:none!important}


/* Consent, once moved after the email, stays readable and compact. */
html body.woocommerce-checkout .flux-step__content > :is(#hm-express-consent-gate,#hmf-gate-ph){order:3;margin:0 0 14px!important;padding:10px 14px!important;width:auto!important;max-width:none!important}
