/* Mobile Filter Button */
.mobile-filter-wrapper {
    margin: 0.7rem;
}
* {
  -webkit-tap-highlight-color: transparent !important;
}
.mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.mobile-filter-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mobile-filter-btn svg {
    transition: transform 0.2s ease;
}

.mobile-filter-btn:hover svg {
    transform: scale(1.1);
}

/* Overlay */
.mobile-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 10000;
    transition: background 0.3s ease;
}

.mobile-filter-overlay.active {
    background: rgba(0, 0, 0, 0.6);
}

/* Popup container */
.mobile-filter-content {
    width: 100%;
    max-width: 500px;
    background: var(--bg);
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-filter-overlay.active .mobile-filter-content {
    transform: translateY(0);
}

/* Filter Header */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.2rem 0.8rem;
    border-bottom: 1px solid var(--border-muted);
}

.filter-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

.close-filter-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-filter-btn:hover {
    background: var(--bg-light);
    color: var(--danger);
}

/* Scrollable area */
.filter-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem;
}

.filter-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.filter-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.filter-scroll-area::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Filter Section */
.filter-section {
    margin-bottom: 1.8rem;
}

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



/* Filter Options Grid - Multi-column layout */
.filter-options-grid {
    display: grid;
    gap: 0.5rem;
}

.size-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* Color: flex wrap with min-width */
.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-grid .filter-option {
    flex: 1 1 120px;
    min-width: 120px;
}

/* Material: 2 columns */
.material-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Filter Options */
.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    border-radius: 6px;
    background: var(--bg-dark);
    border: 1px solid var(--border-muted);
    transition: all 0.2s ease;
    user-select: none;

}
  [data-theme='light'] .filter-option {
    box-shadow: 2px 2px 2px var(--border-muted);


  }


/* Custom Checkboxes & Radios - Match sidebar exactly */
.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-muted);
    border-radius: 4px;
    background-color: #111;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-option input[type="radio"] {
    border-radius: 50%;
}



/* Checked state */
.filter-option input[type="checkbox"]:checked,
.filter-option input[type="radio"]:checked {
    border-color: var(--highlight);
}

.filter-option input[type="checkbox"]:checked::before,
.filter-option input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.filter-option input[type="checkbox"]:checked::before {
    width: 10px;
    height: 10px;
    background-color: var(--secondary);
    border-radius: 2px;
}

.filter-option input[type="radio"]:checked::before {
    width: 10px;
    height: 10px;

    border-radius: 50%;
}

/* Focus state */
.filter-option input[type="checkbox"]:focus,
.filter-option input[type="radio"]:focus {
    outline: 2px solid var(--highlight);
    outline-offset: 2px;
}

.option-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text);
    min-width: 0;
}

.color-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 10px;
    padding: 1rem 1.2rem;

}

.reset-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: var(--bg-light);
    border-color: var(--danger);
    color: var(--danger);
}

.apply-btn {
    flex: 2;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: var(--bg);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-btn:hover {
    background: var(--secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .mobile-filter-overlay {
        align-items: center;
    }
    
    .mobile-filter-content {
        border-radius: 16px;
        max-width: 500px;
        max-height: 85vh;
    }
}

@media (max-width: 380px) {
    .size-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
