/**
 * Isolamento B2B vs Hello Elementor — alta especificidade
 * IMPORTANTE: não usar classe genérica .is-active (o tema pinta de rosa).
 */

html body.b2b-panel-page,
html body.b2b-panel-page .b2b-panel-page {
    --e-global-color-primary: #4f46e5 !important;
    --e-global-color-secondary: #6366f1 !important;
    --e-global-color-accent: #6366f1 !important;
    --e-global-color-text: #1e293b !important;
    --wp--preset--color--primary: #4f46e5 !important;
    --wp--preset--color--vivid-cyan-blue: #4f46e5 !important;
    accent-color: #6366f1 !important;
}

/* Neutraliza .is-active do Hello/Elementor se ainda aparecer no painel */
html body.b2b-panel-page .b2b-panel-page .is-active {
    background-color: inherit !important;
    border-color: inherit !important;
}

html body.b2b-panel-page .b2b-panel-page button.is-active,
html body.b2b-panel-page .b2b-panel-page .b2b-mobile-tabbar__item.is-active,
html body.b2b-panel-page .b2b-panel-page #b2bMobileTabMenu.is-active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: #4f46e5 !important;
}

/* Barra inferior — nunca fundo rosa do tema */
html body.b2b-panel-page .b2b-panel-page .b2b-mobile-tabbar__item,
html body.b2b-panel-page .b2b-panel-page button.b2b-mobile-tabbar__item,
html body.b2b-panel-page .b2b-panel-page #b2bMobileTabMenu {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: #64748b !important;
}

html body.b2b-panel-page .b2b-panel-page .b2b-mobile-tabbar__item.b2b-tab--on,
html body.b2b-panel-page .b2b-panel-page .b2b-mobile-tabbar__item.b2b-tab--menu-open,
html body.b2b-panel-page .b2b-panel-page #b2bMobileTabMenu.b2b-tab--menu-open {
    background: transparent !important;
    background-color: transparent !important;
    color: #4f46e5 !important;
}

html body.b2b-panel-page .b2b-panel-page .b2b-mobile-tabbar__item:focus,
html body.b2b-panel-page .b2b-panel-page .b2b-mobile-tabbar__item:focus-visible,
html body.b2b-panel-page .b2b-panel-page .b2b-mobile-tabbar__item:active,
html body.b2b-panel-page .b2b-panel-page #b2bMobileTabMenu:focus,
html body.b2b-panel-page .b2b-panel-page #b2bMobileTabMenu:focus-visible,
html body.b2b-panel-page .b2b-panel-page #b2bMobileTabMenu:active {
    background: transparent !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

html body.b2b-panel-page .b2b-panel-page .b2b-mobile-tabbar__item--create:focus,
html body.b2b-panel-page .b2b-panel-page .b2b-mobile-tabbar__item--create:active {
    background: transparent !important;
}

/* Sidebar — botão Downloads (evita borda rosa no :focus) */
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar button.b2b-sidebar__link,
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar button.b2b-sidebar__link--btn,
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar button.b2b-sidebar__link--download {
    -webkit-appearance: none !important;
    appearance: none !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    background: transparent !important;
    background-color: transparent !important;
    color: rgba(224, 231, 255, 0.9) !important;
    box-shadow: none !important;
}

html body.b2b-panel-page .b2b-panel-page .b2b-sidebar button.b2b-sidebar__link:hover,
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar button.b2b-sidebar__link--btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-color: transparent !important;
}

html body.b2b-panel-page .b2b-panel-page .b2b-sidebar button.b2b-sidebar__link:focus,
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar button.b2b-sidebar__link:focus-visible,
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar button.b2b-sidebar__link:active,
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar button.b2b-sidebar__link--download:focus,
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar button.b2b-sidebar__link--download:focus-visible {
    outline: none !important;
    border-color: rgba(129, 140, 248, 0.45) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    box-shadow: none !important;
}

html body.b2b-panel-page .b2b-panel-page .b2b-sidebar a.b2b-sidebar__link:focus,
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar a.b2b-sidebar__link:focus-visible,
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar a.b2b-sidebar__link:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #e0e7ff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

html body.b2b-panel-page .b2b-panel-page .b2b-sidebar__link--active,
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar__link--active:focus,
html body.b2b-panel-page .b2b-panel-page .b2b-sidebar__link--active:focus-visible {
    background: rgba(255, 255, 255, 0.12) !important;
    border: none !important;
    color: #fff !important;
}

/* Botões genéricos no painel */
html body.b2b-panel-page .b2b-panel-page button:not(.b2b-mobile-tabbar__item--create):focus,
html body.b2b-panel-page .b2b-panel-page button:not(.b2b-mobile-tabbar__item--create):focus-visible {
    outline-color: #c7d2fe !important;
}

