/* 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 */
    }
}

/* Navigation Arrows - Default Hidden */
.straus-product-grid-wrapper .swiper-button-next,
.straus-product-grid-wrapper .swiper-button-prev {
    display: none;
    color: #DA1A32;
    bottom: 0;
    /* Red arrow color */
}

/* Mobile Styling */
@media (max-width: 767px) {
    .swiper-nav-wrapper {
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding-top: 15px;
    }

    .straus-product-grid-wrapper .swiper-button-next,
    .straus-product-grid-wrapper .swiper-button-prev {
        display: block;
        width: 21px;
        height: 21px;
    }

    .straus-product-grid-wrapper .swiper-button-next {
        background: url(../img/nav-next.png);
        background-size: 8px;
        background-repeat: no-repeat;
        background-position: center;
    }

    .straus-product-grid-wrapper .swiper-button-prev {
        background: url(../img/nav-prev.png);
        background-size: 8px;
        background-repeat: no-repeat;
        background-position: center;
    }

    .straus-product-grid-wrapper .swiper-button-next:after,
    .straus-product-grid-wrapper .swiper-button-prev:after {
        font-size: 14px;
        font-weight: bold;
    }
}