

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.products-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    padding: 2rem;
    margin: 0 auto;
    justify-items: center; 
}

.product-card {
    display: flex;
    flex-direction: column;
    width: 350px;
    height: 100%;
    background: #f5f5f5;
    padding: 1rem;
    border:none;
    overflow: hidden;
    border-radius: 16px;

    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform, opacity;
}





.add-to-cart {
    width: calc(100% - 3rem);
    margin: 0 1.5rem 1.5rem;
    padding: 0.75rem;
    background: #81a942;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;

}

.product-image-container {
    position: relative;
    height: 200px;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-image.loaded {
    opacity: 1;
}



.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem;
}

.product-price span {
    font-weight: bold;
    margin-top: auto; 
    padding-top: 0.5rem;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 2px;
}

.star {
  color: #d1d5db; 
  font-size: 16px;
  position: relative;
}

.star.filled {
  color: #f59e0b; 
}

.star.half-filled {
  color: #d1d5db; 
}

.star.half-filled::before {
  content: '★';
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
  color: #f59e0b; 
}

.rating-value {
  font-size: 12px;
  color: var(--secondary);
  margin-left: 2px;
}


@media (max-width: 1400px) {
    .products-layout {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}
@media (max-width: 1024px) {
     .products-layout {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .product-card {
        padding: 0.8rem;
    }
}

@media (max-width: 768px) {
    .products-layout {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .products-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    .product-card {
        max-width: 100%; 
    }
    
}

