/* Whop By Shozi v1.7 Gen4 — bridge-iframe checkout CSS. Scoped selectors only. */

.whopy-v484-container,
.whopy-v484-wrapper,
.whopy-v483-container,
.whopy-v483-wrapper .whopy-v483-mount-host {
    margin-top: 16px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    min-height: 520px;
    position: relative;
}

.whopy-v484-loader,
.whopy-v483-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #64748b;
}

.whopy-v484-loader::after,
.whopy-v483-loader::after {
    content: "";
    width: 22px;
    height: 22px;
    margin-left: 10px;
    border: 3px solid #cbd5e1;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: whopy-v484-spin 1s linear infinite;
}

@keyframes whopy-v484-spin {
    to { transform: rotate(360deg); }
}

.whopy-v484-bridge-frame {
    display: block !important;
    width: 100% !important;
    min-height: 620px !important;
    height: 620px;
    border: 0 !important;
    background: #ffffff;
}

.whopy-v484-status,
.whopy-v483-status {
    margin: 12px 0 0;
    text-align: center;
    font-size: 14px;
    color: #64748b;
}

.whopy-v484-status--error,
.whopy-v483-status--error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 12px;
    border-radius: 8px;
}

.whopy-v484-pay-status {
    margin: 10px 2px 0;
    padding: 0 4px 10px;
    font-size: 14px;
    min-height: 18px;
}

.whopy-v484-pay-status.is-error { color: #dc2626; }
.whopy-v484-pay-status.is-info { color: #059669; }
.whopy-v484-pay-status.is-success { color: #059669; font-weight: 600; }

body.whopy-v484-active .wc-block-components-checkout-place-order-button,
body.whopy-v483-active .wc-block-components-checkout-place-order-button {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.payment_method_whop label img {
    max-height: 24px;
    margin-left: 10px;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .whopy-v484-container,
    .whopy-v484-wrapper,
    .whopy-v484-bridge-frame {
        min-height: 680px !important;
        height: 680px;
    }
}

/* Hide WooCommerce phone field even when a theme/plugin prints it after PHP filters. */
#billing_phone_field,
.woocommerce-billing-fields #billing_phone_field,
.whopy-hidden-phone-field {
    display: none !important;
}

/* v1.2 Gen4 polish */
.payment_method_whop>label{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap}.payment_method_whop>label img{max-height:30px!important;width:auto!important;margin-left:auto!important}.whopy-v484-container,.whopy-v484-wrapper{box-shadow:0 8px 28px rgba(15,23,42,.06);border-color:#e5e7eb}.whopy-v484-pay-status.is-info{color:#475569}.whopy-v484-pay-status.is-success{color:#047857}

/* v1.3 Gen4 — checkout-requirement interaction guard. */
.whopy-v484-frame-shell {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #fff;
}

.whopy-v484-frame-shell.is-billing-locked .whopy-v484-bridge-frame {
    pointer-events: none !important;
    user-select: none !important;
}

.whopy-v484-billing-guard[hidden],
.whopy-v484-pay-status[hidden] {
    display: none !important;
}

.whopy-v484-billing-guard {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    background: rgba(255,255,255,.58);
    -webkit-backdrop-filter: blur(.8px);
    backdrop-filter: blur(.8px);
    cursor: pointer;
    box-sizing: border-box;
}

.whopy-v484-billing-guard-card {
    width: min(92%, 520px);
    padding: 20px 22px;
    border: 1px solid rgba(15,23,42,.13);
    border-radius: 14px;
    background: rgba(255,255,255,.90);
    box-shadow: 0 14px 38px rgba(15,23,42,.14);
    text-align: center;
    color: #0f172a;
}

.whopy-v484-billing-guard-title {
    font-size: 19px;
    line-height: 1.35;
    font-weight: 750;
    letter-spacing: -.01em;
}

.whopy-v484-billing-guard-list {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 600;
    color: #475569;
}

/* v1.3 keeps normal checkout quiet: loader is spinner-only. */
.whopy-v484-loader {
    min-height: 120px;
    gap: 0;
}
.whopy-v484-loader::after {
    margin-left: 0 !important;
}

@media (max-width: 600px) {
    .whopy-v484-billing-guard {
        padding: 20px 14px;
    }
    .whopy-v484-billing-guard-card {
        padding: 18px 16px;
    }
    .whopy-v484-billing-guard-title {
        font-size: 18px;
    }
    .whopy-v484-billing-guard-list {
        font-size: 15px;
    }
}


/* v1.4 Gen4 — never present an empty payment area while Woo fragments initialise. */
.payment_method_whop .whopy-v484-container:empty::before {
    content: "";
    display: block;
    width: 22px;
    height: 22px;
    position: absolute;
    top: 42px;
    left: calc(50% - 11px);
    border: 3px solid #cbd5e1;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: whopy-v484-spin 1s linear infinite;
}

/*
 * v1.7 Gen4 — mobile gateway-box growth fix.
 *
 * IMPORTANT: the Whop iframe sizing logic remains the proven v1.4 logic.
 * The bug was the OUTER Whop container: the older mobile rule gave the
 * container/wrapper a fixed 680px height while overflow:hidden was enabled.
 * When the iframe grew after Whop revealed additional billing-address fields,
 * the parent stayed 680px tall and visually clipped the lower checkout area.
 *
 * Keep the parent automatic, let it follow the iframe's real height, and keep
 * permanent blank reserve INSIDE the selected Whop gateway box before the next
 * gateway begins.
 */
.whopy-v484-container,
.whopy-v484-wrapper {
    height: auto !important;
    min-height: 620px !important;
    padding-bottom: 96px !important;
    box-sizing: border-box !important;
}

/* The reserve is intentionally part of the rounded Whop box, not margin after it. */
.whopy-v484-container::after,
.whopy-v484-wrapper::after {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    clear: both;
}

@media (max-width: 600px) {
    .whopy-v484-container,
    .whopy-v484-wrapper {
        height: auto !important;
        min-height: 680px !important;
        padding-bottom: 170px !important;
    }

    /* Keep v1.4 iframe behavior. JS can still increase this inline as Whop grows. */
    .whopy-v484-bridge-frame {
        min-height: 680px !important;
    }
}
