/* 
 * PadniSi Design System - Facets & Sidebar
 * ----------------------------------------
 * Styles for filtering sidebars and facet options.
 */

.sidebar-panel {
    background: rgb(231, 239, 247);
    padding: 15px;
    border-radius: 0;
    border: 1px solid #cbd5e1;
    height: fit-content;
}

.facet-group {
    margin-bottom: 15px;
    border-bottom: 2px solid white;
    padding-bottom: 12px;
}

.facet-group:last-child {
    border-bottom: none;
}

.facet-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: capitalize;
}

.facet-options {
    list-style: none;
    padding: 0;
}

.facet-option {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--dark-light);
    transition: all 0.2s;
    font-weight: 500;
}

.facet-option span {
    font-weight: 600;
    color: #4a5568;
}

.facet-checkbox {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
    border-width: 2px;
}

.facet-checkbox.active {
    color: rgb(52, 152, 219);
    border-color: rgb(52, 152, 219);
}

.facet-option:hover .facet-checkbox {
    border-color: rgb(52, 152, 219);
}

.facet-option.active {
    color: rgb(52, 152, 219) !important;
    font-weight: 700;
}

.facet-option.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.quick-filters-list {
    display: grid;
    gap: 8px;
}

.quick-filter-option {
    width: 100%;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12.5px;
    line-height: 1.2;
    text-align: left;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
    overflow: hidden;
}

.quick-filter-checkbox {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    accent-color: #2563eb;
}

.quick-filter-option i {
    width: 16px;
    flex: 0 0 16px;
    color: var(--secondary-dark);
    text-align: center;
}

.quick-filter-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-filter-option:hover,
.quick-filter-option.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

/* Sidebar Input Scoped Styles */
.sidebar-panel .form-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--dark);
    background: white;
    transition: border-color 0.2s;
}

.sidebar-panel .form-input:focus {
    outline: none;
    border-color: #3498db;

    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Attribute filters (structured attributes, Phase 4) */
.attribute-filters {
    display: grid;
    gap: 6px;
}

.attr-filter {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.attr-filter-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 12.5px;
    color: #1f2937;
    text-align: left;
}

.attr-filter-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attr-filter-badge {
    background: #2563eb;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    flex-shrink: 0;
}

.attr-filter-chevron {
    font-size: 10px;
    color: #64748b;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.attr-filter.expanded .attr-filter-chevron {
    transform: rotate(180deg);
}

.attr-filter-body {
    display: none;
    padding: 4px 10px 10px;
}

.attr-filter.expanded .attr-filter-body {
    display: block;
}

.attr-option-search {
    width: 100%;
    padding: 6px 8px;
    margin-bottom: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12.5px;
    font-family: inherit;
}

.attr-option-search:focus {
    outline: none;
    border-color: #3498db;
}

.attr-filter-options {
    display: grid;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
}

.attr-filter-option,
.attr-bool-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: #1f2937;
    cursor: pointer;
    margin: 0;
    line-height: 1.3;
}

.attr-bool-option {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    padding: 9px 10px;
    font-weight: 700;
}

.attr-filter-option input[type="checkbox"],
.attr-bool-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    accent-color: #2563eb;
}

.attr-option-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attr-option-count {
    margin-left: auto;
    font-size: 11px;
    color: #64748b;
    flex-shrink: 0;
}

.attr-option-empty {
    opacity: 0.45;
}

.attr-show-toggle {
    background: none;
    border: none;
    padding: 6px 0 0;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.attr-range-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.attr-range-input {
    width: 0;
    flex: 1 1 auto;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12.5px;
    font-family: inherit;
}

.attr-range-input:focus {
    outline: none;
    border-color: #3498db;
}

.attr-range-separator {
    color: #64748b;
    flex-shrink: 0;
}

.attr-range-unit {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    flex-shrink: 0;
}

/* Category facet chips above text-search results */
.category-facet-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.category-facet-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #1f2937;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.category-facet-chip:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.category-facet-chip .chip-count {
    font-weight: 600;
    color: #64748b;
}

.category-facet-chip:hover .chip-count {
    color: #1d4ed8;
}

/* Shared Count Badge */
.count-badge {
    margin-left: auto;
    font-size: 11px;
    color: var(--dark);
    background: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}
