
/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* Product Card with Add to Cart Overlay */
.product-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.product-img-container {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.add-cart-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 1; /* Always visible on desktop */
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2;
}

.add-cart-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.add-cart-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.1);
}

.add-cart-btn i {
    font-size: 1.1rem;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--dark);
    height: 40px;
    overflow: hidden;
}

.product-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.original-price {
    color: var(--gray);
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-right: 8px;
}

.discount-badge {
    background-color: var(--danger);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    margin-left: 5px;
}

/* MOQ Progress Bar */
.moq-container {
    margin: 10px 0 15px;
}

.moq-label {
    font-size: 0.85rem;
    color: var(--dark);
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.moq-progress {
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.moq-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.moq-text {
    font-size: 0.8rem;
    color: var(--gray);
    text-align: right;
}

.moq-reached {
    color: var(--success);
    font-weight: 600;
}

.moq-active {
    color: var(--success);
    font-weight: 600;
}

/* View Details Button */
.view-details-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--gray-light);
    color: var(--dark);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-details-btn:hover {
    background-color: var(--primary-light);
    color: white;
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    /* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

    .product-card {
        margin: 0px; /* reduce overall spacing between cards */
    }

    .product-info {
        padding: 10px; /* smaller padding inside the card */
    }

    .moq-container {
        margin: 5px 0 10px; /* reduce top/bottom margin */
    }

    .add-cart-overlay {
        top: 5px;
        right: 5px; /* move overlay closer to edge */
    }

    .product-title {
        height: auto; /* allow title to wrap instead of fixed height */
    }

    .product-img-container {
        height: 140px; /* slightly smaller image height */
    }
}

@media (max-width: 400px) {
    .products-grid {
        grid-template-columns: 1fr; /* On very narrow screens, show 1 card */
    }
}
