/*
 * Filtros mobile da loja — drawer com grupos, pílulas ativas e estado vazio.
 * Só age quando o JS marca body.cdp-filters-mobile-ready.
 */

.cdp-filters-bar {
    display: none;
}

.cdp-filters-count[hidden],
.cdp-filters-clear-all[hidden],
.cdp-filters-bar-clear[hidden] {
    display: none !important;
}

.cdp-filters-overlay,
.cdp-filters-head,
.cdp-filters-foot,
.cdp-filters-live {
    display: none;
}

.cdp-filter-hidden,
body .elementor-585 .elementor-element-0b39c2a .e-filter-item.cdp-filter-hidden {
    display: none !important;
}

.cdp-filter-group-title {
    display: block;
    margin: 18px 0 8px;
    color: #64748B;
    font-family: 'Rubik', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* No desktop a primeira opção ("Todas as Categorias", "Todos os
   Ambientes"...) já identifica o grupo; o título é redundante.
   No mobile o drawer mantém os títulos. */
@media (min-width: 768px) {
    .cdp-filter-group-title {
        display: none !important;
    }
}

.cdp-filters-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #CBD5E1;
    border-radius: 999px;
    background: #FFFFFF;
    color: #3B488B;
    font-family: 'Rubik', sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.cdp-filters-pill:hover {
    border-color: #3B488B;
}

.cdp-filters-pill-x {
    font-size: 15px;
    line-height: 1;
    color: #64748B;
}

.cdp-filters-empty {
    position: relative;
    z-index: 2;
    margin: 16px 0 24px;
    padding: 32px 20px;
    border: 1px dashed #CBD5E1;
    border-radius: 14px;
    background: #F8FAFC;
    text-align: center;
}

body.cdp-filters-mobile-ready .elementor-element-99d0503.has-empty,
body.cdp-filters-mobile-ready .elementor-element-99d0503.has-empty .elementor-widget-container {
    height: auto !important;
    min-height: 0 !important;
}

body.cdp-filters-mobile-ready .elementor-element-99d0503.has-empty .e-loop-nothing-found-message {
    display: none !important;
}

.cdp-filters-empty-title {
    margin: 0 0 8px;
    color: #3B488B;
    font-family: 'Rubik', sans-serif;
    font-size: 17px;
    font-weight: 700;
}

.cdp-filters-empty-text {
    margin: 0 0 16px;
    color: #64748B;
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

.cdp-filters-empty-clear {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: #E0922F;
    color: #FFFFFF;
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.cdp-filters-live {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.cdp-filters-toggle.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.cdp-filters-toggle.is-loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: cdp-filters-spin 0.7s linear infinite;
}

@keyframes cdp-filters-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    body.cdp-filters-mobile-ready .cdp-filters-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        width: 100%;
        margin: 0 0 14px;
        position: relative;
        z-index: 2;
    }

    body.cdp-filters-mobile-ready .cdp-filters-toggle {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-height: 44px;
        padding: 0 14px;
        border: 1px solid #CBD5E1;
        border-radius: 10px;
        background: #FFFFFF;
        color: #3B488B;
        font-family: 'Rubik', sans-serif;
        font-size: 13px;
        font-weight: 600;
        line-height: 1;
        cursor: pointer;
        flex: 0 0 auto;
    }

    body.cdp-filters-mobile-ready .cdp-filters-toggle.has-active {
        border-color: #E0922F;
        color: #B86F16;
    }

    body.cdp-filters-mobile-ready .cdp-filters-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        padding: 0 5px;
        border-radius: 999px;
        background: #E0922F;
        color: #FFFFFF;
        font-size: 11px;
        font-weight: 700;
    }

    body.cdp-filters-mobile-ready .cdp-filters-bar-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        flex: 1 1 140px;
        min-width: 0;
    }

    body.cdp-filters-mobile-ready .cdp-filters-bar-clear {
        border: 0;
        background: transparent;
        color: #3B488B;
        font-family: 'Rubik', sans-serif;
        font-size: 12px;
        font-weight: 600;
        text-decoration: underline;
        cursor: pointer;
        min-height: 32px;
        padding: 0 2px;
    }

    body.cdp-filters-mobile-ready .cdp-filters-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 100000;
        background: rgba(15, 23, 42, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    body.cdp-filters-mobile-ready .cdp-filters-overlay.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    body.cdp-filters-mobile-ready .elementor-585 .elementor-element-0b39c2a {
        position: fixed !important;
        top: auto !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: 86vh !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        background: #FFFFFF !important;
        box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.28) !important;
        z-index: 100001 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain;
        transform: translateY(105%);
        visibility: hidden;
        transition: transform 0.28s ease, visibility 0.28s ease;
    }

    body.cdp-filters-mobile-ready .elementor-585 .elementor-element-0b39c2a.is-open {
        transform: translateY(0);
        visibility: visible;
    }

    body.cdp-filters-lock {
        overflow: hidden !important;
    }

    body.cdp-filters-mobile-ready .elementor-element-0b39c2a .elementor-element-e8a109f {
        display: none !important;
    }

    body.cdp-filters-mobile-ready .cdp-filters-head {
        display: block;
        position: sticky;
        top: 0;
        z-index: 4;
        padding: 16px 16px 10px;
        background: #FFFFFF;
        border-bottom: 1px solid #E2E8F0;
    }

    body.cdp-filters-mobile-ready .cdp-filters-head-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    body.cdp-filters-mobile-ready .cdp-filters-head h2 {
        margin: 0;
        color: #3B488B;
        font-family: 'Rubik', sans-serif;
        font-size: 18px;
        font-weight: 700;
    }

    body.cdp-filters-mobile-ready .cdp-filters-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid #E2E8F0;
        border-radius: 50%;
        background: #FFFFFF;
        color: #3B488B;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
        flex: 0 0 auto;
    }

    body.cdp-filters-mobile-ready .cdp-filters-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 10px;
    }

    body.cdp-filters-mobile-ready .cdp-filters-pills:empty {
        display: none;
    }

    body.cdp-filters-mobile-ready .cdp-filters-clear-all {
        margin-top: 8px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #B86F16;
        font-family: 'Rubik', sans-serif;
        font-size: 12px;
        font-weight: 600;
        text-decoration: underline;
        cursor: pointer;
        min-height: 28px;
    }
}
