/* =========================================================
   Green Upshot Offer Popup Actions v1.4.1
   Portable PK/NZ viewport + popup action fixes.
   ========================================================= */

.gu-offer-popup-active .gu-coupon-reveal[hidden] { display: none !important; }
.gu-offer-popup-active.is-complete .gu-before-success,
.gu-offer-content.is-complete .gu-before-success,
.gu-offer-right.is-complete .gu-before-success,
.gu-offer-popup-active.is-complete .elementor-message { display: none !important; }
.gu-offer-popup-active.is-complete .gu-coupon-reveal,
.gu-offer-content.is-complete .gu-coupon-reveal,
.gu-offer-right.is-complete .gu-coupon-reveal { display: block !important; }

.gu-coupon-reveal { width: 100%; text-align: center; font-family: "Plus Jakarta Sans", sans-serif; }
.gu-success-mark { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 50%; background: #79aa97; color: #fff; font-size: 23px; font-weight: 700; }
.gu-coupon-kicker { margin: 0 0 6px; color: #315b49; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.gu-coupon-reveal h3 { margin: 0 0 10px; color: #080b09; font-size: 29px; line-height: 1.05; }
.gu-coupon-note { margin: 0 0 15px; color: #626b66; font-size: 14px; }
.gu-code-row { display: flex; align-items: stretch; width: 100%; border: 1px solid #056983; }
.gu-coupon-code { display: flex; flex: 1; align-items: center; justify-content: center; min-width: 0; padding: 14px 17px; background: #f4f8f5; color: #056983; font-size: 20px; letter-spacing: .14em; }
.gu-copy-coupon { flex: 0 0 auto; border: 0 !important; border-left: 1px solid #056983 !important; border-radius: 0 !important; background: #056983 !important; color: #fff !important; padding: 0 18px !important; cursor: pointer; }
.gu-copy-status { min-height: 16px; margin: 8px 0 0; color: #056983; font-size: 12px; }

/* ---------------------------------------------------------
   CRITICAL VIEWPORT FIX — DESKTOP, TABLET AND MOBILE
   Elementor can append popup markup after the footer. These
   selectors pin only this offer popup to the browser viewport
   before JavaScript has to do anything.
   --------------------------------------------------------- */
html body .elementor-popup-modal.gu-offer-popup-active,
html body .elementor-popup-modal:has(.gu-offer-popup-shell),
html body .elementor-popup-modal:has(.gu-offer-form) {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 999999 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 24px !important;
    overflow: hidden !important;
    background: rgba(9, 13, 11, .68) !important;
    backdrop-filter: blur(1.5px) !important;
    -webkit-backdrop-filter: blur(1.5px) !important;
}

/* Do NOT force display:flex on the modal itself. Elementor uses display:none
   to close it. Centring the content absolutely avoids the stuck-overlay bug. */
html body .elementor-popup-modal.gu-offer-popup-active .dialog-widget-content,
html body .elementor-popup-modal:has(.gu-offer-popup-shell) .dialog-widget-content,
html body .elementor-popup-modal:has(.gu-offer-form) .dialog-widget-content {
    position: absolute !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    width: 780px !important;
    max-width: calc(100vw - 48px) !important;
    max-height: calc(100dvh - 48px) !important;
    margin: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: 0 18px 55px rgba(0, 0, 0, .34) !important;
    transform: translate(-50%, -50%) !important;
}

html body .elementor-popup-modal.gu-offer-popup-active .dialog-message,
html body .elementor-popup-modal:has(.gu-offer-popup-shell) .dialog-message,
html body .elementor-popup-modal:has(.gu-offer-form) .dialog-message {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 48px) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
}

html body .elementor-popup-modal.gu-offer-popup-active .gu-offer-popup-shell,
html body .elementor-popup-modal.gu-offer-popup-active .gu-offer-popup-shell > .elementor-container,
html body .elementor-popup-modal.gu-offer-popup-active .gu-offer-popup-shell > .e-con-inner,
html body .elementor-popup-modal:has(.gu-offer-popup-shell) .gu-offer-popup-shell,
html body .elementor-popup-modal:has(.gu-offer-popup-shell) .gu-offer-popup-shell > .elementor-container,
html body .elementor-popup-modal:has(.gu-offer-popup-shell) .gu-offer-popup-shell > .e-con-inner {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.gu-offer-popup-active .gu-offer-popup-shell { overflow: hidden !important; background: #fff !important; }
.gu-offer-popup-active .gu-offer-image-column { background-position: center !important; background-size: cover !important; }
.gu-offer-popup-active .gu-offer-right > .elementor-widget-wrap,
.gu-offer-popup-active .gu-offer-content > .elementor-widget-wrap,
.gu-offer-popup-active .gu-offer-content > .e-con-inner { align-content: center !important; }
.gu-offer-popup-active .gu-offer-kicker,
.gu-offer-popup-active .gu-offer-title,
.gu-offer-popup-active .gu-offer-description { margin-bottom: 0 !important; }
.gu-offer-popup-active .gu-offer-description p { margin: 0 !important; }
.gu-offer-popup-active .gu-offer-form .elementor-field-group { margin-bottom: 10px !important; }
.gu-offer-popup-active .gu-offer-form input[type="email"] { min-height: 50px !important; }
.gu-offer-popup-active .gu-offer-form .elementor-button { width: 100% !important; min-height: 54px !important; justify-content: center !important; }
.gu-offer-popup-active .gu-no-thanks-wrap { margin-top: 16px !important; text-align: center !important; }
.gu-offer-popup-active .gu-no-thanks { appearance: none; border: 0 !important; background: transparent !important; color: #a19791 !important; padding: 7px 12px !important; cursor: pointer; }
.gu-offer-popup-active .dialog-close-button { z-index: 30 !important; top: 12px !important; right: 12px !important; }

/* Match the Elementor popup width used by the shared PK/NZ template. */
@media (min-width: 768px) and (max-width: 1024px) {
    html body .elementor-popup-modal.gu-offer-popup-active .dialog-widget-content,
    html body .elementor-popup-modal:has(.gu-offer-popup-shell) .dialog-widget-content,
    html body .elementor-popup-modal:has(.gu-offer-form) .dialog-widget-content {
        width: 700px !important;
        max-width: calc(100vw - 48px) !important;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 767px) {
    html body .elementor-popup-modal.gu-offer-popup-active,
    html body .elementor-popup-modal:has(.gu-offer-popup-shell),
    html body .elementor-popup-modal:has(.gu-offer-form) {
        padding: 17px !important;
    }

    html body .elementor-popup-modal.gu-offer-popup-active .dialog-widget-content,
    html body .elementor-popup-modal:has(.gu-offer-popup-shell) .dialog-widget-content,
    html body .elementor-popup-modal:has(.gu-offer-form) .dialog-widget-content {
        width: calc(100vw - 34px) !important;
        max-width: 390px !important;
        max-height: calc(100dvh - 34px) !important;
        border-radius: 7px !important;
    }

    html body .elementor-popup-modal.gu-offer-popup-active .dialog-message,
    html body .elementor-popup-modal:has(.gu-offer-popup-shell) .dialog-message,
    html body .elementor-popup-modal:has(.gu-offer-form) .dialog-message,
    body .gu-offer-popup-active .elementor,
    body .gu-offer-popup-active .elementor-inner,
    body .gu-offer-popup-active .elementor-section-wrap,
    body .gu-offer-popup-active .gu-offer-popup-shell,
    body .gu-offer-popup-active .gu-offer-popup-shell > .elementor-container,
    body .gu-offer-popup-active .gu-offer-popup-shell > .e-con-inner {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        background: #fff !important;
    }

    body .gu-offer-popup-active .dialog-message {
        max-height: calc(100dvh - 34px) !important;
        overflow-y: auto !important;
    }

    body .gu-offer-popup-active .gu-offer-popup-shell { min-height: 0 !important; height: auto !important; box-shadow: none !important; }

    body .gu-offer-popup-active .gu-offer-mobile-hidden,
    body .gu-offer-popup-active .gu-offer-image-column,
    body .gu-offer-popup-active .gu-image-placeholder {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body .gu-offer-popup-active .gu-offer-content,
    body .gu-offer-popup-active .gu-offer-right {
        display: flex !important;
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: min(68vh, 535px) !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    body .gu-offer-popup-active .gu-offer-content > .elementor-widget-wrap,
    body .gu-offer-popup-active .gu-offer-right > .elementor-widget-wrap,
    body .gu-offer-popup-active .gu-offer-content > .e-con-inner,
    body .gu-offer-popup-active .gu-offer-right > .e-con-inner {
        display: flex !important;
        align-content: center !important;
        justify-content: center !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 66px 28px 48px !important;
        overflow: hidden !important;
        background: #fff !important;
    }

    body .gu-offer-popup-active .gu-offer-content .elementor-element,
    body .gu-offer-popup-active .gu-offer-right .elementor-element,
    body .gu-offer-popup-active .gu-offer-content .elementor-widget-container,
    body .gu-offer-popup-active .gu-offer-right .elementor-widget-container,
    body .gu-offer-popup-active .gu-offer-content form,
    body .gu-offer-popup-active .gu-offer-right form,
    body .gu-offer-popup-active .gu-offer-content .elementor-form-fields-wrapper,
    body .gu-offer-popup-active .gu-offer-right .elementor-form-fields-wrapper,
    body .gu-offer-popup-active .gu-offer-content .elementor-field-group,
    body .gu-offer-popup-active .gu-offer-right .elementor-field-group {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    body .gu-offer-popup-active .gu-offer-title .elementor-heading-title { font-size: 30px !important; line-height: 1.03 !important; }
    body .gu-offer-popup-active .gu-offer-description { margin: 10px 0 26px !important; }
    body .gu-offer-popup-active .gu-offer-description p { font-size: 15px !important; line-height: 1.4 !important; }
    body .gu-offer-popup-active .gu-offer-description br { display: none !important; }
    body .gu-offer-popup-active .gu-offer-form input[type="email"] { width: 100% !important; max-width: 100% !important; min-height: 55px !important; padding: 14px 16px !important; }
    body .gu-offer-popup-active .gu-offer-form .elementor-button { width: 100% !important; max-width: 100% !important; min-height: 57px !important; justify-content: center !important; }
    body .gu-offer-popup-active .gu-no-thanks-wrap { margin-top: 22px !important; }
    body .gu-offer-popup-active .gu-code-row { width: 100% !important; min-width: 0 !important; }
    body .gu-offer-popup-active .gu-coupon-code { min-width: 0 !important; padding: 14px 10px !important; font-size: 17px !important; }
    body .gu-offer-popup-active .gu-copy-coupon { flex: 0 0 auto !important; padding: 0 13px !important; }

    body .gu-offer-popup-active .dialog-close-button,
    body .elementor-popup-modal:has(.gu-offer-popup-shell) .dialog-close-button,
    body .elementor-popup-modal:has(.gu-offer-form) .dialog-close-button {
        position: absolute !important;
        z-index: 30 !important;
        top: 14px !important;
        right: 14px !important;
        width: 32px !important;
        height: 32px !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: #303936 !important;
        font-size: 27px !important;
    }
}

@media (max-width: 360px), (max-height: 650px) {
    body .gu-offer-popup-active .gu-offer-content,
    body .gu-offer-popup-active .gu-offer-right { min-height: 0 !important; }
    body .gu-offer-popup-active .gu-offer-content > .elementor-widget-wrap,
    body .gu-offer-popup-active .gu-offer-right > .elementor-widget-wrap,
    body .gu-offer-popup-active .gu-offer-content > .e-con-inner,
    body .gu-offer-popup-active .gu-offer-right > .e-con-inner { padding: 56px 20px 36px !important; }
    body .gu-offer-popup-active .gu-offer-description { margin-bottom: 19px !important; }
    body .gu-offer-popup-active .gu-no-thanks-wrap { margin-top: 16px !important; }
}
