/* ============================================================
   COLOR FILTER WIDGET - 167PX STYLES
   ============================================================ */

.color-widget-167 {
width: 167px;
    background: #ffffff;
    border-radius: 14px;
    padding: 10px 8px 8px;
    box-shadow: 0 4px 16px rgb(0 0 0 / 6%);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-left: 3px;
    margin-bottom: 3px;
	
}

.color-widget-167:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    border-color: #e0e0e0;
}

.cw-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 2px solid #f5f5f5;
}

.cw-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.cw-title {
    font-size: 11px;
    font-weight: 700;
    color: #2d3436;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cw-count {
    font-size: 8px;
    font-weight: 700;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    padding: 1px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    min-width: 18px;
    text-align: center;
}

.cw-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 2px;
    min-height: 100px;
}

.cw-grid::-webkit-scrollbar {
    width: 2px;
}

.cw-grid::-webkit-scrollbar-track {
    background: #f1f2f6;
    border-radius: 10px;
}

.cw-grid::-webkit-scrollbar-thumb {
    background: #d5d5d5;
    border-radius: 10px;
}

.cw-grid::-webkit-scrollbar-thumb:hover {
    background: #b5b5b5;
}

.cw-chip {
    position: relative;
    border-radius: 8px;
    padding: 3px 3px 2px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: #fafafa;
    border: 2px solid transparent;
}

.cw-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background: #ffffff;
}

.cw-chip:active {
    transform: scale(0.95);
}

.cw-chip.active {
    border-color: #6c5ce7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.10);
}

.cw-swatch {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    position: relative;
}

.cw-chip:hover .cw-swatch {
    box-shadow: 0 3px 10px rgba(0,0,0,0.10);
    transform: scale(1.03);
}

.cw-swatch::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0.20) 0%, rgba(255,255,255,0) 100%);
    border-radius: 6px 6px 0 0;
}

.cw-label {
    font-size: 12px;
    font-weight: 600;
    color: #2d3436;
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.cw-count-badge {
    display: inline-block;
    font-size: 9px;
    color: #b2bec3;
    background: #f1f2f6;
    padding: 1px 4px;
    border-radius: 6px;
    margin-top: 1px;
    font-weight: 600;
}

.cw-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 6px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    animation: badgePop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cw-badge.popular {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.cw-badge.trending {
    background: linear-gradient(135deg, #ffd93d, #f9a825);
    box-shadow: 0 2px 6px rgba(255, 217, 61, 0.3);
    color: #2d3436;
}

@keyframes badgePop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.cw-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 16px 0;
    color: #b2bec3;
    font-size: 8px;
    grid-column: 1 / -1;
}

.cw-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #f1f2f6;
    border-top-color: #6c5ce7;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.cw-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 2px solid #f5f5f5;
    font-size: 9px;
    color: #b2bec3;
    font-weight: 500;
}

.cw-stats span {
    display: flex;
    align-items: center;
    gap: 2px;
}

.cw-no-results {
    text-align: center;
    padding: 16px 0;
    color: #b2bec3;
    font-size: 9px;
    grid-column: 1 / -1;
}

.cw-no-results .emoji {
    font-size: 16px;
    display: block;
    margin-bottom: 3px;
}

.cw-chip {
    animation: fadeIn 0.3s ease backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cw-chip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: #2d3436;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 100;
}

.cw-chip:hover::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

@media (max-width: 400px) {
    .color-widget-167 {
        width: 100%;
        max-width: 167px;
        margin-left: auto;
        margin-right: auto;
    }
}