/* Smartphone Italia — facet filters Apple minimal (20260704-brand-green) */

#js-active-search-filters.active_filters {
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--si-radius, 18px);
}

#js-active-search-filters.active_filters .filter-block {
    border-radius: var(--si-radius-pill, 980px);
    background: var(--si-bg-alt, #f5f5f7);
    border: 1px solid var(--si-line, rgba(0, 0, 0, 0.08));
    color: var(--si-text, #1d1d1f);
    font-family: var(--si-font, system-ui, sans-serif);
}

#search_filters .tvfilter-search-types-title,
#search_filters .facet .tvfilter-search-types-title {
    color: var(--si-text, #1d1d1f);
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--si-line, rgba(0, 0, 0, 0.08));
}

#search_filters .facet-label a.search-link {
    color: var(--si-text-secondary, #6e6e73);
    font-size: 0.8125rem;
    transition: color 0.3s ease;
}

#search_filters .facet-label a.search-link:hover,
#search_filters .facet-label.active a.search-link {
    color: var(--si-accent, #39b54a);
}

#search_filters .js-search-filters-clear-all {
    color: var(--si-accent, #39b54a) !important;
    font-weight: 500;
    font-size: 0.8125rem;
    border-radius: var(--si-radius-pill, 980px);
    border: 1px solid var(--si-line, rgba(0, 0, 0, 0.08));
    background: transparent;
    padding: 8px 16px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

#search_filters .js-search-filters-clear-all:hover {
    background: rgba(57, 181, 74, 0.06);
    border-color: var(--si-accent, #39b54a);
}


#js-active-search-filters.active_filters ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 100%;
}

#js-active-search-filters.active_filters .filter-block {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 100%;
    min-height: 44px;
    margin: 0 !important;
    padding: 8px 12px;
    font-size: 0.8125rem;
    line-height: 1.35;
    word-break: break-word;
}

#js-active-search-filters.active_filters .filter-block .close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: -8px -8px -8px 0;
    padding: 0;
}

#search_filters .tvfilter-search-types-title,
#search_filters .facet .tvfilter-search-types-title {
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#search_filters .tvfilter-search-types-title .tvdropdown-btn,
#search_filters .facet .tvfilter-search-types-title .tvdropdown-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#search_filters .facet-label {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 6px 0;
}

#search_filters .facet-label a.search-link {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

#search_filters .tvfilter-search-types-dropdown > li {
    min-height: 44px;
}

#search_filters .js-search-filters-clear-all {
    min-height: 44px;
}

@media (max-width: 991px) {
    #left-column #search_filters {
        max-width: 100%;
    }

    #search_filters .tvserach-filter-wrapper,
    #search_filters .tvsearch-filter-content-wrapper {
        max-width: 100%;
        overflow-x: hidden;
    }

    #search_filters .facet {
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    #search_filters .tvfilter-dropdown-wrapper {
        width: 100%;
    }

    #search_filters .tvfilter-search-types-dropdown {
        max-height: 280px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 767px) {
    #js-active-search-filters.active_filters {
        padding: 12px 14px 4px;
    }

    #js-active-search-filters.active_filters .active-filter-title {
        display: block;
        margin: 0 0 8px;
    }

    .tv_search_filter_wrapper .tvleft-right-title-wrapper {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 8px 12px;
    }
}

@media (max-width: 576px) {
    #js-active-search-filters.active_filters .filter-block {
        width: 100%;
        justify-content: space-between;
    }
}

/* ── Mobile filter drawer / collapsible panel (20260704-responsive-global) ── */
@media (max-width: 991px) {
    .tv_search_filter_wrapper {
        display: inline-flex;
        align-items: center;
        margin-right: 8px;
    }

    .tv_search_filter_wrapper .tvleft-right-title-wrapper {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px;
        border: 1px solid var(--si-line, rgba(0, 0, 0, 0.08));
        border-radius: var(--si-radius-pill, 980px);
        background: var(--si-bg-alt, #f5f5f7);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: border-color 0.3s ease, background 0.3s ease;
    }

    .tv_search_filter_wrapper .tvleft-right-title-wrapper:hover,
    .tv_search_filter_wrapper .tvleft-right-title-wrapper.active {
        border-color: var(--si-accent, #39b54a);
        background: #fff;
    }

    .tv_search_filter_wrapper .tvproduct-top-filter-name {
        font-size: 0.875rem;
        font-weight: 600;
    }

    #search_filters_wrapper {
        position: relative;
        z-index: 100;
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #search_filters_wrapper #search_filters {
        display: none;
        max-width: 100%;
        width: 100%;
        margin: 0;
        padding: 12px max(12px, env(safe-area-inset-left, 0)) 16px max(12px, env(safe-area-inset-right, 0));
        background: #fff;
        border: 1px solid var(--si-line, rgba(0, 0, 0, 0.08));
        border-radius: var(--si-radius, 18px);
        box-shadow: var(--si-shadow-hover, 0 8px 28px rgba(0, 0, 0, 0.08));
        max-height: min(70vh, 520px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #search_filters_wrapper #search_filters.open {
        display: block;
    }

    #left-column #search_filters_wrapper,
    #category #left-column #search_filters_wrapper,
    #products #search_filters_wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #left-column #search_filters,
    #category #left-column #search_filters {
        margin-bottom: 0;
        box-shadow: none;
        border-top: none;
    }

    #left-column {
        position: relative;
        z-index: 50;
    }

    #left-column.tv-left-right-panel-hide.open {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        width: min(360px, 92vw) !important;
        max-width: 92vw;
        height: 100%;
        height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #f5f5f5;
        padding: max(48px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
        box-sizing: border-box;
    }

    /* Right-thumb close — filter drawer at viewport right edge (20260704-close-right) */
    #left-column.tv-left-right-panel-hide.open .tvleft-column-close-btn {
        position: fixed !important;
        top: max(8px, env(safe-area-inset-top, 0px)) !important;
        right: max(14px, env(safe-area-inset-right, 0px)) !important;
        left: auto !important;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 10px;
        background-image: none !important;
        background-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
        z-index: 10001;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    #left-column.tv-left-right-panel-hide.open .tvleft-column-close-btn::before {
        content: 'close';
        font-family: 'Material Icons';
        font-size: 24px;
        line-height: 44px;
        color: var(--si-text, #1d1d1f);
        display: block;
        text-align: center;
        transition: color 0.2s ease;
    }

    #left-column.tv-left-right-panel-hide.open .tvleft-column-close-btn:active::before {
        color: var(--si-accent, #39b54a);
    }

    #left-column.tv-left-right-panel-hide.open .tvleft-column-close-btn:active {
        background: rgba(57, 181, 74, 0.08);
    }

    .tvleft-penal-product-top #search_filters_wrapper {
        order: -1;
        flex: 1 1 100%;
        width: 100%;
    }
}

@media (max-width: 767px) {
    #js-active-search-filters.active_filters {
        margin-bottom: 8px;
    }

    #search_filters .facet .tvfilter-search-types-dropdown {
        max-height: 220px;
    }
}