html body.b2b-panel-page .b2b-panel-page .modal-close,
html body.b2b-panel-page .b2b-panel-page button.modal-close,
html body.b2b-panel-page .b2b-panel-page .b2b-changelog-drawer__close,
html body.b2b-panel-page .b2b-panel-page .b2b-faixa-panel__close,
html body.b2b-panel-page .b2b-panel-page .notice-carousel__close {
    background: transparent !important;
    background-color: transparent !important;
    color: #64748b !important;
    border: none !important;
    box-shadow: none !important;
}

html body.b2b-panel-page .b2b-panel-page .modal-close:hover,
html body.b2b-panel-page .b2b-panel-page button.modal-close:hover {
    color: #334155 !important;
    background: #f1f5f9 !important;
}

html body.b2b-panel-page .b2b-panel-page .modal-close:focus,
html body.b2b-panel-page .b2b-panel-page .modal-close:focus-visible,
html body.b2b-panel-page .b2b-panel-page .modal-close:active,
html body.b2b-panel-page .b2b-panel-page button.modal-close:focus,
html body.b2b-panel-page .b2b-panel-page button.modal-close:active {
    color: #475569 !important;
    background: #e2e8f0 !important;
    outline: 2px solid #c7d2fe !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

html body.b2b-panel-page .b2b-panel-page .btn-primary:focus,
html body.b2b-panel-page .b2b-panel-page .btn-primary:active {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    color: #fff !important;
}

html body.b2b-panel-page .b2b-panel-page .field-input:focus,
html body.b2b-panel-page .b2b-panel-page .field-select:focus,
html body.b2b-panel-page .b2b-panel-page .b2b-topbar__search input:focus {
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22) !important;
    outline: none !important;
}

html body.b2b-panel-page .b2b-panel-page select option:checked {
    background: #4f46e5 !important;
    color: #fff !important;
}

/* Loja digital — preço na capa (inferior direito), isolado do Hello Elementor */
html body.b2b-panel-page .b2b-panel-page .b2b-dstore-card__img-wrap {
    display: grid !important;
    text-align: left !important;
}

html body.b2b-panel-page .b2b-panel-page .b2b-dstore-card__img-wrap .b2b-dstore-card__price-bar,
html body.b2b-panel-page .b2b-dstore-card__img-wrap .b2b-dstore-card__price-bar {
    grid-area: 1 / 1 !important;
    align-self: end !important;
    justify-self: end !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    margin: 0 10px 10px 0 !important;
    margin-left: auto !important;
    margin-right: 10px !important;
    display: inline-flex !important;
    flex-direction: row !important;
    width: auto !important;
    max-width: calc(100% - 20px) !important;
    float: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(5px) !important;
    transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease !important;
}

