
    .categories-section {
        margin-top: 70px;
        padding: 40px 20px;
        max-width: 1200px;
      
    }

    .categories-header {
        text-align: left; /* Or center */
        margin-bottom: 20px;
    }

    .categories-header h2 {
        font-size: 1.8rem;
        margin-bottom: 30px;
        font-weight: 800;
        color: var(--dark, #333);
        position: relative;
        display: inline-block;
    }

    .categories-header h2::after {
        content: '';
        position: absolute;
        bottom: -8px;
        left: 0;
        width: 60px;
        height: 4px;
        background: linear-gradient(90deg, var(--saffron, #ff9933), transparent);
        border-radius: 2px;
    }

    /* --- THE RANDOM GRID --- */
    .categories-grid {
        display: grid;
        /* Desktop: 4 columns */
        grid-template-columns: repeat(4, 1fr); 
        /* Dense: This is MAGIC. It fills gaps if a small item fits before a large one */
        grid-auto-flow: dense; 
        gap: 16px;
    }

    .category-card {
        position: relative;
        background-color: #f0f0f0;
        background-size: cover;
        background-position: center;
        border-radius: 16px;
        overflow: hidden;
        cursor: pointer;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        
        /* Default Height for normal cards */
        min-height: 200px; 
        display: flex;
        align-items: flex-end; /* Push text to bottom */
        text-decoration: none;
    }

    /* Hover Effects */
    .category-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.15);
        border: 2px solid var(--saffron, #ff9933);
    }

    /* Text Overlay Gradient */
    .card-overlay {
        width: 100%;
        padding: 20px;
        background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
        z-index: 2;
    }

    .category-card span {
        color: white;
        font-weight: 600;
        font-size: 1.2rem;
        text-shadow: 0 2px 4px rgba(0,0,0,0.8);
        display: block;
    }

    /* --- GRID SPAN CLASSES --- */
    
    /* Large: 2x2 square */
    .span-large {
        grid-column: span 2;
        grid-row: span 2;
        min-height: 416px; /* (200 * 2) + 16gap */
    }

    /* Wide: 2 columns wide */
    .span-wide {
        grid-column: span 2;
    }

    /* Tall: 2 rows high */
    .span-tall {
        grid-row: span 2;
        min-height: 416px;
    }

    /* --- RESPONSIVE --- */
    @media (max-width: 900px) {
        .categories-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }
    @media(max-width:769px){
        .categories-section{
            margin-top: 0;
        }
    }
    @media (max-width: 600px) {
        .categories-grid {
            grid-template-columns: repeat(2, 1fr);
        }
        /* On mobile, reset row spans to avoid huge vertical items, keep col spans */
        .span-large, .span-tall {
            grid-row: span 1; 
            min-height: 200px;
        }
    }
