/* ========================================= */
/* DESKTOP HOMEPAGE OPTIMIZATION (EBREEZZ)   */
/* ========================================= */
@media (min-width: 769px) {
    /* Center the category items perfectly */
    .compact-squares .swiper-wrapper,
    .s-block-categories .swiper-wrapper,
    .compact-squares .categories-grid,
    .s-block-categories .categories-grid {
        justify-content: center !important;
        gap: 20px !important;
    }

    /* Shrink the images to a premium, compact size */
    .compact-squares .swiper-slide,
    .compact-squares s-category-card,
    .compact-squares .category-item,
    .s-block-categories .swiper-slide,
    .s-block-categories s-category-card {
        width: auto !important; 
        max-width: 130px !important; 
    }

    .compact-squares img,
    .s-block-categories img {
        width: 110px !important;
        height: 110px !important;
        object-fit: cover !important;
        border-radius: 10px !important;
        margin: 0 auto !important;
        transition: transform 0.3s ease; 
    }

    .compact-squares img:hover,
    .s-block-categories img:hover {
        transform: scale(1.05); 
    }

    .compact-squares h3,
    .compact-squares span,
    .compact-squares .category-title,
    .s-block-categories h3,
    .s-block-categories span {
        font-size: 12px !important;
        font-weight: 600 !important;
        margin-top: 10px !important;
        text-align: center !important;
    }
}

/* ========================================= */
/* MOBILE HOMEPAGE OPTIMIZATION (EBREEZZ)    */
/* ========================================= */
@media (max-width: 768px) {
    /* --- 1. SHRINK SQUARE CATEGORIES --- */
    .compact-squares,
    .s-block-categories {
        margin-top: 15px !important; /* Clean space below the top banner */
        margin-bottom: 0px !important; 
        padding-bottom: 0px !important;
    }
    
    .compact-squares .swiper-slide,
    .compact-squares s-category-card,
    .compact-squares .category-item,
    .s-block-categories .swiper-slide,
    .s-block-categories s-category-card {
        width: 22% !important; 
        min-width: 75px !important;
    }
    
    .compact-squares img,
    .s-block-categories img {
        width: 70px !important;
        height: 70px !important;
        object-fit: cover !important;
        border-radius: 12px !important;
        margin: 0 auto !important;
    }
    
    .compact-squares h3,
    .compact-squares span,
    .compact-squares .category-title,
    .s-block-categories h3,
    .s-block-categories span {
        font-size: 10px !important;
        line-height: 1.2 !important;
        margin-top: 6px !important;
        white-space: normal !important;
        text-align: center !important;
    }

    /* --- 2. SQUEEZE THE LATEST PRODUCTS SECTION --- */
    /* Forcefully drag the whole section UP under the categories */
    .s-block-products,
    .s-block--fixed-products {
        margin-top: -15px !important; 
        padding-top: 0px !important;
    }

    /* Crush the space between the Title text and the Green Line */
    .s-block-products .s-block__header,
    .s-block--fixed-products .s-block__header,
    s-block-title {
        margin-bottom: 0px !important;
        padding-bottom: 0px !important;
    }

    s-block-title::part(wrapper) {
        gap: 2px !important; /* Removes Salla's internal padding */
    }

    /* Pull the product cards tightly up against the green line */
    .s-block-products .s-block__content,
    .s-block--fixed-products .s-block__content,
    s-salla-products-slider {
        margin-top: 5px !important; 
        padding-top: 0px !important;
    }
}