/**
 * LojaVirtual - Sidebar Filters Stylesheet
 * Redesign moderno e limpo
 */

/* ============================================================
   SIDEBAR CONTAINER
   ============================================================ */
.filters-sidebar {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.03);
    overflow: hidden;
    position: sticky;
    top: 20px;
}

/* Header (mobile) */
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f5;
    background: #fafbfc;
}
.filters-header h5 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a1a2e;
}
.filters-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f5;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.filters-close:hover { background: #e74a3b; color: #fff; }

/* ============================================================
   FILTER SECTIONS
   ============================================================ */
.filter-section {
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f8;
}
.filter-section:last-child { border-bottom: none; }

.filter-title {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 14px;
    cursor: pointer;
    user-select: none;
    padding: 0;
    border: none;
    background: none;
    width: 100%;
}
.filter-title:hover { color: #4e73df; }
.collapse-icon {
    font-size: 12px;
    margin-left: auto;
    transition: transform .25s ease;
    color: #aaa;
}
.filter-title[aria-expanded="false"] .collapse-icon,
.filter-title.collapsed .collapse-icon {
    transform: rotate(-90deg);
}
.filter-title[aria-expanded="true"] .collapse-icon { transform: rotate(0deg); }

.filter-body { padding-top: 2px; }

/* ============================================================
   ACTIVE FILTERS
   ============================================================ */
.active-filters {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f3ff 100%);
    border-bottom: 2px solid #e0e6ff !important;
}
.active-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.active-filters-label {
    font-size: 12px;
    font-weight: 700;
    color: #4e73df;
    text-transform: uppercase;
    letter-spacing: .4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.active-filters-label i { font-size: 13px; }
.clear-all-filters {
    font-size: 11px;
    color: #e74a3b;
    font-weight: 600;
    text-decoration: none;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(231,74,59,.08);
    transition: all .15s;
}
.clear-all-filters:hover { background: rgba(231,74,59,.15); text-decoration: none; color: #c0392b; }

.active-filter-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #d0d8ff;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #4e73df;
    box-shadow: 0 1px 2px rgba(78,115,223,.1);
}
.filter-tag .remove-tag {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(78,115,223,.12);
    color: #4e73df;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    padding: 0;
    line-height: 1;
    transition: all .15s;
}
.filter-tag .remove-tag:hover { background: #4e73df; color: #fff; }

/* ============================================================
   SUBCATEGORY LIST
   ============================================================ */
.subcategory-list { list-style: none; padding: 0; margin: 0; }
.subcategory-list li { margin-bottom: 1px; }
.subcategory-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    font-size: 13px;
    color: #555;
    border-radius: 8px;
    transition: all .15s;
    text-decoration: none;
}
.subcategory-list a:hover { background: #f0f2ff; color: #4e73df; }
.subcategory-list a.active { background: #eef1ff; color: #4e73df; font-weight: 600; }
.subcategory-list span { font-size: 11px; color: #bbb; }

/* ============================================================
   PRICE RANGE SLIDER (noUiSlider)
   ============================================================ */
.price-range-slider { padding: 10px 8px 4px; margin-bottom: 10px; }

.price-range-values {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.price-input-group {
    display: flex;
    align-items: center;
    flex: 1;
    background: #f5f6fa;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .15s;
}
.price-input-group:focus-within { border-color: #4e73df; background: #fff; }
.price-input-prefix {
    padding: 0 6px 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    flex-shrink: 0;
}
.price-input-group input {
    width: 100%;
    padding: 7px 8px 7px 2px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    outline: none;
    background: transparent;
    color: #1a1a2e;
    -moz-appearance: textfield;
}
.price-input-group input::-webkit-inner-spin-button,
.price-input-group input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.price-separator {
    font-size: 12px;
    color: #bbb;
    font-weight: 600;
    flex-shrink: 0;
}

/* noUiSlider overrides */
.noUi-target { height: 5px; border: none; box-shadow: none; background: #e8eaf0; border-radius: 3px; }
.noUi-connect { background: linear-gradient(90deg, #4e73df, #667eea); border-radius: 3px; }
.noUi-handle {
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 3px solid #4e73df !important;
    box-shadow: 0 2px 8px rgba(78,115,223,.25) !important;
    top: -7px !important;
    right: -9px !important;
    cursor: grab !important;
    transition: box-shadow .15s;
}
.noUi-handle::before, .noUi-handle::after { display: none; }
.noUi-handle:hover { box-shadow: 0 2px 12px rgba(78,115,223,.4) !important; }
.noUi-handle:active { cursor: grabbing !important; border-color: #3a5bc7 !important; }

/* Quick price buttons */
.price-quick-ranges { display: flex; flex-wrap: wrap; gap: 6px; }
.price-quick-btn {
    padding: 5px 12px;
    border: 1px solid #e8eaf0;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: #666;
    background: #fafbfc;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.price-quick-btn:hover,
.price-quick-btn.active {
    border-color: #4e73df;
    color: #4e73df;
    background: #eef2ff;
}

/* ============================================================
   SEARCH IN FILTERS
   ============================================================ */
.filter-search-input {
    position: relative;
    margin-bottom: 12px;
}
.filter-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #bbb;
    pointer-events: none;
}
.filter-search {
    width: 100%;
    padding: 7px 10px 7px 30px;
    border: 1px solid #e8eaf0;
    border-radius: 8px;
    font-size: 12px;
    background: #fafbfc;
    transition: all .15s;
}
.filter-search:focus { border-color: #4e73df; background: #fff; box-shadow: 0 0 0 3px rgba(78,115,223,.1); }
.filter-search::placeholder { color: #ccc; }

/* ============================================================
   CHECKBOX LIST (Brands, Attributes, Conditions)
   ============================================================ */
.filter-checkbox-list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-right: 4px;
}
.filter-checkbox-list::-webkit-scrollbar { width: 3px; }
.filter-checkbox-list::-webkit-scrollbar-track { background: transparent; }
.filter-checkbox-list::-webkit-scrollbar-thumb { background: #d1d3e2; border-radius: 4px; }

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: background .15s;
    font-size: 13px;
    color: #444;
}
.filter-checkbox:hover { background: #f5f6fa; }
.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4e73df;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
}
.filter-checkbox input[type="checkbox"]:checked ~ .label-text { color: #1a1a2e; font-weight: 600; }
.checkmark { display: none; }
.label-text {
    flex: 1;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}
.label-text i { font-size: 14px; }
.count { font-size: 11px; color: #bbb; margin-left: auto; font-weight: 500; }

/* ============================================================
   COLOR GRID
   ============================================================ */
.filter-color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px 8px;
    justify-items: center;
}
.filter-color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: transform .1s;
}
.filter-color-item:hover { transform: translateY(-2px); }
.filter-color-item input[type="checkbox"] { display: none; }

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all .2s;
    position: relative;
    display: block;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.color-swatch .color-border {
    position: absolute;
    inset: -1px;
    border: 1px solid #ddd;
    border-radius: 50%;
}
.filter-color-item input:checked + .color-swatch {
    border-color: #4e73df;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #4e73df;
    transform: scale(1.1);
}
.color-name {
    font-size: 10px;
    color: #888;
    text-align: center;
    max-width: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}
.filter-color-item input:checked ~ .color-name { color: #4e73df; font-weight: 600; }

/* ============================================================
   SIZE CHIPS (novo: grid de botões para tamanhos)
   ============================================================ */
.filter-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.filter-size-chip {
    cursor: pointer;
    display: block;
}
.filter-size-chip input[type="checkbox"] { display: none; }
.size-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid #e0e3ea;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    background: #fafbfc;
    transition: all .15s;
    text-align: center;
}
.filter-size-chip:hover .size-label {
    border-color: #4e73df;
    color: #4e73df;
    background: #f0f3ff;
}
.filter-size-chip input:checked + .size-label {
    background: #4e73df;
    color: #fff;
    border-color: #4e73df;
    box-shadow: 0 2px 6px rgba(78,115,223,.3);
}

/* ============================================================
   RATING LIST
   ============================================================ */
.filter-rating-list { display: flex; flex-direction: column; gap: 2px; }
.filter-rating-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.filter-rating-item:hover { background: #f8f9fc; }
.filter-rating-item input[type="radio"] { display: none; }
.filter-rating-item input:checked ~ .rating-stars-filter i.bi-star-fill { transform: scale(1.15); }
.filter-rating-item input:checked ~ .rating-text { font-weight: 700; color: #1a1a2e; }

.rating-stars-filter { display: flex; gap: 2px; }
.rating-stars-filter i { font-size: 14px; color: #f6c23e; transition: transform .15s; }
.rating-stars-filter i.bi-star { color: #e0e0e0; }
.rating-text { font-size: 12px; color: #888; }

/* ============================================================
   FILTER ACTIONS (Apply)
   ============================================================ */
.filter-actions {
    padding: 16px 20px;
    background: #fafbfc;
    border-top: 1px solid #f0f0f5;
}
.filter-actions .btn {
    font-size: 13px;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 10px;
    letter-spacing: .3px;
    transition: all .2s;
}
.filter-actions .btn-primary {
    background: linear-gradient(135deg, #4e73df 0%, #667eea 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(78,115,223,.3);
}
.filter-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(78,115,223,.4);
}

/* ============================================================
   MOBILE FILTERS
   ============================================================ */
@media (max-width: 991.98px) {
    .filters-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 380px;
        height: 100%;
        z-index: 1050;
        border-radius: 0 16px 16px 0;
        overflow-y: auto;
        background: #fff;
        box-shadow: 4px 0 30px rgba(0,0,0,.15);
        transform: translateX(-100%);
        transition: transform .3s ease;
    }
    .filters-sidebar.show {
        display: block;
        transform: translateX(0);
    }
    .filters-header { display: flex !important; }
}
