/* Shop Layout Fixes */

/* Prevent horizontal overflow */
body {
    overflow-x: hidden;
}

/* Main container fixes */
#primary {
    max-width: 100vw;
}

/* Sidebar fixes */
.content-bar {
    max-width: 100%;
    overflow: hidden;
}

/* Product grid container */
.content-shop {
    min-width: 0; /* Prevent flex item from overflowing */
    overflow: hidden;
}

/* Product grid fixes */
.product-grid {
    width: 100%;
}

.product-grid li {
    max-width: 100%;
}

/* Ensure images don't overflow */
.custom-product-image {
    max-width: 100%;
    height: auto;
}

/* SKU Search form fixes */
#skuSearchForm {
    width: 100%;
}

#skuSearchForm input {
    max-width: 100%;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    main.flex {
        max-width: calc(100vw - 2rem);
    }
}

@media (max-width: 768px) {
    .product-grid {
        gap: 0.75rem;
    }
    
    .product-grid li {
        padding: 0.5rem;
    }
}

/* Ensure complete rows visibility */
.product-grid::after {
    content: '';
    flex: auto;
}

/* Fix for 1200px resolution specific issues */
@media (min-width: 1200px) and (max-width: 1280px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}