/* ==========================================================================
   Mobile Categories Overlay — menu full-screen mobile (≤921px)
   ========================================================================== */

.brd-mob-cat { display: none; }

@media (max-width: 921px) {
    .brd-mob-cat {
        position: fixed;
        inset: 0;
        z-index: 230; /* acima da bottom nav (210) */
        background: #F4F5F7;
        display: flex;
        flex-direction: column;
        visibility: hidden;
        opacity: 0;
        transform: translateX(-12px);
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
        overscroll-behavior: contain;
    }

    .brd-mob-cat.is-open {
        visibility: visible;
        opacity: 1;
        transform: translateX(0);
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s;
    }

    /* Top bar */
    .brd-mob-cat__topbar {
        flex: 0 0 auto;
        height: 60px;
        background: var(--brd-blue-dark, #183357);
        color: #fff;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .brd-mob-cat__back {
        background: none;
        border: none;
        cursor: pointer;
        color: #fff;
        padding: 10px 16px 10px 8px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-family: var(--brd-font-family);
        font-size: 16px;
        font-weight: 600;
        -webkit-tap-highlight-color: transparent;
    }

    .brd-mob-cat__back:active { opacity: 0.7; }

    /* Body com 2 colunas */
    .brd-mob-cat__body {
        flex: 1 1 auto;
        display: flex;
        min-height: 0;
        overflow: hidden;
    }

    /* Coluna esquerda — tabs (pills cortadas à direita) */
    .brd-mob-cat__tabs {
        flex: 0 0 128px;
        margin: 0;
        padding: 16px 0;
        list-style: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        background: transparent;
    }

    .brd-mob-cat__tabs li { margin: 0 0 10px 0; }

    .brd-mob-cat__tab {
        width: 112px;
        min-height: 56px;
        padding: 10px 14px;
        background: var(--brd-blue-dark, #183357);
        color: #fff;
        border: none;
        border-radius: 0 32px 32px 0;
        font-family: var(--brd-font-family);
        font-size: 13px;
        font-weight: 500;
        line-height: 1.2;
        text-align: center;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
        border: 1px solid #C2A86C;
        border-left: none;
        box-shadow: 3px 4px 10px rgba(0, 0, 0, 0.45);
        transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    }

    .brd-mob-cat__tab.is-active {
        background: #FAF7EC;
        color: var(--brd-blue-dark, #183357);
        font-weight: 700;
        transform: scale(1.07);
    }

    .brd-mob-cat__tab:active { opacity: 0.85; }

    /* Coluna direita — painéis */
    .brd-mob-cat__panels {
        flex: 1 1 auto;
        background: #fff;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    }

    .brd-mob-cat__panel { display: none; }
    .brd-mob-cat__panel.is-active { display: block; }

    .brd-mob-cat__all {
        display: block;
        padding: 10px 12px;
        background: #EEF3F9;
        color: var(--brd-blue-dark, #183357);
        font-family: var(--brd-font-family);
        font-size: 13px;
        font-weight: 600;
        border-radius: 8px;
        text-decoration: none;
        margin-bottom: 12px;
        text-align: center;
    }

    .brd-mob-cat__all:visited,
    .brd-mob-cat__all:hover,
    .brd-mob-cat__all:focus { color: var(--brd-blue-dark, #183357); }
    .brd-mob-cat__all:active { opacity: 0.8; }

    .brd-mob-cat__list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .brd-mob-cat__list li + li { border-top: 1px solid #F0F0F0; }

    .brd-mob-cat__item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 4px;
        min-height: 60px;
        color: var(--brd-blue-dark, #183357);
        text-decoration: none;
        font-family: var(--brd-font-family);
    }

    .brd-mob-cat__item:active { opacity: 0.7; }

    .brd-mob-cat__thumb-wrap {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
        border-radius: 8px;
        overflow: hidden;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .brd-mob-cat__thumb {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        display: block;
    }

    .brd-mob-cat__thumb--ph {
        background: linear-gradient(135deg, #F4F5F7, #E5E7EB);
    }

    .brd-mob-cat__name {
        flex: 1;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.25;
        color: #0D0D0D;
    }

    /* L2 — cabeçalho de grupo com thumbnail */
    .brd-mob-cat__group { margin-bottom: 4px; }
    .brd-mob-cat__group + .brd-mob-cat__group {
        border-top: 2px solid #C8C8C8;
        margin-top: 8px;
        padding-top: 8px;
    }

    .brd-mob-cat__l2 {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 4px;
        min-height: 60px;
        color: var(--brd-blue-dark, #183357);
        text-decoration: none;
        font-family: var(--brd-font-family);
        font-weight: 600;
        font-size: 14px;
    }

    .brd-mob-cat__l2:active { opacity: 0.7; }

    /* L3 — lista indentada abaixo do L2 */
    .brd-mob-cat__l3list {
        list-style: none;
        margin: 0 0 8px 0;
        padding: 0 0 0 16px;
    }

    .brd-mob-cat__l3list li + li { border-top: 1px solid #F4F4F4; }

    .brd-mob-cat__thumb-wrap--sm {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }

    .brd-mob-cat__l3 {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 4px;
        min-height: 44px;
        color: #444;
        text-decoration: none;
        font-family: var(--brd-font-family);
        font-size: 13px;
        line-height: 1.3;
    }

    .brd-mob-cat__name--l3 { font-size: 13px; font-weight: 400; color: #444; }

    .brd-mob-cat__l3:active { opacity: 0.7; }

    /* Bloquear scroll do body quando overlay aberto */
    html.brd-mob-cat-open,
    body.brd-mob-cat-open {
        overflow: hidden;
        touch-action: none;
    }
}
