/**
 * Product Discovery & Filter System CSS
 */

/* Filter Form */
.ahb-filter-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Active Chips */
.ahb-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ahb-active-filters-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.ahb-active-filters-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ahb-remove-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f1f1f1;
    border: 1px solid #ddd;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.ahb-remove-filter:hover,
.ahb-remove-filter:focus {
    background: #e1e1e1;
    border-color: #ccc;
}

.ahb-clear-all-filters {
    background: none;
    border: none;
    color: #cc0000;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: underline;
}

/* Filter Groups */
.ahb-filter-group {
    border: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.ahb-filter-group-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0;
}

.ahb-filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
}

.ahb-filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Price Inputs */
.ahb-filter-price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ahb-filter-price-inputs input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Loading State */
[aria-busy="true"] {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

[aria-busy="true"]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 2px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: ahb-spin 0.8s linear infinite;
}

@keyframes ahb-spin {
    to { transform: rotate(360deg); }
}

/* Search Suggestions */
.ahb-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 999;
    max-height: 400px;
    overflow-y: auto;
}

.ahb-search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.ahb-search-suggestion-item:last-child {
    border-bottom: none;
}

.ahb-search-suggestion-item:hover,
.ahb-search-suggestion-item:focus {
    background-color: #f9f9f9;
}

.ahb-search-suggestion-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Mobile Actions */
.ahb-filter-header-mobile,
.ahb-mobile-filter-actions {
    display: none;
}

@media (max-width: 768px) {
    .ahb-filter-header-mobile,
    .ahb-mobile-filter-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}
