/* Keep the current cart view visible while the next category is loading. */
#cart-pjax-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 2147483000;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity .18s ease, transform .18s ease;
    background: transparent;
}

#cart-pjax-loader.is-active {
    opacity: 1;
    transform: translateY(0);
}

#cart-pjax-loader::before {
    content: "";
    display: block;
    width: 35%;
    height: 100%;
    background: var(--theme-color-2, #165dff);
    box-shadow: 0 0 10px rgba(22, 93, 255, .45);
    animation: cart-pjax-progress 1.05s ease-in-out infinite;
}

.cart-pjax-transition {
    animation: cart-pjax-enter .2s ease both;
}

.product-item.cart-pjax-skeleton {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: #fff;
    border: 0;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
    color: #4b5563;
    opacity: 1;
}

.product-item.cart-pjax-skeleton:hover {
    border-color: transparent;
    box-shadow: none;
}

.cart-pjax-spinner {
    display: block;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    box-sizing: border-box;
    border: 3px solid #e5e9f0;
    border-top-color: #2b6de5;
    border-radius: 50%;
    animation: cart-pjax-spin .85s linear infinite;
}

.cart-pjax-loading-text {
    color: #4b5563;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
}

@keyframes cart-pjax-progress {
    0% { transform: translateX(-120%); }
    50% { transform: translateX(190%); }
    100% { transform: translateX(360%); }
}

@keyframes cart-pjax-spin {
    to { transform: rotate(360deg); }
}

@keyframes cart-pjax-enter {
    from { opacity: .35; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .product-item.cart-pjax-skeleton {
        min-height: 280px;
        gap: 16px;
    }

    .cart-pjax-spinner {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .cart-pjax-loading-text {
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #cart-pjax-loader,
    .cart-pjax-transition,
    .cart-pjax-spinner {
        animation: none;
        transition: none;
    }
}
