/* Filter Button */
.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #085DC5;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-left: 12px;
}

.filter-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

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

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Filter Modal */
.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    overflow-y: auto;
}

.filter-modal.active {
    display: block;
}

.filter-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.filter-modal-content {
    position: relative;
    max-width: 800px;
    width: 90%;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    z-index: 10000;
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.filter-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.filter-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.filter-modal-close i {
    font-size: 20px;
}

.filter-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.filter-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

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

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

.filter-form-group {
    margin-bottom: 16px;
}

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

.filter-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
}

.filter-select {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2364748b' d='M8 10L3 5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.filter-select:focus {
    outline: none;
    border-color: #085DC5;
    box-shadow: 0 0 0 3px rgba(8, 93, 197, 0.1);
}

.filter-select:disabled {
    background-color: #f8f9fa;
    color: #94a3b8;
    cursor: not-allowed;
}

.filter-checkbox-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-checkbox:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #085DC5;
}

.filter-checkbox input[type="checkbox"]:checked + span {
    color: #085DC5;
    font-weight: 600;
}

.filter-checkbox span {
    font-size: 14px;
    color: #475569;
    transition: all 0.2s ease;
}

.filter-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    gap: 12px;
}

.filter-reset-btn {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-reset-btn:hover {
    background: #f8f9fa;
    border-color: #cbd5e1;
    color: #1e293b;
}

.filter-apply-btn {
    flex: 1;
    padding: 12px 24px;
    background: #085DC5;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-apply-btn:hover {
    background: #064a9a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 93, 197, 0.3);
}

/* Loading State */
.filter-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
    color: #64748b;
}

.filter-loading i {
    font-size: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Price Filter */
.filter-price-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-price-inputs {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.filter-price-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-price-label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.filter-price-input {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
    transition: all 0.2s ease;
}

.filter-price-input:focus {
    outline: none;
    border-color: #085DC5;
    box-shadow: 0 0 0 3px rgba(8, 93, 197, 0.1);
}

.filter-price-separator {
    display: flex;
    align-items: center;
    padding-bottom: 8px;
    color: #64748b;
    font-size: 18px;
}

.filter-price-slider-wrapper {
    position: relative;
    padding: 20px 0;
}

.filter-price-slider-container {
    position: relative;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
}

.filter-price-range {
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    pointer-events: none;
    z-index: 2;
}

.filter-price-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border: 2px solid #085DC5;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: grab;
    pointer-events: all;
    position: relative;
    z-index: 3;
}

.filter-price-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ffffff;
    border: 2px solid #085DC5;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: grab;
    pointer-events: all;
    position: relative;
    z-index: 3;
    -moz-appearance: none;
}

.filter-price-range:active::-webkit-slider-thumb {
    cursor: grabbing;
}

.filter-price-range:active::-moz-range-thumb {
    cursor: grabbing;
}

.filter-price-slider-track {
    position: absolute;
    height: 6px;
    background: #085DC5;
    border-radius: 3px;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-modal-content {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .filter-checkbox-group {
        grid-template-columns: 1fr;
    }

    .search-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-btn {
        margin-left: 0;
        margin-top: 12px;
        width: 100%;
        justify-content: center;
    }
}

