/**
 * Baro Product Filter - Frontend Styles
 * 
 * @package BaroProductFilter
 * @since 1.0.0
 */

/* Product Category Filter */
.product-category-filter {
    margin-bottom: 20px;
}

.category-dropdown {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.parent-category {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.category-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    display: inline-block;
    padding: 5px 0;
}

.category-link:hover {
    color: #0073aa;
}

.child-categories {
    list-style: none;
    padding-left: 20px;
    margin-top: 10px;
}

.child-categories li {
    margin-bottom: 5px;
}

.child-link {
    font-weight: normal;
    font-size: 14px;
    color: #666;
}

.count {
    color: #999;
    font-size: 12px;
    margin-left: 5px;
}

/* Checkbox Styles */
.checkbox-filter {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.filter-header h4 {
    margin: 0;
    color: #333;
}

.clear-filters {
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.clear-filters:hover {
    background: #d32f2f;
}

.checkbox-form {
    /* Removed max-height and overflow to show all items */
}

.checkbox-group {
    margin-bottom: 12px;
}

.parent-group {
    border-left: 3px solid #0073aa;
    padding-left: 10px;
    margin-bottom: 15px;
}

.parent-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.collapse-toggle {
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
}

.collapse-toggle:hover {
    background: #f0f0f0;
}

.child-checkboxes.collapsed {
    display: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    position: relative;
    user-select: none;
}

.parent-label {
    font-weight: 600;
    color: #333;
}

.child-label {
    font-weight: normal;
    color: #666;
    padding-left: 20px;
    font-size: 14px;
}

.category-checkbox {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label:hover .checkmark {
    border-color: #0073aa;
}

.category-checkbox:checked + .checkmark {
    background-color: #0073aa;
    border-color: #0073aa;
}

.category-checkbox:checked + .checkmark:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-item {
    margin-bottom: 8px;
}

.child-checkboxes {
    margin-left: 15px;
    padding-left: 15px;
    border-left: 2px solid #eee;
}

.filter-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.apply-filters {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 10px;
    width: 100%;
}

.apply-filters:hover {
    background: #005a87;
}

.selected-categories {
    font-size: 12px;
    color: #666;
}

.selected-text {
    font-weight: 600;
}

.selected-list {
    color: #0073aa;
}

/* AJAX Category Filter */
.category-buttons {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.category-btn:hover,
.category-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Bi Quyet Mai Filter */
.bi-quyet-mai-filter .child-checkboxes {
    margin-left: 15px;
    padding-left: 15px;
    border-left: 2px solid #eee;
    transition: all 0.3s ease;
    max-height: 1000px;
    overflow: hidden;
}

.bi-quyet-mai-filter .child-checkboxes.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    opacity: 0;
}

.bi-quyet-mai-filter .collapse-toggle {
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.bi-quyet-mai-filter .collapse-toggle:hover {
    background: #f0f0f0;
}

.bi-quyet-mai-filter .collapse-toggle.collapsed .toggle-icon {
    transform: rotate(45deg);
}

.bi-quyet-mai-filter .all-group {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.bi-quyet-mai-filter .all-label {
    font-weight: 600;
    color: #333;
}

/* Product Count Filter */
.product-count-wrapper {
    margin: 15px 0;
    font-size: 1rem;
    color: #000;
}

.product-count-wrapper .count-number {
    color: #000;
    font-weight: 600;
}

.product-count-bold .count-number {
    font-weight: 700;
    color: #333;
}

.product-count-highlight {
    background: #f5f5f5;
    padding: 10px 15px;
    border-radius: 4px;
    display: inline-block;
}

.product-count-highlight .count-number {
    color: #0073aa;
    font-weight: 600;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.product-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.product-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.product-item h3 {
    margin: 10px 0;
    font-size: 16px;
    color: #333;
}

.product-item .price {
    font-weight: 600;
    color: #0073aa;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .checkbox-filter {
        padding: 15px;
    }
    
    .category-buttons {
        flex-direction: column;
    }
    
    .category-btn {
        width: 100%;
        text-align: left;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .clear-filters {
        width: 100%;
    }
} 