/* ColorSearch 插件 - 前台色相条样式 */

.colorsearch-widget {
    width: 100%;
    margin: 10px 0 15px;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: "Microsoft YaHei", sans-serif;
}

.colorsearch-bar-wrap {
    flex: 1;
    position: relative;
    height: 24px;
    border-radius: 12px;
    overflow: visible;
    cursor: pointer;
}

.colorsearch-hue-bar {
    width: 100%;
    height: 24px;
    border-radius: 12px;
    background: linear-gradient(to right,
        hsl(0, 100%, 50%),
        hsl(30, 100%, 50%),
        hsl(60, 100%, 50%),
        hsl(90, 100%, 50%),
        hsl(120, 100%, 50%),
        hsl(150, 100%, 50%),
        hsl(180, 100%, 50%),
        hsl(210, 100%, 50%),
        hsl(240, 100%, 50%),
        hsl(270, 100%, 50%),
        hsl(300, 100%, 50%),
        hsl(330, 100%, 50%),
        hsl(360, 100%, 50%)
    );
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.colorsearch-indicator {
    position: absolute;
    top: -3px;
    width: 4px;
    height: 30px;
    background: #333;
    border-radius: 2px;
    pointer-events: none;
    display: none;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    transition: left 0.05s linear;
}

.colorsearch-indicator::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #333;
    border-radius: 50%;
    border: 2px solid #fff;
}

.colorsearch-indicator::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #333;
    border-radius: 50%;
    border: 2px solid #fff;
}

.colorsearch-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.colorsearch-color-block {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #ddd;
    background: #fff;
    transition: background-color 0.1s;
}

.colorsearch-match-count {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    min-width: 60px;
}

.colorsearch-reset-btn {
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f5f5f5;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.colorsearch-reset-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* 差值标签 */
.colorsearch-distance-tag {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 10;
}

/* 同色系匹配项高亮边框 */
.cs-matched {
    box-shadow: 0 0 0 2px rgba(255, 150, 0, 0.6);
}

/* 列表项过渡动画 */
.colorsearch-widget ~ * #tiles li,
.colorsearch-widget ~ * .product-list li,
.colorsearch-widget ~ * .list li {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 被隐藏的列表项 */
.cs-hidden {
    display: none !important;
}

/* 统计信息 */
.colorsearch-stats {
    font-size: 11px;
    color: #999;
    position: absolute;
    top: 2px;
    left: 0;
    right: 0;
    text-align: center;
    pointer-events: none;
}
