/* Aegean Villas Core v0.13.7 — robust site-wide MetForm popup stacking fix.
 *
 * Elementor sections that follow a Book Now form can overlap the visual area of
 * MetForm/React-Select dropdowns and Flatpickr calendars. On some Single Villa
 * layouts the popup remains visible, but the following section still wins hit
 * testing and steals clicks below the section border.
 */

/* JS adds these classes to the real Elementor ancestors of every MetForm. */
.avc-metform-layer,
.avc-metform-overflow,
.avc-metform-layer .elementor-widget-wrap,
.avc-metform-layer .elementor-widget-container,
.avc-metform-layer .mf-form-wrapper,
.avc-metform-layer .mf-input-wrapper,
.avc-metform-layer .mf-input-select,
.avc-metform-layer .mf-input-multiselect {
  overflow: visible !important;
}

/* Raise the whole form section above normal following Elementor content. */
.avc-metform-layer {
  position: relative !important;
  z-index: 2147481000 !important;
}

.avc-metform-layer .mf-form-wrapper {
  position: relative !important;
  z-index: 2147481100 !important;
}

.avc-metform-layer .mf-input-wrapper:focus-within,
.avc-metform-layer .mf-input-select:focus-within,
.avc-metform-layer .mf-input-multiselect:focus-within {
  position: relative !important;
  z-index: 2147481200 !important;
}

/* Target only the actual menu containers, never broad class* selectors because
 * those also match React-Select's internal menu-list and can hide options. */
.avc-metform-layer .mf_select__menu,
.avc-metform-layer .mf_multiselect__menu,
body .mf_select__menu,
body .mf_multiselect__menu {
  z-index: 2147483000 !important;
  pointer-events: auto !important;
}

/* Flatpickr may be rendered inside the form (static mode) or elsewhere in body. */
.avc-metform-layer .flatpickr-calendar,
body .flatpickr-calendar,
body .flatpickr-calendar.open {
  z-index: 2147483000 !important;
  pointer-events: auto !important;
}

/* v0.13.7: while a form popup is actually open, JS marks ONLY later siblings
 * that can physically cover the overflow area. Temporarily make those layers
 * transparent to mouse/touch hit testing, so clicks reach the visible popup
 * underneath. Classes are removed immediately when the popup closes. */
.avc-metform-pass-through,
.avc-metform-pass-through * {
  pointer-events: none !important;
}

/* CSS-only fallback for modern browsers if JS is delayed. */
.elementor-top-section:has(.mf-form-wrapper),
.e-con.e-parent:has(.mf-form-wrapper) {
  position: relative !important;
  z-index: 2147481000 !important;
  overflow: visible !important;
}
