/* V40: Definitive one-column, full-width mobile public CTA layout.
   Direct selectors and :has() are the no-JavaScript path. JS class is fallback for saved CMS markup.
   Excludes menus, pricing selectors, footer, cookie controls and admin. */
@media screen and (max-width: 767px) {
  /* Applies when the immediate element children are two or more CTAs, regardless
     of inline grid-template-columns, display:grid or display:flex. */
  body :is(div,section,p).hl-cta-stack-v40,
  body :is(div,section,p):has(> a.btn ~ a.btn),
  body :is(div,section,p):has(> a.btn ~ a.btn2),
  body :is(div,section,p):has(> a.btn2 ~ a.btn),
  body :is(div,section,p):has(> a.btn2 ~ a.btn2),
  body :is(div,section,p):has(> a.btn ~ a.helprite-whatsapp),
  body :is(div,section,p):has(> a.btn2 ~ a.helprite-whatsapp),
  body :is(div,section,p):has(> a.y ~ a.g),
  body :is(div,section,p):has(> a.g ~ a.y) {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    grid-template-columns: minmax(0,1fr) !important;
    grid-auto-flow: row !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  /* Mobile CTA buttons: full column width even if earlier stylesheet gives
     each button 50% flex-basis or an inline width. */
  body a.hl-fullwidth-cta-v40,
  body button.hl-fullwidth-cta-v40,
  body .hl-cta-stack-v40 > :is(a.btn,a.btn2,a.y,a.g,a.helprite-whatsapp,button.btn,button.btn2,button[type=submit]),
  body .hl-home-actions-v12 > :is(a.btn,a.btn2),
  body .hl-about-cta-actions > :is(a.btn,a.btn2),
  body .hl-mobile-cta-pair-v38 > :is(a.btn,a.btn2),
  body .hl-mobile-full-group-v39 > :is(a.btn,a.btn2) {
    display: flex !important;
    flex: 0 0 auto !important;
    align-self: stretch !important;
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    height: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 13px 16px !important;
    box-sizing: border-box !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    line-height: 1.4 !important;
    text-align: center !important;
    border-radius: 8px !important;
  }
  body :is(.hl-cta-stack-v40,.hl-home-actions-v12,.hl-about-cta-actions,.hl-mobile-cta-pair-v38,.hl-mobile-full-group-v39) > :is(a.btn,a.btn2,a.helprite-whatsapp,a.y,a.g,button.btn,button.btn2) {
    display: flex !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-column: 1/-1 !important;
  }
  body .hl-fullwidth-cta-v40 .hl-btn-label-v38,
  body .hl-fullwidth-cta-v40 .hl-btn-label-v40 {
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 0 1 auto !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    text-align: center !important;
  }
  body .hl-fullwidth-cta-v40 :is(.laundry-button-icon,svg,i.fa) {
    flex-shrink: 0 !important;
    margin: 0 !important;
  }
  /* Keep pricing pills, mobile navigation and footer controls untouched. */
  body :is(header,nav,footer,.site-mobile-nav,.pricing-tabs,.price-tabs,[role=tablist],.cookie-consent) :is(a.btn,a.btn2) {
    width: auto;
  }
}
