body:not(.wp-admin) {
    --gentleland-loading-curtain:
        linear-gradient(145deg,
            rgba(255, 248, 207, .82) 0%,
            rgba(245, 217, 127, .70) 24%,
            rgba(215, 164, 68, .58) 50%,
            rgba(255, 233, 157, .68) 66%,
            rgba(181, 120, 41, .60) 100%);
}

body:not(.wp-admin) :is([data-fluent-cart-cart-drawer], .fct-cart-drawer) > .fct-loader-wrap,
body:not(.wp-admin) :is([data-fluent-cart-cart-drawer], .fct-cart-drawer) > [data-fluent-cart-cart-drawer-loader] {
    z-index: 2147483000 !important;
    pointer-events: none !important;
    cursor: wait !important;
    opacity: 0 !important;
    background: var(--gentleland-loading-curtain) !important;
    -webkit-backdrop-filter: blur(3px) saturate(.88) !important;
    backdrop-filter: blur(3px) saturate(.88) !important;
    transition: opacity 150ms ease !important;
}

body:not(.wp-admin) :is([data-fluent-cart-cart-drawer], .fct-cart-drawer) > .fct-loader-wrap.show,
body:not(.wp-admin) :is([data-fluent-cart-cart-drawer], .fct-cart-drawer) > [data-fluent-cart-cart-drawer-loader].show {
    display: flex !important;
    pointer-events: all !important;
    opacity: 1 !important;
}

body:not(.wp-admin) :is([data-fluent-cart-cart-drawer], .fct-cart-drawer)[data-gentleland-cart-busy="true"] > :not(.fct-loader-wrap):not([data-fluent-cart-cart-drawer-loader]),
body:not(.wp-admin) :is([data-fluent-cart-cart-drawer], .fct-cart-drawer):has(> .fct-loader-wrap.show) > :not(.fct-loader-wrap):not([data-fluent-cart-cart-drawer-loader]) {
    pointer-events: none !important;
    user-select: none !important;
}

body:not(.wp-admin) :is([data-fluent-cart-cart-drawer], .fct-cart-drawer)[data-gentleland-cart-busy="true"] :is(button, a, input),
body:not(.wp-admin) :is([data-fluent-cart-cart-drawer], .fct-cart-drawer):has(> .fct-loader-wrap.show) :is(button, a, input) {
    cursor: wait !important;
    transform: none !important;
    filter: none !important;
}

/* Metallic FluentPlayer-inspired loading rings. */
body:not(.wp-admin) .fluent-cart-add-to-cart-button > .fluent-cart-loader,
body:not(.wp-admin) .fct-product-view-button > .fluent-cart-loader {
    box-sizing: border-box !important;
    border-radius: inherit !important;
    background:
        var(--gentleland-loading-curtain),
        linear-gradient(to bottom, #fffaf0 0%, #f8efdf 48%, #edddc5 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .82),
        inset 0 -1px 0 rgba(142, 92, 34, .22) !important;
    -webkit-backdrop-filter: blur(2px) saturate(.90) !important;
    backdrop-filter: blur(2px) saturate(.90) !important;
}

body:not(.wp-admin) .fct-loader-spinner {
    position: relative !important;
    width: 54px !important;
    height: 54px !important;
    flex: 0 0 54px !important;
    border-radius: 50% !important;
    filter: drop-shadow(0 2px 4px rgba(113, 68, 23, .28)) drop-shadow(0 0 8px rgba(255, 233, 157, .28)) !important;
}

body:not(.wp-admin) .fct-loader-spinner::before,
body:not(.wp-admin) .fct-loader-spinner::after {
    content: "" !important;
    position: absolute !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: conic-gradient(
        from 15deg,
        transparent 0deg,
        #fff8cf 34deg,
        #f5d97f 82deg,
        #d7a444 142deg,
        #ffe99d 205deg,
        #c98b32 266deg,
        #89551e 322deg,
        transparent 360deg
    ) !important;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
    -webkit-mask-composite: xor !important;
    mask-composite: exclude !important;
    box-sizing: border-box !important;
}

body:not(.wp-admin) .fct-loader-spinner::before {
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    padding: 4px !important;
    animation: fluentCartSpin 920ms linear infinite !important;
}

body:not(.wp-admin) .fct-loader-spinner::after {
    inset: 8px !important;
    width: auto !important;
    height: auto !important;
    padding: 2px !important;
    opacity: .78 !important;
    transform: none !important;
    animation: gentlelandGoldSpinReverse 1300ms linear infinite !important;
}

@keyframes gentlelandGoldSpinReverse {
    to { transform: rotate(-360deg); }
}

body:not(.wp-admin) .fluent-cart-loader svg {
    color: #f5d97f !important;
    fill: #b9782a !important;
    filter: drop-shadow(0 1px 2px rgba(113, 68, 23, .25)) drop-shadow(0 0 4px rgba(255, 233, 157, .32)) !important;
}

body:not(.wp-admin) .fluent-cart-loader svg path:first-child {
    color: #f4dfa2 !important;
    fill: currentColor !important;
    opacity: .54 !important;
}

body:not(.wp-admin) .fluent-cart-loader svg path:last-child {
    color: #b9782a !important;
    fill: currentColor !important;
    opacity: 1 !important;
}

body:not(.wp-admin) .fct-payment-method-loader svg {
    color: #b9782a !important;
    fill: none !important;
    filter: drop-shadow(0 1px 2px rgba(113, 68, 23, .25)) drop-shadow(0 0 4px rgba(255, 233, 157, .32)) !important;
}

body:not(.wp-admin) .fct-payment-method-loader svg circle {
    fill: none !important;
    stroke: #f4dfa2 !important;
    opacity: .66 !important;
}

body:not(.wp-admin) .fct-payment-method-loader svg path {
    fill: none !important;
    stroke: #b9782a !important;
    opacity: 1 !important;
}

body:not(.wp-admin) :is(button, a).fct-loading,
body:not(.wp-admin) .fct-product-view-button.loading,
body:not(.wp-admin) :is(button, a)[aria-busy="true"] {
    pointer-events: none !important;
    cursor: wait !important;
}

@media (prefers-reduced-motion: reduce) {
    body:not(.wp-admin) .fct-loader-spinner::before,
    body:not(.wp-admin) .fct-loader-spinner::after {
        animation-duration: 1800ms !important;
    }
}

/* =========================================================
   PURCHASE ACTION CLICK CURTAIN — RAPID-CLICK PROTECTION
   ========================================================= */

/*
 * Keep the first click native so FluentCart can run its own handler, then
 * cover the action with one Gentleland-owned busy layer. The layer is a real
 * child element instead of ::before/::after so it cannot collide with the
 * decorative pseudo-elements used by the Gentleland button designs.
 */
body:not(.wp-admin) :is(button, a)[data-gentleland-click-curtain="true"] {
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    cursor: wait !important;
    transform: none !important;
    filter: none !important;
}

body:not(.wp-admin) :is(button, a) > .gentleland-click-curtain-layer {
    position: absolute !important;
    inset: 0 !important;
    z-index: 50 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: inherit !important;
    background: var(--gentleland-loading-curtain) !important;
    -webkit-backdrop-filter: blur(2px) saturate(.90) !important;
    backdrop-filter: blur(2px) saturate(.90) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .82),
        inset 0 -1px 0 rgba(142, 92, 34, .22) !important;
    pointer-events: none !important;
}

