/* ============================================================
   Brand Filter Widget — brand-filter.css  v1.0.2
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.bfw-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

/* ── Viewport (área visível do carrossel) ────────────────── */
.bfw-viewport {
    flex: 1 1 0% !important;
    min-width: 0 !important;   /* impede que o flex item estoure o wrapper */
    overflow: hidden !important;
    position: relative;
}

/* ── Track (fita de itens) ───────────────────────────────── */
.bfw-track {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 12px;
    list-style: none !important;
    margin: 0 !important;
    padding: 4px 2px !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* ── Item de marca ───────────────────────────────────────── */
.bfw-brand-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px;
    padding: 8px 18px !important;
    background-color: #f5f5f5;
    border-radius: 40px;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
    user-select: none;
    border: 1px solid transparent !important;
    text-decoration: none !important;
    color: #333;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
}

.bfw-brand-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.bfw-brand-item.is-active {
    background-color: #111111 !important;
    color: #ffffff !important;
}

.bfw-brand-item.is-active .bfw-brand-logo {
    filter: brightness(0) invert(1);
}

/* ── Logo da marca ───────────────────────────────────────── */
.bfw-brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block !important;
    flex-shrink: 0;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    box-sizing: border-box;
}

/* ── Label e contagem ────────────────────────────────────── */
.bfw-brand-label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.2;
    display: inline !important;
}

.bfw-brand-count {
    font-weight: 400;
    opacity: 0.65;
    font-size: 12px;
    margin-left: 2px;
}

/* ── Setas de navegação ──────────────────────────────────── */
/*
 * Máxima especificidade para sobrepor resets de tema.
 * Temas frequentemente fazem: button { display: block; width: 100%; ... }
 * Por isso usamos !important nas propriedades estruturais.
 */
.bfw-wrapper .bfw-arrow {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50% !important;
    background-color: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease,
        visibility 0.2s ease !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10) !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    outline: none;
    position: relative !important;
    z-index: 2;
    /* Garante visibilidade por padrão */
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
    text-indent: 0 !important;
    font-size: 0 !important;  /* remove qualquer texto herdado */
}

.bfw-wrapper .bfw-arrow:hover {
    background-color: #f0f0f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14) !important;
}

.bfw-wrapper .bfw-arrow svg {
    fill: #111111;
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
    pointer-events: none;
}

/* Estado oculto: controlado pelo JS via classe */
.bfw-wrapper .bfw-arrow.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Seta prev oculta por padrão (JS remove is-hidden quando há overflow) */
.bfw-wrapper .bfw-arrow--prev {
    /* começa oculta — JS adiciona/remove is-hidden */
}

/* ── Scrollbar oculta ────────────────────────────────────── */
.bfw-viewport::-webkit-scrollbar { display: none; }
.bfw-viewport { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Estado de carregamento ──────────────────────────────── */
.bfw-wrapper.is-loading .bfw-track {
    opacity: 0.4;
    pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .bfw-brand-label {
        font-size: 13px;
    }

    .bfw-brand-item {
        padding: 7px 14px !important;
    }

    .bfw-brand-logo {
        width: 36px !important;
        height: 36px !important;
    }

    .bfw-wrapper .bfw-arrow {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
    }
}
