/* Filter Components Styles */

/* Filter Section Container - Tabs + Filter Icon on same line */
.filter-section {
    position: relative;
}

/* Subcategory Tabs - CENTERED but allow space for filter icon */
.subcategory-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px 60px 20px 20px; /* Extra padding on right for filter icon */
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.subcategory-tabs::-webkit-scrollbar {
    height: 6px;
}

.subcategory-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.subcategory-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.subcategory-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.subcategory-tab:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

.subcategory-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

.subcategory-tab i {
    font-size: 16px;
}

.subcategory-tab .count {
    font-size: 12px;
    opacity: 0.8;
}

/* Filter Bar - POSITIONED ON THE RIGHT */
.filter-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

/* Filter Icon Button - Different color, on the right */
.filter-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #FF6B35; /* Orange color - different from primary purple */
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    position: relative;
}

.filter-icon-btn:hover {
    background: #e65100;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.4);
}

.filter-icon-btn i {
    font-size: 20px;
}

.filter-icon-btn .filter-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid var(--bg-primary);
}

/* Filter Dropdown Panel - COMPACT */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    min-width: 220px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.filter-dropdown-header h3 {
    font-size: 14px;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-dropdown-header h3 i {
    color: #FF6B35; /* Orange color */
}

.filter-dropdown-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-dropdown-close:hover {
    color: #FF6B35; /* Orange color */
}

/* Sort Options - COMPACT */
.sort-options {
    margin-bottom: 10px;
}

.sort-options-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Brand Filter Section - IN DROPDOWN */
.brand-filter-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.brand-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Price Range Section - IN DROPDOWN */
.price-range-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.price-range-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.price-range-toggle:hover {
    background: rgba(255, 107, 53, 0.05);
    border-color: #FF6B35;
}

.price-range-toggle.expanded {
    background: rgba(255, 107, 53, 0.1);
    border-color: #FF6B35;
    margin-bottom: 12px;
}

.price-range-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-range-toggle-label i {
    color: #FF6B35;
    font-size: 13px;
}

.price-active-indicator {
    color: #FF6B35;
    font-size: 10px;
    margin-left: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.price-range-toggle-icon {
    color: var(--text-secondary);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.price-range-toggle.expanded .price-range-toggle-icon {
    transform: rotate(180deg);
}

.price-range-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.price-range-content.expanded {
    max-height: 200px;
    opacity: 1;
}

.price-range-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

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

.price-input-group label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.price-input-group input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 12px;
    transition: all 0.2s ease;
}

.price-input-group input:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.1);
}

.price-separator {
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 18px;
}

.apply-price-btn {
    width: 100%;
    padding: 8px 12px;
    background: #FF6B35;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.apply-price-btn:hover {
    background: #e65100;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.apply-price-btn i {
    font-size: 11px;
}

.brand-filter-options {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #FF6B35 transparent;
}

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

.brand-filter-options::-webkit-scrollbar-track {
    background: transparent;
}

.brand-filter-options::-webkit-scrollbar-thumb {
    background: #FF6B35;
    border-radius: 3px;
}

.brand-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.brand-filter-option:hover {
    background: rgba(255, 107, 53, 0.1);
}

.brand-filter-option input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #FF6B35;
}

.brand-filter-option label {
    flex: 1;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-filter-option .brand-name {
    font-weight: 500;
}

.brand-filter-option .brand-count {
    font-size: 11px;
    color: var(--text-secondary);
}

.brand-filter-option.active {
    background: rgba(255, 107, 53, 0.15);
    border-left: 3px solid #FF6B35;
}

.brand-filter-option.active .brand-name {
    color: #FF6B35;
    font-weight: 600;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-option:hover {
    background: rgba(255, 107, 53, 0.1);
}

.sort-option input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #FF6B35; /* Orange color */
}

.sort-option label {
    flex: 1;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
}

.sort-option.active {
    background: rgba(255, 107, 53, 0.15);
    border-left: 3px solid #FF6B35; /* Orange color */
}

/* Product Count Display - COMPACT */
.filter-product-count {
    text-align: center;
    padding: 8px;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 13px;
}

.filter-product-count i {
    color: #FF6B35; /* Orange color */
    margin-right: 4px;
}

.filter-product-count strong {
    color: #FF6B35; /* Orange color */
    font-size: 16px;
}

/* Clear Filters Button - COMPACT */
.clear-filters-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--danger-color, #e74c3c);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.clear-filters-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.clear-filters-btn i {
    font-size: 12px;
}

/* Hide old filter controls */
.filter-controls {
    display: none;
}

.filter-status {
    display: none;
}

/* No Products Message */
.no-products-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-products-message p {
    font-size: 16px;
    margin-bottom: 10px;
}

.clear-filters-link {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font-size: inherit;
    font-weight: 600;
}

.clear-filters-link:hover {
    color: var(--secondary-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.3s ease;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .subcategory-tabs {
        padding: 15px 60px 15px 10px;
        gap: 8px;
        justify-content: flex-start;
    }

    .subcategory-tab {
        padding: 10px 16px;
        font-size: 13px;
    }

    .subcategory-tab i {
        font-size: 14px;
    }

    .filter-bar {
        top: 15px;
        right: 10px;
    }

    .filter-icon-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .filter-dropdown {
        right: 0;
        min-width: 200px;
    }
    
    .brand-filter-options {
        max-height: 150px;
    }
}

/* Touch-friendly tap targets on mobile */
@media (max-width: 768px) {
    .subcategory-tab,
    .clear-filters-btn,
    .filter-icon-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Smooth transitions */
.subcategory-tab,
.filter-icon-btn,
.clear-filters-btn,
.brand-filter-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus indicators for accessibility */
.subcategory-tab:focus,
.filter-icon-btn:focus,
.clear-filters-btn:focus,
.brand-filter-option:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
