/* v9.6.10 — phone dropdown containment, not a replacement form widget.
 * WPForms classic CSS sets overflow-x:hidden on select field wrappers below
 * 600px. That also computes overflow-y to auto and clips Nice Select's
 * absolutely positioned options, even when the widget has its .open class.
 * Release both axes only on dropdown fields. Never force a conditional field
 * to display, or alter the native select/value/required/disabled state.
 */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  html body .wpforms-container .wpforms-field-select,
  html body .wpforms-container .wpforms-field-payment-select {
    overflow: visible !important;
  }

  /* Raising only the option list cannot escape a lower stacking context. */
  html body .wpforms-container .wpforms-field:has(.nice-select.open),
  html body .wpforms-container .wpforms-field:has(.choices.is-open),
  html body .wpforms-container .wpforms-layout-column:has(.nice-select.open),
  html body .wpforms-container .wpforms-layout-column:has(.choices.is-open) {
    position: relative !important;
    overflow: visible !important;
    z-index: 110 !important;
  }

  /* Nice Select is used by both public forms and calculator controls.
   * Closed/disabled controls retain their widget's existing behavior. */
  html body .nice-select.open {
    overflow: visible !important;
    z-index: 120 !important;
  }

  html body .nice-select.open > .list,
  html body .wpforms-container .choices.is-open > .choices__list--dropdown {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 130 !important;
    max-height: min(280px, 42vh) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  html body .nice-select.open > .list > .option,
  html body .wpforms-container .choices.is-open .choices__item--choice,
  html body :is(#wpforms-form-37793#wpforms-form-37793, #wpforms-form-37820#wpforms-form-37820)
    .wpforms-field-select .nice-select[data-elika-primary-select="1"] .option {
    box-sizing: border-box !important;
    min-height: 44px !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    touch-action: pan-y;
  }
}
