/* Container */
.agf-container {
    margin-bottom: 40px;
    font-family: inherit;
}

/* Top Bar: Heading, Tags, Count & Button */
.agf-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}
.agf-top-bar h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}
.agf-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1; 
}
.agf-top-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.agf-apply-btn {
    background-color: #222;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}
.agf-apply-btn:hover {
    background-color: #444;
}
.agf-product-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Active Tags */
.agf-active-tag {
    background: #f1f1f1;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    color: #444;
}
.agf-active-tag:hover {
    background: #e2e2e2;
}
.agf-active-tag .remove {
    font-style: normal;
    font-weight: bold;
    color: #888;
}
.agf-clear-all {
    font-size: 13px;
    color: #6F4086;
    cursor: pointer;
    text-decoration: underline;
    align-self: center;
    margin-left: 10px;
}

/* Filter Bar Frame */
.agf-filter-bar {
    display: flex;
    align-items: center;
    width: 100%;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    background: transparent;
}

/* Individual Dropdown (Equally Spaced) */
.agf-dropdown {
    position: relative;
    flex: 1; 
    border-right: 1px solid #ddd;
}
.agf-dropdown:last-child {
    border-right: none;
}

/* Dropdown Button */
.agf-dropdown-toggle {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: #444;
    font-weight: 500;
    user-select: none;
    transition: background 0.2s;
}
.agf-dropdown-toggle:hover {
    background: #f9f9f9;
}
.agf-dropdown-toggle::after {
    content: '▼';
    font-size: 10px;
    color: #888;
    transition: transform 0.3s;
}
.agf-dropdown.active .agf-dropdown-toggle::after {
    transform: rotate(180deg);
}

/* Dropdown Menu & Checkboxes */
.agf-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: -1px;
    width: calc(100% + 2px); 
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 999;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.agf-dropdown.active .agf-dropdown-menu {
    display: block;
}
.agf-checkbox-list {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Checkbox Items & Count Capsule */
.agf-checkbox-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 8px;
    font-size: 14px;
    color: #444;
    cursor: pointer;
}
.agf-checkbox-item input {
    margin: 0;
    cursor: pointer;
}

.agf-term-name {
    flex-grow: 1; 
    padding-left: 8px;
}

.agf-term-count {
    background-color: #f1f1f1;
    color: #555;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

/* Disabled Filters */
.agf-dropdown.agf-disabled {
    opacity: 0.4;
    pointer-events: none;
    background-color: #f7f7f7;
}

.agf-dropdown.agf-disabled .agf-dropdown-toggle {
    color: #999;
}

/* Disabled Dropdown Options (Cross-Filtering) */
.agf-checkbox-item.agf-disabled-item {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
}
.agf-checkbox-item.agf-disabled-item input {
    pointer-events: none;
}
.agf-disabled-item .agf-term-count {
    background-color: #f9f9f9;
    color: #bbb;
}

/* AJAX Loading State */
.agf-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}