/**
 * CSS cho Custom Taxonomy Filter Widget - THIẾT KẾ THEO HÌNH MẪU
 * Lưu file này trong thư mục /css/custom-taxonomy-filter.css
 */

.filter-custom-taxonomy-product {
    margin-bottom: 20px;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
}

/* Spacing giữa các taxonomy sections */
.filter-custom-taxonomy-product .taxonomy-filter-section {
    padding: 0;
    margin-bottom: 0;
}

.filter-custom-taxonomy-product .widgettitle {
    background: #333333;
    color: #ffffff;
    margin: 0;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 0;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
}

.filter-custom-taxonomy-product .taxonomy-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--colorMain2);
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

/* Style cho từng item theo hình mẫu */
.filter-custom-taxonomy-product .filter-item {
    border-bottom: 1px solid #e5e5e5;
    transition: background-color 0.2s ease;
    background: #fff;
}

.filter-custom-taxonomy-product .filter-item:last-child {
    border-bottom: none;
}

.filter-custom-taxonomy-product .filter-item:hover {
    background-color: #f8f8f8;
}

/* Checked state - màu xanh nhẹ giống hình mẫu */
.filter-custom-taxonomy-product .filter-item.checked {
    background-color: #e8f4fd;
}
#filter-product {
  margin-top: 10px;
}
.filter-custom-taxonomy-product .filter-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    transition: all 0.2s ease;
    margin: 0;
    width: 100%;
    font-weight: normal;
}

.filter-custom-taxonomy-product .filter-label:hover {
    color: var(--colorMain2);
}

/* Checkbox style */
.filter-custom-taxonomy-product .filter-checkbox {
    margin: 0 10px 0 0;
    transform: scale(1.1);
    accent-color: var(--colorMain2);
    flex-shrink: 0;
}

.filter-custom-taxonomy-product .filter-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex: 1;
}

/* Count number giống hình mẫu */
.filter-custom-taxonomy-product .product-count {
    color: #666;
    font-size: 12px;
    font-weight: normal;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    flex-shrink: 0;
}

/* Checked state cho text và count */
.filter-custom-taxonomy-product .filter-item.checked .filter-label {
    color: #000;
    font-weight: 500;
}

.filter-custom-taxonomy-product .filter-item.checked .product-count {
    background: var(--colorMain2);
    color: #fff;
}

/* Loading state */
.filter-custom-taxonomy-product.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.filter-custom-taxonomy-product.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--colorMain2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Clear filters button */
.filter-custom-taxonomy-product .clear-filters {
    padding: 10px 20px;
    background: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
    text-align: center;
}

.filter-custom-taxonomy-product .clear-all-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s ease;
}

.filter-custom-taxonomy-product .clear-all-btn:hover {
    background: #c82333;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-custom-taxonomy-product .widgettitle {
        font-size: 13px;
        padding: 12px 15px;
        cursor: pointer;
        position: relative;
    }
    
    .filter-custom-taxonomy-product .widgettitle:after {
        content: '+';
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 18px;
        line-height: 1;
    }
    
    .filter-custom-taxonomy-product .widgettitle.collapsed:after {
        content: '−';
    }
    
    .filter-custom-taxonomy-product .filter-label {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .filter-custom-taxonomy-product .product-count {
        font-size: 11px;
        padding: 1px 5px;
    }
    
    .filter-custom-taxonomy-product .taxonomy-filter-list {
        display: none; /* Ẩn mặc định trên mobile */
    }
    
    .filter-custom-taxonomy-product .taxonomy-filter-list.show {
        display: block;
    }
}

/* Custom scrollbar cho danh sách dài */
.filter-custom-taxonomy-product .taxonomy-filter-list {
    max-height: 250px;
    overflow-y: auto;
}

.filter-custom-taxonomy-product .taxonomy-filter-list::-webkit-scrollbar {
    width: 4px;
}

.filter-custom-taxonomy-product .taxonomy-filter-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.filter-custom-taxonomy-product .taxonomy-filter-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.filter-custom-taxonomy-product .taxonomy-filter-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Focus states cho accessibility */
.filter-custom-taxonomy-product .filter-checkbox:focus {
    outline: 2px solid var(--colorMain2);
    outline-offset: 2px;
}

.filter-custom-taxonomy-product .filter-label:focus-within {
    box-shadow: inset 0 0 0 2px var(--colorMain2);
}
.filter-custom-taxonomy-product .taxonomy-filter-section:last-child {
  margin-bottom: 20px;
}