/* =========================================================
   FILTRO DO CARDÁPIO (desktop + mobile)
   Paleta do header: marrom #46260F · dourado #C9A46A / #E3C796 · creme #F7EFE4
   ========================================================= */

.bc-filter {
    --bc-filter-h: 44px;
    --bc-filter-brown: #46260F;
    --bc-filter-gold: #C9A46A;
    --bc-filter-gold-soft: #E3C796;
    --bc-filter-cream: #F7EFE4;
    --bc-filter-field: #FBF7F1;
    --bc-filter-line: #E8DCCB;
    --bc-filter-text: #3B2416;
    --bc-filter-muted: #8A7461;

    background: var(--bc-card);
    border: 1px solid rgba(70, 38, 15, 0.08);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(59, 36, 22, 0.10);
    font-family: Inter, system-ui, sans-serif;
    transition: background .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.bc-filter--sticky {
    position: sticky;
    top: 15px;
    z-index: 20;
}

/* Quando gruda no topo ao rolar: fica marrom como o header */
.bc-filter.is-sticky {
    background: linear-gradient(135deg, #6B3D1C 0%, #46260F 55%, #2A1508 100%);
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(42, 21, 8, 0.30);
}

/* ---------- Campo de busca ---------- */

.bc-filter__search {
    width: 100%;
}

.bc-filter__input {
    width: 100%;
    height: var(--bc-filter-h);
    padding: 0 44px 0 42px;
    background: var(--bc-filter-field);
    border: 1.5px solid var(--bc-filter-line);
    border-radius: 999px;
    color: var(--bc-filter-text) !important;
    font-size: 14px;
    font-weight: 500;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.bc-filter__input::placeholder {
    color: var(--bc-filter-muted);
    font-weight: 500;
}

/* Esconde o "x" nativo do input type="search" (já temos o botão de limpar) */
.bc-filter__input::-webkit-search-cancel-button,
.bc-filter__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.bc-filter__input:focus {
    background: var(--bc-card);
    border-color: var(--bc-filter-gold);
    box-shadow: 0 0 0 3px rgba(201, 164, 106, 0.25) !important;
    outline: none;
}

.bc-filter__icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    margin: 0 !important;
    color: var(--bc-filter-gold);
    font-size: 15px;
    pointer-events: none;
}

.bc-filter__close {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bc-filter-cream);
    color: var(--bc-filter-brown);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.bc-filter__close i {
    margin: 0 !important;
}

.bc-filter__close:hover {
    background: var(--bc-filter-brown);
    color: #FFFFFF;
}

.bc-filter.is-sticky .bc-filter__input {
    background: var(--bc-card);
    border-color: transparent;
}

/* ---------- Mobile ---------- */

@media (max-width: 1199px) {
    .bc-filter {
        --bc-filter-h: 42px;
        border-radius: 12px;
    }

    /* Ao rolar, a busca gruda um pouco abaixo do topo da tela */
    .bc-filter--sticky {
        top: 8px;
    }
}

/* =========================================================
   FAIXA DE CATEGORIAS COM IMAGEM (rolagem lateral, estilo app de delivery)
   ========================================================= */

.bc-cats {
    position: relative;
    padding: 12px 6px 10px;
    background: var(--bc-card);
    border: 1px solid rgba(70, 38, 15, 0.08);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(59, 36, 22, 0.08);
    font-family: Inter, system-ui, sans-serif;
}

.bc-cats__track {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 4px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding: 0 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.bc-cats__track::-webkit-scrollbar {
    display: none;
}

.bc-cats__item {
    flex: 0 0 auto;
    width: 84px;
    padding: 0;
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    scroll-snap-align: start;
}

.bc-cats__thumb {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F7EFE4;
    color: #C9A46A;
    font-size: 24px;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 0 1px #E8DCCB, 0 4px 10px rgba(59, 36, 22, 0.10);
    transition: transform .2s ease, box-shadow .2s ease;
}

.bc-cats__thumb i {
    margin: 0 !important;
}

/* A foto fica por cima do ícone de reserva */
.bc-cats__thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bc-cats__thumb--all {
    background: linear-gradient(135deg, #6B3D1C 0%, #46260F 100%);
    color: #E3C796;
}

.bc-cats__name {
    max-width: 100%;
    font-size: 12.5px;
    line-height: 1.2;
    font-weight: 600;
    color: #6B5444;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s ease;
}

.bc-cats__item:hover .bc-cats__thumb {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px #C9A46A, 0 8px 16px rgba(59, 36, 22, 0.16);
}

.bc-cats__item:focus-visible {
    outline: none;
}

.bc-cats__item:focus-visible .bc-cats__thumb,
.bc-cats__item.is-active .bc-cats__thumb {
    box-shadow: 0 0 0 3px #C9A46A, 0 6px 14px rgba(59, 36, 22, 0.18);
}

.bc-cats__item.is-active .bc-cats__name {
    color: #46260F;
    font-weight: 700;
}

/* Setas laterais (desktop) */
.bc-cats__nav {
    position: absolute;
    top: 46px;
    transform: translateY(-50%);
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #E8DCCB;
    background: #FFFFFF;
    color: #46260F;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 36, 22, 0.18);
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}

.bc-cats__nav i {
    margin: 0 !important;
    font-size: 13px;
}

.bc-cats__nav:hover {
    background: #46260F;
    color: #FFFFFF;
}

.bc-cats__nav.is-prev { left: 6px; }
.bc-cats__nav.is-next { right: 6px; }

.bc-cats__nav.is-hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 1199px) {
    .bc-cats {
        padding: 10px 2px 8px;
        border-radius: 12px;
    }

    .bc-cats__track {
        gap: 10px;
    }

    .bc-cats__item {
        width: 72px;
    }

    .bc-cats__thumb {
        width: 58px;
        height: 58px;
        font-size: 20px;
    }

    .bc-cats__name {
        font-size: 12px;
    }

    /* No celular a navegação é arrastando com o dedo */
    .bc-cats__nav {
        display: none;
    }
}

/* =========================================================
   FILTRO DE CATEGORIA APLICADO: "Mostrando X · Remover filtro"
   Barra logo abaixo da faixa, só com uma categoria escolhida
   (mesmo tom creme e botão em pílula do carrinho)
   ========================================================= */

.bc-cats-ativo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 6px 6px 14px;
    border-radius: 12px;
    background: var(--bc-filter-cream, #F7EFE4);
    font-family: Inter, system-ui, sans-serif;
    animation: bc-cats-ativo-in .2s ease;
}

.bc-cats-ativo[hidden] {
    display: none;
}

.bc-cats-ativo__texto {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #6F5A46;
}

.bc-cats-ativo__texto strong {
    color: #46260F;
}

.bc-cats-ativo__limpar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #46260F;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(70, 38, 15, .12);
    transition: background-color .2s ease;
}

.bc-cats-ativo__limpar:hover {
    background: #E3C796;
}

.bc-cats-ativo__limpar:focus-visible {
    outline: 2px solid #C9A46A;
    outline-offset: 2px;
}

@keyframes bc-cats-ativo-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .bc-cats-ativo { animation: none; }
}

/* Durante a busca por texto a faixa de categorias sai de cena (atualizarModoBusca no Home/Index) */
.bc-oculto-na-busca {
    display: none !important;
}
