/* WooCommerce Brands Filter Styles - Clean Version */

.wc-brands-filter-widget {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 15px 0;
    margin-bottom: 20px;
    box-shadow: none;
    color: #000; /* Ensure text is black */
}

.wc-brands-filter-widget .widget-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #000; /* Black text */
    border-bottom: none;
    padding-bottom: 0;
}

/* Search Box */
.brands-search {
    margin-bottom: 20px;
}

.brands-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #fafafa;
    color: #000; /* Black text */
}

.brands-search-input:focus {
    outline: none;
    border-color: #000;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Brands Container */
.brands-filter-container {
    overflow-y: auto;
    margin-bottom: 20px;
    border: none;
    border-radius: 0;
    padding: 0;
}

.brands-filter-container::-webkit-scrollbar {
    width: 6px;
}

.brands-filter-container::-webkit-scrollbar-track {
    background: transparent;
}

.brands-filter-container::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.brands-filter-container::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

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

.filter-section-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    padding: 8px 0;
    transition: color 0.3s ease;
    user-select: none;
    min-height: 40px; /* Ensure enough height for the icon */
}

.filter-section-header:hover {
    color: #000;
}

.toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    line-height: 1;
    text-align: center;
    margin-right: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #000;
    border: 2px solid #000;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: transparent;
    flex-shrink: 0; /* Prevent shrinking */
}

.filter-section-header.active .toggle-icon {
    background: #000;
    color: white;
}

.filter-section-content {
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    opacity: 0;
    padding: 0;
}

.filter-section-content.active {
    max-height: 500px;
    opacity: 1;
    padding: 10px 0 0 0;
}

/* List Style */
.brands-list {
    list-style: none;
    margin: 0;
    padding: 0 10px;
}

.brands-list .brand-item,
.brands-list .category-item {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: none;
}

.brands-list .brand-item:last-child,
.brands-list .category-item:last-child {
    margin-bottom: 0;
}

/* Grid Style */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.brands-grid .brand-item,
.brands-grid .category-item {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 0;
    transition: none;
}

.brands-grid .brand-item:hover,
.brands-grid .category-item:hover {
    background: transparent;
}

/* Brand Labels and Links */
.brand-label,
.category-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.5;
    transition: color 0.3s ease;
    padding: 5px 0;
    color: #000; /* Black text */
}

.brand-label:hover,
.category-label:hover {
    color: #000;
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.5;
    transition: color 0.3s ease;
    padding: 5px 0;
    color: #000; /* Black text */
    width: 100%;
}

.brand-link:hover {
    color: #000;
    text-decoration: none;
}

.brand-checkbox,
.category-checkbox {
    margin-right: 10px;
    margin-top: 0;
    transform: scale(1.1);
    accent-color: #000;
}

.brand-name,
.category-name {
    flex: 1;
    font-weight: 500;
    color: #000; /* Black text */
}

.brand-count,
.category-count {
    color: #666;
    font-size: 13px;
    margin-left: 8px;
    font-weight: normal;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-apply-filter,
.btn-clear-filter {
    flex: 1;
    min-width: 80px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-apply-filter {
    background: #000;
    color: white;
}

.btn-apply-filter:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.btn-clear-filter {
    background: #f8f8f8;
    color: #555;
    border: 1px solid #e0e0e0;
}

.btn-clear-filter:hover {
    background: #f0f0f0;
    border-color: #ccc;
    transform: translateY(-1px);
}

/* Results Container */
.wc-brands-filter-results {
    margin-top: 30px;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: #666;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Products Grid */
.wc-brands-filter-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.wc-brands-filter-product {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.wc-brands-filter-product:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.wc-brands-filter-product .product-image {
    position: relative;
    overflow: hidden;
}

.wc-brands-filter-product .product-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wc-brands-filter-product:hover .product-image img {
    transform: scale(1.05);
}

.wc-brands-filter-product .product-info {
    padding: 20px;
}

.wc-brands-filter-product .product-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.wc-brands-filter-product .product-title a {
    color: #000; /* Black text */
    text-decoration: none;
    transition: color 0.3s ease;
}

.wc-brands-filter-product .product-title a:hover {
    color: #000;
}

.wc-brands-filter-product .product-price {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
}

.wc-brands-filter-product .product-brands {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.wc-brands-filter-product .product-brand {
    background: #f5f5f5;
    color: #666;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Pagination */
.wc-brands-filter-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #000; /* Black text */
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 45px;
}

.pagination-btn:hover {
    background: #f8f8f8;
    border-color: #ccc;
}

.pagination-btn.active {
    background: #000;
    color: white;
    border-color: #000;
}

/* Empty State */
.no-products-found,
.wc-brands-filter-empty {
    text-align: center;
    padding: 40px 20px;
    color: #000; /* Black text */
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wc-brands-filter-widget {
        padding: 10px 0;
    }
    
    .brands-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .filter-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-apply-filter,
    .btn-clear-filter {
        width: 100%;
    }
    
    .wc-brands-filter-products {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .brands-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .wc-brands-filter-products {
        grid-template-columns: 1fr;
    }
    
    .pagination-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}


/* Accessibility improvements */
.brand-checkbox:focus,
.category-checkbox:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.btn-apply-filter:focus,
.btn-clear-filter:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.brands-search-input:focus {
    outline: none; /* We're using box-shadow instead */
}

/* Animation for smooth transitions */
.brand-item,
.category-item {
    transition: opacity 0.3s ease;
}

.brand-item.hidden,
.category-item.hidden {
    opacity: 0.3;
    pointer-events: none;
}