@mixin cfw-shimmer-content( $top_bottom_margin: 0, $top: 0 ) {
    position: relative !important;
    pointer-events: none;

    > * {
        visibility: var(--cfw-blocked-visibility, hidden);
    }

    &:after {
        content: " ";
        position: absolute;
        top: #{$top};
        margin: #{$top_bottom_margin} 0;
        right: 0;
        left: 0;
        bottom: 0;
        background: var(--cfw-loading-shimmer-gradient);
        background-size: 1000px 100%;
        border-radius: 5px;
        animation: cfw-shimmer 1s infinite linear;
        display: var(--cfw-loading-shimmer-display-mode);
        backdrop-filter: var(--cfw-loading-shimmer-filter);
        z-index: 10000;
        will-change: transform;
        transform: translate3d(0,0,0); // Force GPU acceleration
    }
}

@keyframes cfw-shimmer {
    0% {
        background-position: -500px 0;
    }
    100% {
        background-position: 500px 0;
    }
}

.cfw-review-pane.cfw-blocked {
    // Review pane
    .inner {
        @include cfw-shimmer-content( 0.75em );
    }

    .cfw-review-pane-link a {
        @include cfw-shimmer-content();
    }

    .cfw-review-pane-content > * {
        @include cfw-shimmer-content();
    }
}

#cfw-cart-summary.cfw-blocked, #cfw-mobile-cart-summary.cfw-blocked {
    .cfw-cart-item-quantity-bubble {
        display: var(--cfw-loading-shimmer-cart-item-quantity-display-mode);
    }

    .cfw-cart-edit-item-variation,
    .cfw-cart-item-image-wrap,
    .cfw-edit-item-quantity-control-wrap,
    .cfw-cart-item-subtotal span,
    .cfw-cart-item-data,
    .cfw-items-summary-item-discount,
    .cfw-promo-row > div > *,
    .cfw-show-coupons-module {
        @include cfw-shimmer-content();
    }

    .cfw-cart-item-title {
        @include cfw-shimmer-content( -2px );
    }

    .cfw-totals-list {
        tr {
            @include cfw-shimmer-content( 0.75em );
        }

        tr.order-total {
            border-color: var(--cfw-loading-shimmer-primary-color);
        }
    }
}

#cfw-shipping-packages-container.cfw-blocked {
    .cfw-shipping-method-inner {
        @include cfw-shimmer-content();
    }
}

#cfw-billing-methods.cfw-blocked {
    .payment_method_icons {
        display: none;
    }

    .cfw-radio-reveal-title-wrap .cfw-radio-reveal-label div, .cfw-radio-reveal-content > * {
        @include cfw-shimmer-content( -2px );
    }
}

#cfw-place-order.cfw-blocked button {
    border: none;
    @include cfw-shimmer-content();
}

.cfw-next-tab.cfw-blocked {
    border: none;
    @include cfw-shimmer-content();
}

#cfw-payment-request-buttons.cfw-blocked {
    > div:not(.wc-stripe-banner-checkout),
    button,
    > #checkout_paypal_message,
    > #wc-stripe-payment-request-wrapper,
    ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway {
        @include cfw-shimmer-content();
    }
}

#cfw-mobile-total.cfw-blocked {
    @include cfw-shimmer-content();
}

.cfw-order-bumps.cfw-blocked {
    .cfw-order-bump-header label, .cfw-order-bump-image, .cfw-order-bump-content {
        @include cfw-shimmer-content();
    }
}