/* Standalone booking embeds. Every selector stays inside this plugin. */
.power-booking-iframes {
    position: relative;
    z-index: var(--pbi-desktop-z, 1000);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    min-height: var(--pbi-desktop-area-height, 0px);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: var(--pbi-desktop-bg, #fff);
}

.power-booking-iframes .power-booking-iframes__stage {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: min(100%, var(--pbi-desktop-width, 100%));
    max-width: 100%;
    flex: 0 1 auto;
    min-width: 0;
    transform: translate(var(--pbi-x, 0px), var(--pbi-y, 0px));
    margin: 0;
    padding: 0;
    overflow: visible;
}

.power-booking-iframes .power-booking-iframes__frame {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

/* fitvidsignore prevents supported FitVids versions wrapping the frame.
 * If Divi wraps it anyway, discard its video ratio and use the explicit
 * booking height. This avoids the blank video-wrapper strip seen before. */
.power-booking-iframes .power-booking-iframes__stage > .fluid-width-video-wrapper {
    position: absolute !important;
    inset: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.power-booking-iframes .power-booking-iframes__fallback {
    margin: 0;
    padding: 12px 8px;
}

@media (min-width: 768px) {
    .power-booking-iframes.pbi-h-left { justify-content: flex-start; }
    .power-booking-iframes.pbi-h-center { justify-content: center; }
    .power-booking-iframes.pbi-h-right { justify-content: flex-end; }
    .power-booking-iframes.pbi-v-top { align-items: flex-start; }
    .power-booking-iframes.pbi-v-center { align-items: center; }
    .power-booking-iframes.pbi-v-bottom { align-items: flex-end; }
}

@media (max-width: 767px) {
    .power-booking-iframes {
        display: block;
        z-index: var(--pbi-mobile-z, 1000);
        min-height: 0;
        background: var(--pbi-mobile-bg, #fff);
    }
    .power-booking-iframes .power-booking-iframes__stage {
        transform: none;
        max-width: none;
        flex: none;
    }
    .power-booking-iframes .power-booking-iframes__stage {
        width: calc(100% - 16px);
        margin: 0 auto 10px;
    }
}

/* Divi stacking/overflow compatibility (v1.2.1).
 * Raising the iframe alone cannot escape an overflow-clipped Divi row/column,
 * nor can its z-index escape an ancestor stacking context. Limit the rules to
 * Divi layout containers that actually contain this booking shortcode.
 * Keep existing component dimensions, positions and clipping compensation.
 */
.et_pb_section:has(.power-booking-iframes),
.et_pb_row:has(.power-booking-iframes),
.et_pb_column:has(.power-booking-iframes),
.et_pb_module:has(.power-booking-iframes),
.et_pb_code_inner:has(.power-booking-iframes),
.et_pb_text_inner:has(.power-booking-iframes) {
    overflow: visible !important;
}

/* Raise the ancestor stacking contexts only while a user is interacting
 * with a booking form. This avoids permanently covering neighboring sections. */
.et_pb_section:has(.power-booking-iframes:focus-within),
.et_pb_row:has(.power-booking-iframes:focus-within),
.et_pb_column:has(.power-booking-iframes:focus-within),
.et_pb_module:has(.power-booking-iframes:focus-within) {
    position: relative;
    z-index: 1000000 !important;
}

/* v1.2.2: Keep the desktop Assalaam date popup above neighboring page content.
 * The short booking stage is no longer clipped; only the unused horizontal
 * portion of the wide iframe is cropped by JavaScript. Mobile is unchanged.
 * This targets containers that actually hold this specific desktop widget. */
@media (min-width: 768px) {
    .et_pb_section:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]),
    .et_pb_row:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]),
    .et_pb_column:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]),
    .et_pb_module:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]),
    .et_pb_code_inner:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]),
    .et_pb_text_inner:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]) {
        overflow: visible !important;
        clip-path: none !important;
        -webkit-clip-path: none !important;
    }
    /* v1.2.3: The Destinations image lives in a competing Divi stacking
     * context. The previous z-index:100 on these parents could not lift the
     * booking calendar above an image/module with a higher stacking order.
     * Raise ONLY the ancestors of the desktop Assalaam booking widget,
     * including the immediate Divi Code/Text wrapper, and leave all other
     * page images, sections and mobile layouts unchanged. The parent must be
     * raised; a large z-index on the iframe child alone cannot escape it. */
    .et_pb_section:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]),
    .et_pb_row:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]),
    .et_pb_column:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]),
    .et_pb_module:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]),
    .et_pb_code_inner:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]),
    .et_pb_text_inner:has(.power-booking-iframes[data-pbi-calendar-layout="assalaam"]) {
        position: relative !important;
        z-index: 10000000 !important;
        overflow: visible !important;
        clip-path: none !important;
        -webkit-clip-path: none !important;
    }
}
