/* Mobile-first approach */
.mobile-filter-toggle {
    display: block;
    width: 100%;
    background: #1f69a7;
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    margin-bottom: 10px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-filter-toggle:hover {
    background: #34495e;
    color: white;
}

.mobile-filter-toggle .toggle-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.mobile-filter-toggle.active .toggle-icon {
    transform: translateY(-50%) rotate(180deg);
}

.mobile-filters-container {
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.filters-content {
    display: none;
    padding: 0;
    max-height: 80vh;
    overflow-y: auto;
}

.filters-content.show {
    display: block;
}

/* Mobile styles */
@media (max-width: 767px) {
    .width-third {
        width: 100% !important;
        display: block !important;
        float: none !important;
    }
    
    .mobile-hidden {
        display: block !important;
    }

    .left-sidebar {
        padding: 0;
    }

    .panel-group {
        margin-bottom: 10px;
    }

    .panel-default {
        border: 1px solid #ddd;
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .panel-heading {
        background: #f5f5f5;
        border-bottom: 1px solid #ddd;
        padding: 10px 15px;
    }

    .panel-body {
        padding: 10px 15px;
    }

    .form-control {
        height: 34px;
        font-size: 14px;
    }

    .checkbox-block {
        margin: 5px 0;
        font-size: 14px;
    }

    .panel-title {
        font-size: 14px;
        font-weight: bold;
    }

    .mobile-filter-toggle {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    /* Remove any container width restrictions on mobile */
    .mobile-filters-container {
        width: 100%;
        margin: 0;
        padding: 0;
    }
}

/* Desktop styles - CRITICAL CHANGES HERE */
@media (min-width: 768px) {
    .mobile-filter-toggle {
        display: none;
    }
    
    .filters-content {
        display: block !important;
    }

    .mobile-filters-container {
        box-shadow: none;
        background: transparent;
        width: 30%;
        float: left; /* Keep filters on the left */
        margin-right: 0;
        padding-right: 15px;
    }

    /* Clear any floats that might interfere */
    .mobile-filters-container::after {
        content: "";
        display: table;
        clear: both;
    }

    /* Ensure left sidebar doesn't have conflicting styles */
    .left-sidebar {
        width: 100%;
        float: none;
        margin: 0;
        padding: 0;
    }

    /* Make sure filters don't take full width on desktop */
    .filters-content {
        width: 100%;
        max-height: none;
        overflow-y: visible;
    }
}

/* Filter sections styling */
.filter-section {
    border-bottom: 1px solid #eee;
}

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

.show-more {
    color: #337ab7;
    text-decoration: none;
    font-size: 12px;
}

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

.count {
    color: #999;
    font-size: 12px;
}

/* Category search styling */
#categorySearch {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
}

/* Reset button styling */
#resetFilters {
    background: #d9534f;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
}

#resetFilters:hover {
    background: #c9302c;
}

/* Badge styling */
.badge {
    background: #337ab7;
}

/* Icon styling */
.icon {
    margin-right: 8px;
}

/* Additional fix for product list container */
.products-container {
    width: 75%; /* Adjust based on your filter width */
    float: left;
    padding-left: 15px;
}

@media (max-width: 767px) {
    .products-container {
        width: 100%;
        float: none;
        padding-left: 0;
    }
}