body:not(.wp-admin) :is(button, a)[data-gentleland-click-curtain="true"] > .gentleland-click-curtain-layer {
    display: flex !important;
}

/* One predictable spinner for every protected purchase action. */
body:not(.wp-admin) .gentleland-click-curtain-spinner {
    position: relative !important;
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 24px !important;
    margin: 0 !important;
    padding: 3px !important;
    border: 0 !important;
    border-radius: 50% !important;
    box-sizing: border-box !important;
    background: conic-gradient(
        from 10deg,
        rgba(255, 248, 207, .18) 0deg,
        #fff8cf 42deg,
        #f5d97f 102deg,
        #d7a444 174deg,
        #ffe99d 232deg,
        #b9782a 300deg,
        rgba(137, 85, 30, .18) 360deg
    ) !important;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
    -webkit-mask-composite: xor !important;
    mask-composite: exclude !important;
    filter: drop-shadow(0 1px 2px rgba(113, 68, 23, .34)) drop-shadow(0 0 5px rgba(255, 233, 157, .32)) !important;
    animation: gentlelandClickCurtainSpin 820ms linear infinite !important;
}

@keyframes gentlelandClickCurtainSpin {
    to { transform: rotate(360deg); }
}

/*
 * FluentCart uses different native loader elements on different controls.
 * Hide those only while our curtain is active so there is never a second,
 * differently-sized spinner or a loader background fighting the overlay.
 */
body:not(.wp-admin) :is(button, a)[data-gentleland-click-curtain="true"] :is(
    .fluent-cart-loader,
    .fct-loader,
    .fct-loader-spinner,
    .el-loading-spinner,
    .is-loading
) {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Never hide the Gentleland-owned spinner if a framework also adds .is-loading. */
body:not(.wp-admin) :is(button, a)[data-gentleland-click-curtain="true"] .gentleland-click-curtain-layer,
body:not(.wp-admin) :is(button, a)[data-gentleland-click-curtain="true"] .gentleland-click-curtain-spinner {
    visibility: visible !important;
    opacity: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
    body:not(.wp-admin) .gentleland-click-curtain-spinner {
        animation-duration: 1500ms !important;
    }
}

/* =========================================================
   PURCHASE ACTION LOADER UNIFICATION — SINGLE CURTAIN ONLY
   ========================================================= */

/*
 * FluentCart can render its own loader layer inside purchase controls after
 * Gentleland's click curtain has already appeared. Leaving that native layer
 * drawable produces a second curtain when our short click-lock ends. Keep the
 * native state available to FluentCart's JS, but never draw its button-level
 * loader on controls protected by the Gentleland curtain.
 */
html.gentleland-click-curtain-ready body:not(.wp-admin) :is(
    [data-fluent-cart-add-to-cart-button],
    .fluent-cart-add-to-cart-button,
    [data-fluent-cart-direct-checkout-button],
    .fluent-cart-direct-checkout-button,
    .fct-product-card .fct-product-view-button,
    .fct-cart-page .checkout-button,
    .fluent-cart-cart-page .checkout-button,
    :is([data-fluent-cart-cart-drawer], .fct-cart-drawer) .checkout-button,
    .fct_checkout .fct_place_order_btn,
    .fct-checkout-modal .fct_place_order_btn
) :is(
    .fluent-cart-loader,
    .fct-loader,
    .fct-loader-spinner,
    .el-loading-spinner
) {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* The Gentleland-owned overlay is the only loader allowed to remain visible. */
body:not(.wp-admin) :is(button, a)[data-gentleland-click-curtain="true"] > .gentleland-click-curtain-layer,
body:not(.wp-admin) :is(button, a)[data-gentleland-click-curtain="true"] > .gentleland-click-curtain-layer .gentleland-click-curtain-spinner {
    visibility: visible !important;
    opacity: 1 !important;
}