/* Enhanced Color Filter Styling */

/* ========================================
   COLOR TYPE SWITCHER
   ======================================== */

/* Color type toggle buttons */
.color-toggle-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: -12px;
}

.color-toggle-buttons .toggle-btn {
    padding: 2px 16px;
    border: 1px solid var(--goldsmith-border, #ddd);
    background: var(--goldsmith-light, #fff);
    cursor: pointer;
    font-family: "Marcellus", serif;
    font-size: 16px;
    border-radius: 8px;
    transition: .15s;
    color: var(--goldsmith-text, #333);
}

.color-toggle-buttons .toggle-btn.active {
    background: var(--accent, #333);
    color: #fff;
    border-color: var(--accent, #333);
}

/* ========================================
   COLORLESS RANGE SLIDER
   ======================================== */

/* Colorless filter container */
.colorless-filters {
    margin-bottom: -6px;
}

.slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-range-slider {
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    border: none;
    box-shadow: none;
    margin-bottom: 10px;
}

/* Grade Row - letters below the slider */
.grade-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 9px; /* Alignment with slider positions */
}

.grade-item {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--goldsmith-text-light, #666);
    transition: all 0.3s ease;
    text-align: center;
    min-width: 20px;
}

.grade-item.active {
    font-weight: 700;
    transform: scale(1.1);
}

.grade-item.in-range {
    font-weight: 600;
}

/* Stone Row - diamond icons with color gradient */
.stone-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 9px; /* Alignment with slider positions */
    margin-top: 5px;
}

.stone-item {
    transition: all 0.3s ease;
    text-align: center;
    min-width: 20px;
    filter: grayscale(0.4) brightness(0.8);
    opacity: 0.6;
    cursor: pointer;
    position: relative;
}

.stone-item svg {
    width: 30px;
    height: 30px;
    transition: all 0.3s ease;
}

.stone-item.active {
    transform: scale(1.2);
}

.stone-item.in-range {
    transform: scale(1.05);
}

/* noUiSlider styling for colorless range slider */
.color-range-slider .noUi-connect {
    background: var(--goldsmith-primary, #333);
}

.color-range-slider .noUi-handle {
    border: 1px solid var(--goldsmith-primary, #333);
    background: white;
    box-shadow: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    right: -9px;
    top: -6px;
}

.color-range-slider .noUi-handle:before,
.color-range-slider .noUi-handle:after {
    display: none;
}

.color-range-slider .noUi-handle:hover {
    transform: scale(1.1);
}

.color-range-slider .noUi-handle.noUi-active {
    transform: scale(1.15);
}

/* ========================================
   FANCY COLOR FILTERS
   ======================================== */

/* Fancy color filters container */
.fancy-color-filters {
    margin-bottom: 20px;
    margin-top: 20px;
}

.fancy-filter-group {
    margin-bottom: 15px;
}

.fancy-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.fancy-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 13px;
    min-height: 100px;
}

.fancy-select:focus {
    outline: none;
    border-color: var(--goldsmith-primary, #333);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.fancy-select option {
    padding: 5px;
}

.fancy-select option:checked {
    background: var(--goldsmith-primary, #333);
    color: white;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet and mobile adjustments */
@media (max-width: 768px) {
    .grade-row,
    .stone-row {
        padding: 0 5px;
    }

    .grade-item {
        font-size: 10px;
        min-width: 15px;
    }

    .stone-item {
        min-width: 15px;
    }

    .stone-item svg {
        width: 22px;
        height: 22px;
    }

    .color-type-btn {
        padding: 4px 12px;
        font-size: 10px;
        min-height: 30px;
        margin: 1px;
    }

    .fancy-select {
        min-height: 80px;
    }
}

@media (max-width: 480px) {
    .color-type-switcher {
        flex-direction: column;
    }

    .grade-row,
    .stone-row {
        padding: 0 3px;
    }

    .grade-item {
        font-size: 9px;
        min-width: 12px;
    }

    .stone-item {
        min-width: 12px;
    }

    .stone-item svg {
        width: 18px;
        height: 18px;
    }
}

/* ========================================
   LOADING STATES & ANIMATIONS
   ======================================== */

/* Loading state */
.loading-products .colorless-filters,
.loading-products .fancy-color-filters,
.loading-products .color-type-switcher {
    opacity: 0.6;
    pointer-events: none;
}

/* Filter animations */
.colorless-filters,
.fancy-color-filters {
    transition: opacity 0.3s ease, height 0.3s ease;
}

/* ========================================
   CUSTOM SCROLLBARS
   ======================================== */

/* Custom scrollbar for multi-select dropdowns */
.fancy-select::-webkit-scrollbar {
    width: 8px;
}

.fancy-select::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.fancy-select::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.fancy-select::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========================================
   ADVANCED FILTERS SLIDERS
   ======================================== */

/* Slider row container */
.slider-row {
    margin: 10px 0;
    padding: 0 5px;
}

/* Base slider styling */
.slider-row .noUi-target {
    background: #e9ecef;
    border-radius: 3px;
    border: none;
    box-shadow: none;
    height: 6px;
}

.slider-row .noUi-connect {
    background: var(--goldsmith-primary, #333);
}

.slider-row .noUi-handle {
    border: 1px solid var(--goldsmith-primary, #333);
    background: white;
    box-shadow: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    right: -9px;
    top: -6px;
    outline: none;
    cursor: pointer;
}

.slider-row .noUi-handle:before,
.slider-row .noUi-handle:after {
    display: none;
}

.slider-row .noUi-handle:hover {
    transform: scale(1.1);
}

.slider-row .noUi-handle.noUi-active {
    transform: scale(1.15);
}

/* Range value display styling */
.range-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    font-size: 12px;
    color: var(--goldsmith-text-light, #666);
    font-weight: 600;
}

/* ========================================
   CLARITY AND CUT GRADE ROWS
   ======================================== */

/* Clarity Grade Row */
.clarity-grade-row,
.cut-grade-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 9px;
    margin-top: -3px;
}

/* Static labels like Colour slider - no dynamic styling */
.clarity-grade-item {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--goldsmith-text-light, #666);
    text-align: center;
    min-width: 20px;
}

.cut-grade-item {
    font-size: 10px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.3px;
    color: var(--goldsmith-text-light, #666);
    text-align: center;
    min-width: 45px;
    white-space: nowrap;
}

/* No active or in-range states - labels remain static like Colour slider */

/* Slider styling for Clarity and Cut */
.clarity-range-slider,
.cut-range-slider {
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    border: none;
    box-shadow: none;
    margin-bottom: 10px;
}

.clarity-range-slider .noUiSlider-connect,
.cut-range-slider .noUiSlider-connect {
    background: var(--goldsmith-primary, #333);
}

.clarity-range-slider .noUiSlider-handle,
.cut-range-slider .noUiSlider-handle {
    border: 1px solid var(--goldsmith-primary, #333);
    background: white;
    box-shadow: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    right: -9px;
    top: -6px;
}

.clarity-range-slider .noUiSlider-handle:before,
.clarity-range-slider .noUiSlider-handle:after,
.cut-range-slider .noUiSlider-handle:before,
.cut-range-slider .noUiSlider-handle:after {
    display: none;
}

.clarity-range-slider .noUiSlider-handle:hover,
.cut-range-slider .noUiSlider-handle:hover {
    transform: scale(1.1);
}

.clarity-range-slider .noUiSlider-handle.noUiSlider-active,
.cut-range-slider .noUiSlider-handle.noUiSlider-active {
    transform: scale(1.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .clarity-grade-row,
    .cut-grade-row {
        padding: 0 5px;
    }

    .clarity-grade-item {
        font-size: 10px;
        min-width: 18px;
    }

    .cut-grade-item {
        font-size: 9px;
        min-width: 35px;
    }
}

@media (max-width: 480px) {
    .clarity-grade-row,
    .cut-grade-row {
        padding: 0 3px;
    }

    .clarity-grade-item {
        font-size: 9px;
        min-width: 15px;
    }

    .cut-grade-item {
        font-size: 8px;
        min-width: 30px;
    }
}