.products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--grid-gap, 1.5rem);
    margin: 0;
    padding: 0;
}

/* Grid Item */
.products-grid .grid-item {
    flex: 0 0 auto;
    width: calc((100% - (var(--grid-gap, 1.5rem) * (var(--grid-columns, 4) - 1))) / var(--grid-columns, 4));
    min-width: 0;
    /* Prevents flex items from overflowing */
}

/* Empty State */
.products-grid .grid-empty {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--secondary-text);
}

.products-grid .grid-empty svg {
    margin-bottom: 1.5rem;
    opacity: 0.4;
}

.products-grid .grid-empty .empty-title {
    margin: 0 0 0.5rem 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text);
}

.products-grid .grid-empty .empty-text {
    margin: 0;
    font-size: var(--font-size-base);
    color: var(--secondary-text);
}

/* Loading State */
.products-grid.is-loading .grid-item {
    pointer-events: none;
}

/* Responsive Breakpoints */

/* Tablets (3 columns) */
@media only screen and (max-width: 1024px) {
    .products-grid .grid-item {
        width: calc((100% - (var(--grid-gap, 1.5rem) * 2)) / 3);
    }
}

/* Small Tablets (2 columns) */
@media only screen and (max-width: 768px) {
    .products-grid {
        gap: 1.25rem;
    }

    .products-grid .grid-item {
        width: calc((100% - 1.25rem) / 2);
    }

    .products-grid .grid-empty {
        padding: 3rem 1.5rem;
    }

    .products-grid .grid-empty svg {
        width: 56px;
        height: 56px;
    }

    .products-grid .grid-empty .empty-title {
        font-size: var(--font-size-md);
    }

    .products-grid .grid-empty .empty-text {
        font-size: var(--font-size-sm);
    }
}

/* Mobile (1 column) */
@media only screen and (max-width: 480px) {
    .products-grid {
        gap: 1rem;
    }

    .products-grid .grid-item {
        width: 100%;
    }

    .products-grid .grid-empty {
        padding: 2.5rem 1rem;
    }

    .products-grid .grid-empty svg {
        width: 48px;
        height: 48px;
        margin-bottom: 1rem;
    }
}

/* Ensure product cards fill the grid item */
.products-grid .grid-item .product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.products-grid .grid-item .product-card .product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.products-grid .grid-item .product-card .product-actions {
    margin-top: auto;
}