/* Lazy load ảnh sản phẩm — skeleton shimmer + fade-in (computer / computer_v1 / computer_v2) */
@keyframes wc-product-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.item-product a.img-product,
.homepage-product .slide-product a.img-product {
    background-color: #f1f5f9;
    background-image: linear-gradient(
        90deg,
        #f1f5f9 0%,
        #e8eef5 42%,
        #f8fafc 50%,
        #e8eef5 58%,
        #f1f5f9 100%
    );
    background-size: 220% 100%;
    animation: wc-product-shimmer 1.35s ease-in-out infinite;
}

.item-product a.img-product.img-loaded,
.homepage-product .slide-product a.img-product.img-loaded {
    animation: none;
    background-image: none;
    background-color: #f8fafc;
}

.item-product .img-product img.b-lazy,
.homepage-product .slide-product .img-product img.b-lazy {
    width: 100%;
    height: 100%;
    display: block;
    box-sizing: border-box;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.35s ease;
    will-change: opacity;
}

.item-product .img-product img.b-lazy.b-loaded,
.homepage-product .slide-product .img-product img.b-lazy.b-loaded {
    opacity: 1;
    padding: 0 !important;
}

.item-product .product-card-inner:hover .img-product img.b-lazy.b-loaded {
    transform: scale(1.02);
    transition: opacity 0.35s ease, transform 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    .item-product a.img-product,
    .homepage-product .slide-product a.img-product {
        animation: none;
    }
    .item-product .img-product img.b-lazy,
    .homepage-product .slide-product .img-product img.b-lazy {
        transition: none;
    }
}
