
/*
 * Shine Commerce Loading Mode
 * Cart / Checkout / Order Pay / Order Received
 *
 * The commerce flow uses the theme's existing global page loader as the
 * single visual loading indicator. All secondary WooCommerce/theme
 * animation surfaces are intentionally neutralized here.
 */

/* Never animate the commerce UI itself. Keep the global page-loader spinner
 * untouched: that is the one approved loading animation for these pages. */
body.woocommerce-cart *,
body.woocommerce-checkout:not(.woocommerce-order-received) *,
body.woocommerce-order-received *,
body.woocommerce-order-pay * {
    transition: none !important;
    animation: none !important;
}

/* Remove motion caused by hover/focus/active transforms on commerce pages. */
body.woocommerce-cart *:hover,
body.woocommerce-cart *:active,
body.woocommerce-checkout:not(.woocommerce-order-received) *:hover,
body.woocommerce-checkout:not(.woocommerce-order-received) *:active,
body.woocommerce-order-received *:hover,
body.woocommerce-order-received *:active,
body.woocommerce-order-pay *:hover,
body.woocommerce-order-pay *:active {
    transition: none !important;
}

/* Theme button/item loaders are replaced by the global loader. */
body.woocommerce-cart .shine-btn-loader,
body.woocommerce-checkout .shine-btn-loader,
body.woocommerce-order-received .shine-btn-loader,
body.woocommerce-order-pay .shine-btn-loader,
body.woocommerce-cart .shine-cart-sync-placeholder,
body.woocommerce-cart .is-cart-busy::before,
body.woocommerce-cart .is-cart-busy::after {
    animation: none !important;
    display: none !important;
}

/* Do not leave WooCommerce's secondary spinner/block overlay visible.
 * The global Shine loader provides the single blocking/loading surface. */
body.woocommerce-checkout .blockUI.blockOverlay,
body.woocommerce-checkout .blockUI.blockMsg,
body.woocommerce-order-pay .blockUI.blockOverlay,
body.woocommerce-order-pay .blockUI.blockMsg,
body.woocommerce-cart .blockUI.blockOverlay,
body.woocommerce-cart .blockUI.blockMsg {
    animation: none !important;
    transition: none !important;
}

/* Hide only the visual WooCommerce overlay; keep the global loader as the
 * actual interaction blocker. */
body.woocommerce-checkout .blockUI.blockOverlay,
body.woocommerce-order-pay .blockUI.blockOverlay,
body.woocommerce-cart .blockUI.blockOverlay {
    opacity: 0 !important;
    background: transparent !important;
    pointer-events: none !important;
    backdrop-filter: none !important;
}

/* Theme page-progress is a second loading system. Commerce uses only the
 * global Shine page loader. */
body.woocommerce-cart #shine-page-progress,
body.woocommerce-checkout #shine-page-progress,
body.woocommerce-order-received #shine-page-progress,
body.woocommerce-order-pay #shine-page-progress {
    display: none !important;
}

/* Remove cart item reveal/removal motion and visual fading. */
body.woocommerce-cart .shine-cart-item.is-removing,
body.woocommerce-cart .shine-cart-layout.is-syncing .shine-cart-item,
body.woocommerce-cart .shine-cart-layout.is-syncing .shine-cart-summary,
body.woocommerce-cart .shine-cart-page .is-loading,
body.woocommerce-cart .shine-cart-empty,
body.woocommerce-cart .shine-cart-coupon-form {
    opacity: 1 !important;
    transform: none !important;
}

/* Checkout stage/address effects become immediate. */
body.woocommerce-checkout .shine-address-editor.is-open,
body.woocommerce-checkout .shine-checkout-stage,
body.woocommerce-checkout .shine-checkout-steps span,
body.woocommerce-checkout .shine-checkout-page *,
body.woocommerce-order-pay .shine-order-confirmation__button {
    transition: none !important;
    animation: none !important;
}

/* Keep the existing global loader above every commerce surface. */
body.woocommerce-cart #shine-page-loader,
body.woocommerce-checkout #shine-page-loader,
body.woocommerce-order-received #shine-page-loader,
body.woocommerce-order-pay #shine-page-loader {
    z-index: 2147483647 !important;
}

/* ROOT FIX: the global loader is the ONLY exception to commerce motion
 * suppression. The broad commerce reset above used `*`, which also matched
 * the loader's spinner and canceled its keyframes. Explicitly restore the
 * spinner animation with !important so it remains independent of all page
 * animation resets and prefers-reduced-motion rules. */
body.woocommerce-cart #shine-page-loader .shine-page-loader-spinner,
body.woocommerce-checkout #shine-page-loader .shine-page-loader-spinner,
body.woocommerce-order-received #shine-page-loader .shine-page-loader-spinner,
body.woocommerce-order-pay #shine-page-loader .shine-page-loader-spinner {
    animation-name: shineCommercePageLoaderSpin !important;
    animation-duration: .7s !important;
    animation-timing-function: linear !important;
    animation-iteration-count: infinite !important;
    animation-direction: normal !important;
    animation-fill-mode: none !important;
    animation-play-state: running !important;
    transform: rotate(0deg);
}

@keyframes shineCommercePageLoaderSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
