/* Color swatch container - grid layout */
.wccs-swatch-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 2px;
    margin: 10px 0;
    max-width: 500px;
}

/* Individual swatch item container */
.wccs-swatch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
    padding: 2px;
}

/* Color swatch button - larger square shape */
.wccs-swatch {
    --wccs-size: 50px;
    width: var(--wccs-size);
    height: var(--wccs-size);
    border-radius: 4px;
    border: 2px solid #ddd;
    padding: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

/* Inner color display */
.wccs-swatch .wccs-swatch-inner {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 2px;
    background: var(--wccs-color, #eee);
}

/* Color name label underneath */
.wccs-swatch-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    line-height: 1.2;
    max-width: 80px;
    word-wrap: break-word;
}

/* Selected state */
.wccs-swatch-item.is-selected .wccs-swatch {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

.wccs-swatch-item.is-selected .wccs-swatch-label {
    color: #0073aa;
    font-weight: 600;
}

/* Hover state */
.wccs-swatch:hover {
    border-color: #999;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Focus state for accessibility */
.wccs-swatch:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Fallback for terms without colors */
.wccs-swatch:not([style*="--wccs-color"]) .wccs-swatch-inner {
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}
