/**
 * Easy Currency — cache-plugin compatibility layer.
 *
 * A cached page arrives in the store's base currency and the browser rewrites
 * the prices a moment later. These rules cover that moment, so a visitor never
 * reads a price in a currency that isn't theirs.
 *
 * Everything is scoped to .eccw-hydrating on <html>, which is only ever added
 * by an inline script. With JavaScript off the class never lands, so prices
 * simply stay visible in the base currency instead of hiding forever.
 */

.eccw-hydrating .eccw-price[data-eccw-pending] {
    display: inline-block;
    position: relative;
    min-width: 3em;
    border-radius: 3px;
    vertical-align: middle;
    background-color: rgba(128, 128, 128, 0.13);
    background-image: linear-gradient(
        90deg,
        rgba(128, 128, 128, 0) 0%,
        rgba(128, 128, 128, 0.2) 50%,
        rgba(128, 128, 128, 0) 100%
    );
    background-size: 200% 100%;
    background-repeat: no-repeat;
    animation: eccw-shimmer 1.1s ease-in-out infinite;
}

/*
 * Hide the base-currency text but keep it in flow — it's what reserves the
 * width, so the layout doesn't jump when the real price lands.
 */
.eccw-hydrating .eccw-price[data-eccw-pending] > * {
    visibility: hidden;
}

@keyframes eccw-shimmer {
    0% {
        background-position: 150% 0;
    }
    100% {
        background-position: -50% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .eccw-hydrating .eccw-price[data-eccw-pending] {
        animation: none;
    }
}
