/* Amazon Filters Styles */
/* Unique prefix: .filter- to prevent conflicts */

/* Filter Sidebar */
.filter-sidebar {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    padding: 0;
    height: fit-content;
    max-height: calc(100vh - 40px);
    position: sticky;
    top: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for filter sidebar */
.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.filter-sidebar-content {
    padding: 16px;
}

/* Filter Header */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e7e7e7;
}

.filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #0f1111;
    margin: 0;
}

.clear-all-filters {
    background: none;
    border: none;
    color: #007185;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-all-filters:hover {
    background-color: #f0f8ff;
    text-decoration: underline;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #e7e7e7;
    padding-bottom: 16px;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
    transition: background-color 0.2s ease;
}

.filter-section-header:hover {
    background-color: #f7f8f8;
    margin: 0 -8px;
    padding: 8px;
    border-radius: 4px;
}

.filter-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f1111;
    margin: 0;
}

.collapse-icon {
    width: 20px;
    height: 20px;
    fill: #565959;
    transition: transform 0.3s ease;
}

.filter-section.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.filter-section-content {
    padding-top: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.filter-section.collapsed .filter-section-content {
    max-height: 0;
    padding-top: 0;
    opacity: 0;
}

/* Price Filter */
.price-range-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 4px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.price-input-group label {
    font-size: 13px;
    color: #565959;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-input {
    width: 100%;
    padding: 7px 5px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #0f1111;
    background: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.price-input:focus {
    outline: none;
    border-color: #ff9900;
    box-shadow: 0 0 0 4px rgba(255, 153, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.price-input:hover {
    border-color: #c7c7c7;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.price-separator {
    font-size: 16px;
    color: #565959;
    font-weight: 500;
    margin-top: 24px;
    text-align: center;
}

.price-slider-container {
    padding: 8px 12px;
    margin: 8px 0;
}

/* Enhanced noUiSlider Styles */
.price-slider.noUi-target {
    background: linear-gradient(to right, #f0f2f4, #e1e5e9);
    border: none;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
    height: 8px;
    cursor: pointer;
}

.price-slider .noUi-connect {
    background: linear-gradient(135deg, #ff9900, #ffb84d);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}

.price-slider .noUi-handle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border: 3px solid #ff9900;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(255, 153, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    top: -8px;
}

.price-slider .noUi-handle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(255, 153, 0, 0.3);
}

.price-slider .noUi-handle:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(255, 153, 0, 0.4);
}

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

.price-quick-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.price-quick-btn {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #0f1111;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.price-quick-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 153, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.price-quick-btn:hover {
    background: linear-gradient(135deg, #fff, #f0f2f4);
    border-color: #ff9900;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(255, 153, 0, 0.1);
}

.price-quick-btn:hover::before {
    left: 100%;
}

.price-quick-btn.active {
    background: linear-gradient(135deg, #ff9900, #ffb84d);
    border-color: #ff9900;
    color: #fff;
    font-weight: 600;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.price-quick-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Brand Filter */
.brand-search {
    margin-bottom: 12px;
}

.brand-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    font-size: 14px;
    color: #0f1111;
    background: #fff;
    transition: border-color 0.2s ease;
}

.brand-search-input:focus {
    outline: none;
    border-color: #007185;
    box-shadow: 0 0 0 2px rgba(0, 113, 133, 0.1);
}

.brand-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brand-list::-webkit-scrollbar {
    width: 6px;
}

.brand-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.brand-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.brand-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.show-more-brands {
    background: none;
    border: none;
    color: #007185;
    font-size: 13px;
    cursor: pointer;
    padding: 8px 0;
    text-align: left;
    transition: color 0.2s ease;
    margin-top: 8px;
}

.show-more-brands:hover {
    text-decoration: underline;
}

.show-more-brands .hide-text {
    display: none;
}

.show-more-brands.expanded .show-text {
    display: none;
}

.show-more-brands.expanded .hide-text {
    display: inline;
}

/* Checkbox Styles */
.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    margin: 0 -4px;
    padding: 4px;
}

.filter-checkbox-label:hover {
    background-color: #f7f8f8;
}

.filter-checkbox {
    display: none;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #d5d9d9;
    border-radius: 3px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-checkbox:checked+.checkbox-custom {
    background-color: #007185;
    border-color: #007185;
}

.filter-checkbox:checked+.checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    flex: 1;
    font-size: 14px;
    color: #0f1111;
    line-height: 1.3;
}

.product-count {
    font-size: 12px;
    color: #565959;
    margin-left: auto;
}

/* Rating Filter */
.rating-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-filter-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    margin: 0 -4px;
}

.rating-filter-label:hover {
    background-color: #f7f8f8;
}

.rating-radio {
    display: none;
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 16px;
    color: #ddd;
    transition: color 0.2s ease;
}

.star.filled {
    color: #ff9900;
}

.rating-text {
    font-size: 14px;
    color: #0f1111;
}

.rating-radio:checked+.rating-display {
    background-color: #e3f2fd;
    border-radius: 4px;
    padding: 4px 8px;
    margin: -4px -8px;
}

/* Active Filters */
.active-filters {
    background: #f7f8f8;
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.active-filters-label {
    font-size: 14px;
    font-weight: 600;
    color: #0f1111;
}

.clear-all-active {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #007185;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-all-active:hover {
    background-color: #f0f8ff;
    text-decoration: underline;
}

.clear-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.active-filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    color: #0f1111;
}

.active-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-label {
    font-weight: 500;
    color: #565959;
}

.filter-value {
    color: #0f1111;
}

.stars-mini {
    display: flex;
    gap: 1px;
}

.stars-mini .star {
    font-size: 12px;
}

.remove-filter {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    margin-left: 4px;
}

.remove-filter:hover {
    background-color: #f0f0f0;
}

.remove-filter svg {
    width: 12px;
    height: 12px;
    fill: #565959;
}

/* Mobile Filter Actions */
.mobile-filter-actions {
    display: none;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid #e7e7e7;
}

.apply-filters-btn {
    width: 100%;
    background: #ff9900;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.apply-filters-btn:hover {
    background: #e88900;
}

.apply-filters-btn:active {
    background: #d17800;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-sidebar {
        border: none;
        border-radius: 0;
        height: 100vh;
        overflow-y: auto;
        padding-top: 60px;
    }

    .filter-sidebar-content {
        padding: 20px;
    }

    .mobile-filter-actions {
        display: block;
        position: sticky;
        bottom: 0;
        background: #fff;
        margin: 0 -20px;
        padding: 16px 20px;
        border-top: 1px solid #e7e7e7;
    }

    .brand-list {
        max-height: 150px;
    }

    .active-filters {
        margin: 8px;
    }

    .active-filters-list {
        gap: 6px;
    }

    .active-filter-item {
        font-size: 12px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .filter-title {
        font-size: 16px;
    }

    .filter-section-title {
        font-size: 14px;
    }

    .price-inputs {
        flex-direction: column;
        gap: 12px;
    }

    .price-separator {
        text-align: center;
        margin-top: 0;
    }

    .price-quick-filters {
        gap: 4px;
    }

    .price-quick-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Animation for filter updates */
@keyframes filterUpdate {
    0% {
        opacity: 0.7;
        transform: scale(0.98);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.filter-section.updating {
    animation: filterUpdate 0.3s ease;
}

/* Focus styles for accessibility */
.filter-checkbox:focus+.checkbox-custom {
    box-shadow: 0 0 0 2px rgba(0, 113, 133, 0.3);
}

.rating-radio:focus+.rating-display {
    outline: 2px solid #007185;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .filter-sidebar {
        border-width: 2px;
    }

    .checkbox-custom {
        border-width: 2px;
    }

    .active-filter-item {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .collapse-icon,
    .filter-section-content,
    .checkbox-custom,
    .star {
        transition: none;
    }

    .filter-section.updating {
        animation: none;
    }
}