
/* Filter Bar Container */
.filter-bar {
    background: var(--card-bg);
    padding: 20px 25px;
    border-radius: 12px;
    margin: 25px auto 30px;
    max-width: 1860px;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.4s ease-out;
    position: relative;
}

.filter-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), #4d9fff);
}

.filter-bar-title {
    font-size: 1.6rem;
    color: var(--heading-color);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
    position: relative;
    padding-bottom: 12px;
}

.filter-bar-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 40%;
    right: 40%;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Filter Controls Container */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content:center;
}

/* Individual Filter Control */
.filter-control {
    position: relative;
    min-width: 180px;
}

/* Filter Button */
.filter-button {
    background: linear-gradient(145deg, var(--nav-bg), var(--card-bg));
    color: var(--text-color);
    border: 2px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 100%;
    min-height: 48px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-button:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 209, 140, 0.3);
}

.filter-button:active {
    transform: translateY(0);
}

.filter-button.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.filter-button i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

.filter-button[aria-expanded="true"] {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.filter-button[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Filter Indicator */
.filter-indicator {
    background: #ff4757;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: all 0.3s ease;
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
}

.filter-indicator:not([hidden]) + i {
    margin-left: auto;
}

/* Filter Dropdown */
.filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--nav-bg);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 240px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.filter-dropdown.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-dropdown::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 3px;
}

.filter-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.filter-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Force clear, separated rows for each filter option */
.filter-dropdown label,
.filter-dropdown .filter-option {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    padding: 14px 18px !important;
    margin: 8px 0 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
}

/* Filter Options */
.filter-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 4px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    padding-left: 10px;
}

.filter-option:hover {
    background: rgba(0, 209, 140, 0.08);
}

.filter-option input[type="checkbox"] {
    display: none;
}

.filter-option .checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 16px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-option input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.filter-option input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.filter-option span:not(.checkmark) {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    font-weight: 500;
}

/* Price Range Inputs */
.filter-dropdown label[for^="price-"] {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--heading-color);
    margin: 15px 0 8px;
}

.filter-dropdown input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    margin: 5px 0 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-dropdown input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 209, 140, 0.1);
}

.filter-dropdown input[type="number"]::placeholder {
    color: #999;
}

.filter-dropdown input[type="checkbox"] {
    margin-right: 16px !important;     /* ← this controls the space */
}

/* Sort Options */
.filter-dropdown label[for^="sort"] {
    display: block;
    padding: 12px 0;
    margin: 4px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    padding-left: 10px;
}

.filter-dropdown label[for^="sort"]:hover {
    background: rgba(0, 209, 140, 0.1);
}

.filter-dropdown input[type="radio"] {
    margin-right: 10px;
    accent-color: var(--accent-color);
    transform: scale(1.1);
}

/* Loading State */
.filter-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-style: italic;
}

.no-options {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-style: italic;
}

.show-all-btn {
    background: linear-gradient(145deg, #4caf50, #388e3c);  /* green to match "all" theme */
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    min-height: 48px;
    margin-left: 12px;          /* space from Clear Filters */
    transition: all 0.3s ease;
}

.show-all-btn:hover {
    background: linear-gradient(145deg, #388e3c, #2e7d32);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.show-all-btn.active {          /* when in "all" mode */
    background: linear-gradient(145deg, #ff9800, #f57c00);  /* orange to indicate "showing all" */
}

/* Clear Filters Button */
.clear-filters {
    background: linear-gradient(145deg, #ff4757, #ff3742);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.2);
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clear-filters:hover {
    background: linear-gradient(145deg, #ff3742, #ff2e3c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

.clear-filters:active {
    transform: translateY(0);
}

.clear-filters::before {
    content: '🗑️';
    font-size: 1.1rem;
}

/* Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .filter-bar {
        padding: 18px 20px;
        margin: 20px auto;
        border-radius: 10px;
    }
    
    .filter-bar-title {
        font-size: 1.5rem;
        margin-bottom: 18px;
    }
    
    .filter-controls {
        gap: 10px;
    }
    
    .filter-control {
        min-width: 160px;
    }
    
    .filter-button {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
    
    .filter-dropdown {
        min-width: 220px;
        padding: 16px;
    }
    
    .clear-filters {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* Small Tablet */
@media (max-width: 768px) {
    .filter-bar {
        padding: 16px;
        margin: 16px auto;
    }
    
    .filter-bar-title {
        font-size: 1.4rem;
        margin-bottom: 16px;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .filter-control {
        width: 100%;
        min-width: auto;
    }
    
    .filter-button {
        width: 100%;
        justify-content: space-between;
        padding: 12px 16px;
    }
    
    .filter-dropdown {
        position: static;
        width: 100%;
        margin-top: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .filter-indicator {
        right: 40px;
    }
    
    .clear-filters {
        width: 100%;
        margin-top: 8px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .filter-bar {
        padding: 14px;
        margin: 12px auto;
        border-radius: 8px;
        border-width: 1px;
    }
    
    .filter-bar::before {
        height: 3px;
    }
    
    .filter-bar-title {
        font-size: 1.3rem;
        margin-bottom: 14px;
        padding-bottom: 10px;
    }
    
    .filter-button {
        padding: 10px 14px;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    .filter-indicator {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        right: 35px;
    }
    
    .filter-dropdown {
        padding: 14px;
        border-radius: 8px;
    }
    
    .filter-option {
        padding: 8px 0;
        font-size: 0.9rem;
    }
    
    .filter-option .checkmark {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }
    
    .filter-dropdown input[type="number"] {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .clear-filters {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 44px;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .filter-bar {
        padding: 12px;
    }
    
    .filter-bar-title {
        font-size: 1.2rem;
    }
    
    .filter-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .filter-indicator {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
        right: 30px;
    }
    
    .clear-filters {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* Error and Loading States */
.loading-spinner {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-products, .error-message, .no-products-message {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    margin: 20px auto;
    max-width: 600px;
    border: 2px dashed var(--border-color);
}

.no-products i, .error-message i, .no-products-message i {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}