/* One responsive contract for shared buttons and explicitly identified CTAs. */
:root :is(a, button)[data-cta] {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

:root :is(a, button)[data-cta]:focus-visible {
  outline: 2px solid #d8b4fe;
  outline-offset: 4px;
}

@media (max-width: 767px), (pointer: coarse) {
  :root a[aria-label],
  :root [data-touch-link] {
    min-width: 44px;
    min-height: 44px;
  }

  :root [data-touch-link] {
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
    line-height: 1.4;
  }
  :root [data-ui-button]:where(:not([data-button-size="icon"])),
  :root :is(a, button)[data-cta] {
    min-height: 48px;
    height: auto;
    font-size: 1rem;
    line-height: 1.4;
  }

  :root :is(a, button)[data-cta] > svg,
  :root [data-ui-button] > svg {
    flex-shrink: 0;
  }
}

@media (max-width: 767px) {
  :root [data-ui-button]:where(:not([data-button-size="icon"])) {
    min-height: 52px;
    padding: 12px 16px;
  }

  :root :is(a, button)[data-cta] {
    display: inline-flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    text-align: center;
  }

  /* Full-width actions need to wrap in their existing flex rows. */
  :root :where(div, section, form):has(> [data-cta]) {
    flex-wrap: wrap;
    min-width: 0;
  }

  :root :is(a, button)[data-cta].home-cta-link {
    justify-content: space-between;
    padding: 10px 12px 10px 18px;
  }

  :root :is(a, button)[data-cta] .home-cta-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  :root :is(a, button)[data-cta] > span:not(.home-cta-icon) {
    min-width: 0;
  }

  :root .product-enquiry [data-cta] {
    flex-shrink: 1;
  }

  /* Keep the duplicate enquiry action from displacing the product section tabs. */
  :root .product-section-nav .product-nav-enquiry[data-cta] {
    display: none;
  }

  /* Saved campaign HTML uses both Tailwind classes and inline email styles. */
  :root .cms-page-content :is(a, button)[data-cta],
  :root .cms-page-content :is(a, button):is([class*="inline-flex"], [class*="inline-block"], [style*="inline-block"], [style*="padding"]),
  :root [data-mobile-typography] :is(.primary-cta, .header-cta, .scroll-cue) {
    display: inline-flex;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 52px;
    height: auto;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px !important;
    font-size: 1rem !important;
    line-height: 1.4 !important;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    box-sizing: border-box;
  }

  :root [data-mobile-typography] .effect-button {
    min-width: 44px;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 1rem;
    line-height: 1.4;
    white-space: normal;
  }

  :root .cms-page-content :where(div, td):has(> a:is([style*="inline-block"], [class*="inline-flex"])) {
    flex-wrap: wrap;
  }

  /* Legacy button classes can arrive without their original document-head CSS. */
  :root .cms-page-content :is(a, button):is(.cta-button, .btn-primary, .btn--primary, .btn, .glass-button) {
    display: inline-flex;
    min-width: 0;
    max-width: 100%;
    min-height: 52px;
    height: auto;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid rgba(216, 180, 254, .3);
    border-radius: 999px;
    background-color: #7042d2;
    color: #fff;
    font-size: 1rem;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }
}

@media (hover: none) {
  :root :is(a, button)[data-cta]:hover {
    transform: none;
  }
}
