/* ── Infinite Scroll & Skeleton Styles ─────────────────────── */
#product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.6rem;
    padding: 0 50px;
}

@media (max-width: 1400px) {
    #product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    #product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #product-grid {
        grid-template-columns: repeat(1, 1fr);
        padding: 0 15px;
    }
}

/* Product card */
.product-card-wrap {
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card-wrap:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.13);
}

.product-card-img {
    position: relative;
    height: 260px;
    overflow: hidden;
}

@media (max-width: 576px) {
    .product-card-img {
        height: 210px;
    }
}

.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.product-card-wrap:hover .product-card-img img {
    transform: scale(1.07);
}

.badge-product {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--secondary, #6c757d);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    z-index: 5;
}

.badge-view {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: #333;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    z-index: 5;
    backdrop-filter: blur(4px);
}

.product-card-body {
    padding: 1.1rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-body h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
    line-height: 1.35;
}

.product-card-desc {
    font-size: 0.93rem;
    color: #666;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* ── Skeleton loader ──────────────────────────────────────── */
.skeleton-card {
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eee;
}

.skeleton-img {
    height: 260px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-body {
    padding: 1.1rem 1.25rem 1.25rem;
}

.skeleton-line {
    height: 14px;
    border-radius: 6px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-line.wide {
    width: 80%;
}

.skeleton-line.mid {
    width: 60%;
}

.skeleton-line.short {
    width: 40%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── Sentinel / loader indicator ─────────────────────────── */
#scroll-sentinel {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
}

.loader-dots {
    display: none;
    gap: 8px;
}

.loader-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary, #0d6efd);
    animation: bounce 0.8s infinite alternate;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    from {
        transform: translateY(0);
        opacity: 0.5;
    }

    to {
        transform: translateY(-10px);
        opacity: 1;
    }
}

#end-of-results {
    display: none;
    text-align: center;
    padding: 2rem 0;
    color: #aaa;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    #product-grid {
        padding: 0 16px;
        gap: 1rem;
    }
}