.categories-section {
    padding: 20px 0;
    max-width: 1200px; /* Constraints the container width */
    margin: 0 auto;
}

.category-list {
    display: flex;
    justify-content: flex-start; /* Aligns items to the start, allowing them to scroll */
    gap: 20px; /* Increased spacing between items */
    padding: 10px 0; /* Add padding at the bottom for scrollbar space */
    
    /* === SCROLLABLE PROPERTIES === */
    overflow-x: auto; /* Enables horizontal scrolling */
    overflow-y: hidden; /* Prevents accidental vertical scrolling */
    white-space: nowrap; /* Keeps all items in a single row */
    -webkit-overflow-scrolling: touch; /* Improves scrolling performance on iOS devices */

    /* === SCROLLBAR HIDING RULES === */
    /* Hide scrollbar for Chrome, Safari, and Opera */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* Hide scrollbar line for Webkit browsers (Chrome, Safari) */
.category-list::-webkit-scrollbar {
    display: none;
    height: 0; /* Ensure no space is reserved for the scrollbar */
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    flex-shrink: 0; 
}

.category-image-wrapper {
    /* === SQUARE SHAPE IMPLEMENTATION === */
    width: 150px; 
    height: 150px;
    
    border-radius: 8px;
    overflow: hidden;
    position: relative; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
    transition: transform 0.3s ease;
}

/* Scrollbar Styling (Optional but recommended for better visual) */
.category-list::-webkit-scrollbar {
    height: 8px;
}
.category-list::-webkit-scrollbar-thumb {
    background-color: #ccc; /* Grey scrollbar thumb */
    border-radius: 10px;
}
.category-list::-webkit-scrollbar-track {
    background: #f0f0f0; /* Light grey scrollbar track */
}


.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    /* This ensures items don't shrink and force scrolling */
    flex-shrink: 0; 
}

.category-image-wrapper {
    /* === SQUARE SHAPE IMPLEMENTATION === */
    width: 150px; 
    height: 150px; /* Equal width and height creates a square */
    
    border-radius: 8px; /* Slightly more rounded corners for the square tile */
    overflow: hidden;
    position: relative; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
    transition: transform 0.3s ease;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 1; 
    transition: opacity 1s ease-in-out;
}

/* Image Rotation Classes (Kept from previous setup) */
.category-image.next-image {
    opacity: 0;
    z-index: 1; 
}

.category-image.current-image {
    z-index: 2; 
}

.category-name {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.category-item:hover .category-image-wrapper {
    transform: scale(1.03); /* Apply hover effect to the wrapper */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* --- CRITICAL STYLES FOR IMAGE ROTATION --- */

.category-image-wrapper {
    /* ... (Your square/sizing rules) ... */
    position: relative; /* REQUIRED: To position current/next images absolutely */
    overflow: hidden;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute; /* REQUIRED: Stacks the two images on top of each other */
    top: 0;
    left: 0;
    
    /* Set up the transition for the fade effect */
    transition: opacity 1s ease-in-out; 
}

/* Initial state for the image rotation */
.category-image.current-image,
.category-image.current-jewellery {
    opacity: 1; /* Initially visible */
    z-index: 2; /* On top */
}

.category-image.next-image,
.category-image.next-jewellery {
    opacity: 0; /* Initially hidden */
    z-index: 1; /* Below the current image */
}

