/*
 * PedeFácil loja pública — sticky desktop v20
 * Mantém logo/busca e categorias encostados durante a rolagem, mas limita
 * as categorias à coluna do catálogo para preservar o cabeçalho do carrinho.
 */

@media (min-width: 981px) {
    html body.store-v2 .compact-store-bar,
    html body.store-v2 #catalogStickyStack.catalog-sticky-stack,
    html body.store-v2 #catalogCategories.sticky-tools,
    html body.store-v2 .right-col {
        transition: top .18s ease, border-color .18s ease, border-radius .18s ease, box-shadow .18s ease, background .18s ease;
    }

    html body.store-v2.compact-store-visible .compact-store-bar.is-visible {
        border-bottom-color: transparent;
        background: rgba(255, 255, 255, .98);
        box-shadow: none;
    }

    html body.store-v2.compact-store-visible #catalogStickyStack.catalog-sticky-stack {
        position: sticky;
        z-index: 1039;
        top: calc(var(--compact-bar-height, 64px) - 1px);
        width: 100%;
        max-width: 100%;
        margin: 0 0 14px;
        padding: 7px 8px 8px;
        display: grid;
        gap: 0;
        overflow: visible;
        isolation: isolate;
        border: 1px solid rgba(218, 224, 228, .96);
        border-top: 0;
        border-radius: 0 0 15px 15px;
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 15px 32px rgba(15, 23, 42, .11);
        -webkit-backdrop-filter: blur(18px) saturate(135%);
        backdrop-filter: blur(18px) saturate(135%);
    }

    html body.store-v2.compact-store-visible #catalogStickyStack.catalog-sticky-stack::before {
        content: "";
        position: absolute;
        z-index: -1;
        top: -2px;
        right: 0;
        left: 0;
        height: 3px;
        background: rgba(255, 255, 255, .98);
        pointer-events: none;
    }

    html body.store-v2.compact-store-visible #catalogStart.search-card.glass-card {
        display: none;
    }

    html body.store-v2.compact-store-visible #catalogCategories.sticky-tools,
    html body.store-v2.compact-store-visible #catalogCategories.sticky-tools.is-stuck {
        position: relative;
        inset: auto;
        top: auto;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    html body.store-v2.compact-store-visible #catStrip.cat-strip {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 5px;
        justify-content: flex-start;
        border: 1px solid rgba(234, 224, 214, .92);
        border-radius: 10px;
        background: linear-gradient(180deg, #fffaf5, #fff7ef);
        box-shadow: none;
    }

    html body.store-v2.compact-store-visible #catStrip.cat-strip::before,
    html body.store-v2.compact-store-visible #catStrip.cat-strip::after {
        display: none;
    }

    html body.store-v2.compact-store-visible #catStrip .cat-chip {
        min-height: 34px;
        padding: 6px 11px;
        border-radius: 8px;
        font-size: .66rem;
    }

    html body.store-v2.compact-store-visible #catStrip .cat-chip.active {
        box-shadow: 0 6px 14px rgba(var(--pf-app-accent-rgb, 249, 115, 22), .2);
    }

    html body.store-v2.compact-store-visible .menu-section {
        scroll-margin-top: calc(var(--compact-bar-height, 64px) + 66px);
    }

    /* O carrinho fica ao lado da barra de categorias, nunca atrás dela. */
    html body.store-v2.compact-store-visible .right-col,
    html body.store-v2.compact-store-visible:has(#catalogCategories.is-stuck) .right-col {
        z-index: 1038;
        top: calc(var(--compact-bar-height, 64px) + 8px);
    }

    html body.store-v2.compact-store-visible .desktop-cart-card,
    html body.store-v2.compact-store-visible:has(#catalogCategories.is-stuck) .desktop-cart-card {
        height: min(720px, calc(100dvh - var(--compact-bar-height, 64px) - 16px));
        max-height: calc(100dvh - var(--compact-bar-height, 64px) - 16px);
    }

    html body.store-v2.compact-store-visible .desktop-cart-head {
        position: relative;
        z-index: 1;
        visibility: visible;
        opacity: 1;
    }
}

@media (min-width: 981px) and (max-width: 1160px) {
    html body.store-v2 .compact-store-bar {
        padding-right: 14px;
        padding-left: 14px;
    }

    html body.store-v2 .compact-store-bar-inner {
        width: min(1100px, 100%);
    }
}

@media print {
    html body.store-v2 #catalogStickyStack.catalog-sticky-stack {
        position: static;
        width: auto;
        box-shadow: none;
    }
}
