/* =============================================================================
   Cart "updating" state  (2026-10-02) - set by assets/js/cart-pending.js
   Cart page and checkout summary. While the shop recalculates after a change:
   - a thin pink bar slides along the top of the order summary;
   - the summary's figures and the changed line's total dim (old numbers must
     not look final);
   - Proceed to checkout waits (the click is held by the script).
   Solid pink, no gradient; with reduced motion the bar stands still.
   ========================================================================== */

.cart-summary[aria-busy="true"] {
  position: relative;
}

.cart-summary[aria-busy="true"]::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  /* one solid pink segment, moved along by background-position */
  background: linear-gradient(#d50075, #d50075) no-repeat;
  background-size: 35% 100%;
  animation: skp-slide 1.1s cubic-bezier(.4, 0, .2, 1) infinite;
  pointer-events: none;
}

@keyframes skp-slide {
  from { background-position: -60% 0; }
  to { background-position: 160% 0; }
}

/* Figures dim, after a beat so an instant answer does not flicker. */
.cart-summary .cart-summary__value,
.cart-summary .sk-bd-saving,
.cart__item .product-line__total,
.cart__item .product-line__current {
  transition: opacity .18s ease .08s;
}

.cart-summary[aria-busy="true"] .cart-summary__value,
.cart-summary[aria-busy="true"] .sk-bd-saving,
.cart-summary[aria-busy="true"] .cart-summary__header-count,
.cart__item.is-updating .product-line__total,
.cart__item.is-updating .product-line__current {
  opacity: .35;
}

/* Proceed to checkout waits for the new total. */
.cart-grid.is-updating .cart-detailed__actions a.btn-primary {
  opacity: .55;
  cursor: progress;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .cart-summary[aria-busy="true"]::before {
    animation: none;
    background-size: 100% 100%;
    opacity: .5;
  }
}