html body.b2b-panel-page .b2b-dstore-card:has(.b2b-dstore-card__btn--buy:hover) .b2b-dstore-card__price-bar,
html body.b2b-panel-page .b2b-dstore-card:has(.b2b-dstore-card__btn--buy:focus-visible) .b2b-dstore-card__price-bar {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

html body.b2b-panel-page .b2b-panel-page .b2b-dstore-card__price-bar .b2b-dstore-card__price,
html body.b2b-panel-page .b2b-dstore-card__price-bar .b2b-dstore-card__price {
    grid-area: auto !important;
    align-self: auto !important;
    justify-self: auto !important;
    position: static !important;
    margin: 0 !important;
    text-align: right !important;
    width: auto !important;
    max-width: none !important;
    float: none !important;
    transform: none !important;
}

html body.b2b-panel-page .b2b-dstore-card__actions .b2b-dstore-detail-btn.btn,
html body.b2b-panel-page .b2b-dstore-card__actions button.b2b-dstore-detail-btn {
    background: #fff !important;
    background-color: #fff !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    box-shadow: none !important;
}

/* Loja Telas / Ferramentas — card mobile: só imagem + título */
@media (max-width: 767px) {
    html body.b2b-panel-page .b2b-dstore-card__desc,
    html body.b2b-panel-page .b2b-dstore-card .b2b-dstore-card__desc {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
}

/* Sidebar mobile — botão fechar (Hello Elementor costuma esconder ou esticar button) */
@media (max-width: 1024px) {
    html body.b2b-panel-page .b2b-panel-page #b2bSidebarClose,
    html body.b2b-panel-page .b2b-panel-page .b2b-sidebar__close {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
        padding: 0 !important;
        -webkit-appearance: none !important;
        appearance: none !important;
        background: rgba(255, 255, 255, 0.06) !important;
        background-color: rgba(255, 255, 255, 0.06) !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        border-radius: 10px !important;
        color: #f8fafc !important;
        box-shadow: none !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 3 !important;
    }

    html body.b2b-panel-page .b2b-panel-page #b2bSidebarClose svg,
    html body.b2b-panel-page .b2b-panel-page .b2b-sidebar__close svg {
        display: block !important;
        width: 18px !important;
        height: 18px !important;
        opacity: 1 !important;
        visibility: visible !important;
        stroke: currentColor !important;
    }

    html body.b2b-panel-page .b2b-panel-page .b2b-sidebar__brand {
        position: sticky !important;
        top: 0 !important;
        z-index: 2 !important;
        flex-shrink: 0 !important;
        background: linear-gradient(180deg, #1a1744 0%, #2d2a6e 100%) !important;
    }

    html body.b2b-panel-page .b2b-panel-page.b2b-sidebar-open .b2b-sidebar {
        z-index: 100200 !important;
    }

    html body.b2b-panel-page .b2b-panel-page.b2b-sidebar-open .b2b-sidebar-backdrop {
        z-index: 100190 !important;
    }
}

/* CRM — evita que wrappers do Hello clippem o menu fixo */
@media (max-width: 1024px) {
    html body.b2b-panel-page.b2b-panel-page--crm-shell,
    html body.b2b-panel-page.b2b-panel-page--crm-shell #page,
    html body.b2b-panel-page.b2b-panel-page--crm-shell .site,
    html body.b2b-panel-page.b2b-panel-page--crm-shell .elementor {
        overflow: visible !important;
    }
}

/* Topbar — botão menu igual à barra inferior (sem borda/fundo) */
@media (max-width: 1024px) {
    html body.b2b-panel-page .b2b-panel-page #b2bSidebarToggle,
    html body.b2b-panel-page .b2b-panel-page .b2b-topbar__menu-btn {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        height: auto !important;
        min-width: 0 !important;
        min-height: 0 !important;
        padding: 4px 6px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        border: none !important;
        border-radius: 12px !important;
        background: transparent !important;
        background-color: transparent !important;
        color: #64748b !important;
        box-shadow: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    html body.b2b-panel-page .b2b-panel-page #b2bSidebarToggle .b2b-nav-ico-svg,
    html body.b2b-panel-page .b2b-panel-page .b2b-topbar__menu-btn .b2b-nav-ico-svg {
        display: block !important;
        width: 22px !important;
        height: 22px !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    html body.b2b-panel-page .b2b-panel-page #b2bSidebarToggle.b2b-topbar__menu--open,
    html body.b2b-panel-page .b2b-panel-page .b2b-topbar__menu-btn.b2b-topbar__menu--open {
        border: none !important;
        background: transparent !important;
        background-color: transparent !important;
        color: #4f46e5 !important;
    }

    html body.b2b-panel-page .b2b-panel-page #b2bSidebarToggle:focus,
    html body.b2b-panel-page .b2b-panel-page #b2bSidebarToggle:focus-visible,
    html body.b2b-panel-page .b2b-panel-page #b2bSidebarToggle:active,
    html body.b2b-panel-page .b2b-panel-page .b2b-topbar__menu-btn:focus,
    html body.b2b-panel-page .b2b-panel-page .b2b-topbar__menu-btn:active {
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
    }
}

/* Dashboard revendedor — fundo escuro fullscreen (vence tema claro no rodapé) */
html body.b2b-panel-page.b2b-panel-page--dashboard .b2b-app-shell,
html body.b2b-panel-page .b2b-panel-page.b2b-panel-page--dashboard .b2b-app-shell {
    background: #070d1a !important;
}

html body.b2b-panel-page.b2b-panel-page--dashboard .b2b-main--dashboard,
html body.b2b-panel-page .b2b-panel-page.b2b-panel-page--dashboard .b2b-main--dashboard,
html body.b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-canvas,
html body.b2b-panel-page .b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-canvas {
    background: linear-gradient(165deg, #070d1a 0%, #0f172a 42%, #111827 100%) !important;
}

html body.b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__title,
html body.b2b-panel-page .b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__title,
html body.b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__card-title,
html body.b2b-panel-page .b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__card-title,
html body.b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__metric-value,
html body.b2b-panel-page .b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__metric-value {
    color: #f8fafc !important;
}

html body.b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__desc,
html body.b2b-panel-page .b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__desc,
html body.b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__card-desc,
html body.b2b-panel-page .b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__card-desc,
html body.b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__metric-label,
html body.b2b-panel-page .b2b-panel-page.b2b-panel-page--dashboard .b2b-dashboard-quiz--canvas .b2b-dashboard-quiz__metric-label {
    color: #94a3b8 !important;
}
