/*
 * OLC cart quantity - a cart line's quantity changed in place (Content/js/olc.cart-quantity.js)
 * OnlineComponents.com theme copy. The other themes have their own copy in this plugin's Themes/<theme>/Content/css; only the
 * spinner colors differ between them.
 */

/* the line being updated: its total and tariff total show a spinner instead of the old amount */
.olc-cart-line--updating [data-olc-line-amount] {
    position: relative;
    display: inline-block;
    min-width: 24px;
    min-height: 20px;
    color: transparent !important;
}

.olc-cart-line--updating [data-olc-line-amount] * {
    color: transparent !important;
}

.olc-cart-line--updating [data-olc-line-amount]::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid #E2E4E7;
    border-top-color: #0548A8;
    border-radius: 50%;
    box-sizing: border-box;
    animation: olc-cart-spin .7s linear infinite;
}

/* the order totals while a quantity updates: covered, so Secure Checkout can't be used until they are current */
[data-olc-cart-totals].olc-cart-totals--updating {
    position: relative;
}

[data-olc-cart-totals].olc-cart-totals--updating::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    background: rgba(255, 255, 255, .7);
}

[data-olc-cart-totals].olc-cart-totals--updating::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 6;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #E2E4E7;
    border-top-color: #0548A8;
    border-radius: 50%;
    box-sizing: border-box;
    animation: olc-cart-spin .7s linear infinite;
}

@keyframes olc-cart-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .olc-cart-line--updating [data-olc-line-amount]::after,
    [data-olc-cart-totals].olc-cart-totals--updating::after {
        animation-duration: 2.4s;
    }
}
