/* ================================================================
   filtro-produtos.css
   Painel lateral de filtros + range duplo + badges de tipo
   Compatível com a estrutura .filtro-layout > aside + .filtro-conteudo
   ================================================================ */

/* ── Layout principal: sidebar + grid ── */
.filtro-layout {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.produto-card.oculto {
    display: none !important;
}

/* ── Painel lateral ── */
.filtro-panel {
    width: 240px;
    flex-shrink: 0;
    background: #f8f9fb;
    border: 1px solid #e2e5ea;
    border-radius: 12px;
    padding: 1.25rem;

    position: sticky;
    top: 90px;

    max-height: calc(100vh - 110px);
    overflow-y: auto;

    scrollbar-width: thin;
}

.filtro-panel::-webkit-scrollbar {
    width: 8px;
}

.filtro-panel::-webkit-scrollbar-thumb {
    background: #c9ced8;
    border-radius: 999px;
}

.filtro-panel::-webkit-scrollbar-thumb:hover {
    background: #aeb5c2;
}

.filtro-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.filtro-titulo {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #1a2540;
}

.filtro-limpar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: #2563eb;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
}

.filtro-limpar:hover {
    color: #1d4ed8;
}

/* ── Grupos de filtro ── */
.filtro-grupo {
    border-top: 1px solid #e2e5ea;
    padding: 1rem 0 0.5rem;
    margin-bottom: 0.25rem;
}

.filtro-grupo-scroll {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;

    max-height: 220px;
    overflow-y: auto;
    padding-right: 6px;

    scrollbar-width: thin;
}

.filtro-grupo-scroll::-webkit-scrollbar {
    width: 6px;
}

.filtro-grupo-scroll::-webkit-scrollbar-thumb {
    background: #c9ced8;
    border-radius: 999px;
}

.filtro-grupo-scroll::-webkit-scrollbar-thumb:hover {
    background: #aeb5c2;
}

.filtro-grupo-titulo {
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.75rem;
}

/* ── Checkboxes ── */
.filtro-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    padding: 0.25rem 0;
    border-radius: 6px;
    transition: color 0.15s;
}

.filtro-check:hover {
    color: #1a2540;
}

.filtro-check input[type="checkbox"] {
    accent-color: #1a2540;
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Range duplo ── */
.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.range-wrapper {
    position: relative;
    height: 6px;
    background: linear-gradient(to right,
            #e2e5ea var(--pct-min, 0%),
            #1a2540 var(--pct-min, 0%),
            #1a2540 var(--pct-max, 100%),
            #e2e5ea var(--pct-max, 100%));
    border-radius: 4px;
    margin: 1.25rem 0 0.75rem;
}

.range-input {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
}

/* Thumb */
.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1a2540;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.12s;
}

.range-input::-webkit-slider-thumb:hover,
.range-input:focus::-webkit-slider-thumb {
    transform: scale(1.15);
}

.range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1a2540;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    pointer-events: all;
}

/* ── Área de conteúdo / grid ── */
.filtro-conteudo {
    flex: 1;
    min-width: 0;
}

/* ── Topbar (contador + toggle mobile) ── */
.filtro-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.filtro-contador {
    font-size: 0.85rem;
    color: #6b7280;
}

.btn-toggle-filtro {
    display: none;
    /* visível apenas no mobile */
    gap: 0.4rem;
    align-items: center;
    background: #1a2540;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-toggle-filtro:hover {
    background: #253060;
}

/* ── Badge de tipo nos cards ── */
.badge-tipo {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── Mensagem sem resultado ── */
.sem-resultado {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
    padding: 2.5rem 0;
    font-size: 0.95rem;
}

/* ================================================================
   Responsivo — Mobile
   ================================================================ */
@media (max-width: 768px) {

    .filtro-layout {
        flex-direction: column;
        gap: 0;
        padding: 0 1rem 2rem;
    }

    /* No mobile, o painel flutua como overlay */
    .filtro-panel {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100dvh;
        border-radius: 0 12px 12px 0;
        overflow-y: auto;
        z-index: 1000;
        transition: left 0.25s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
        background: #fff;
    }

    .filtro-panel.aberto {
        left: 0;
    }

    .btn-toggle-filtro {
        display: flex;
    }

    .filtro-conteudo {
        width: 100%;
    }
}