/* Desktop Layout (Default) */
.straus-product-grid-wrapper {
    width: 100%;
    overflow: hidden;
    /* For Swiper containment */
}

/* 
   We target the swiper-wrapper to act as the Grid container on Desktop.
   Swiper styles will override this on initialization or we wrap it in a media query 
   to ensure clean separation.
*/
@media (min-width: 768px) {
    .straus-product-grid-wrapper .swiper-wrapper {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
        /* Reset Swiper wrapper defaults if needed */
        transform: none !important;
        width: 100% !important;
        height: auto !important;
    }

    .straus-product-grid-wrapper .swiper-slide {
        width: auto !important;
        /* Let Grid handle width */
        height: auto !important;
    }
}

.straus-product-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1 / 1;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    /* Reserve space for border */
    width: 100%;
    /* Ensure it fills the grid cell or slide */
}

.straus-product-item.active {
    border-color: red;
}

.straus-product-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    /* Add some padding so image doesn't touch edges */
    box-sizing: border-box;
}

.straus-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Mobile Layout - Swiper active */
@media (max-width: 767px) {

    /* Swiper handles layout, just ensure items look good */
    .straus-product-item {
        /* aspect-ratio still applies */
    }
}