/* TARGETED FIX - Only affect texture images, not color circles */

/* Reset any previous changes first */
#color_to_pick_list.attribute_color {
    display: block !important;
    flex-wrap: none !important;
    gap: normal !important;
    max-width: none !important;
}

#color_to_pick_list li {
    width: auto !important;
    margin: 0 5px 5px 0 !important;
    display: inline-block !important;
    float: left !important;
}

/* Only target items that have images (textures), not color circles */
#color_to_pick_list li:has(img) {
    width: calc(50% - 5px) !important;
    margin: 0 5px 10px 0 !important;
    display: inline-block !important;
    float: left !important;
}

/* Make texture images bigger - only images, not color backgrounds */
#color_to_pick_list li img {
    width: 60px !important;
    height: 60px !important;
    border: 2px solid #ddd !important;
    border-radius: 4px !important;
    object-fit: cover !important;
}

/* Keep color circles small and unchanged */
#color_to_pick_list li a.color_pick:not(:has(img)) {
    width: 20px !important;
    height: 20px !important;
    display: inline-block !important;
    border-radius: 50% !important;
    border: 1px solid #ccc !important;
    margin-right: 5px !important;
}

/* Hover effect for images only */
#color_to_pick_list li:has(img):hover img {
    border-color: #0088cc !important;
}

/* Selected state for images only */
#color_to_pick_list li.selected:has(img) img {
    border-color: #28a745 !important;
    border-width: 3px !important;
}

/* Fallback for browsers that don't support :has() */
@supports not selector(:has(*)) {
    /* Alternative approach - target by image size */
    #color_to_pick_list li img[width="20"] {
        width: 60px !important;
        height: 60px !important;
        border: 2px solid #ddd !important;
        border-radius: 4px !important;
    }
    
    /* Make container flexible when images are present */
    #color_to_pick_list:has(img) {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        max-width: 300px !important;
    }
    
    #color_to_pick_list:has(img) li {
        width: calc(50% - 5px) !important;
    }
}

/* Clear floats */
#color_to_pick_list::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
}