/* ==========================================================================
   FILTER EVERYTHING PLUGIN
   ========================================================================== */

/* Hides the active filter chips on Desktop devices to keep the UI clean */
@media (min-width: 1025px) {
    .widget_wpc_chips_widget {
        display: none !important;
    }
}

/* Flexbox layout for custom selected terms container */
.wpc-custom-selected-terms ul.wpc-filter-chips-list {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    white-space: normal !important;
    gap: 10px;
    padding: 10px 0 !important;
}

/* Individual filter chip items */
.wpc-custom-selected-terms ul.wpc-filter-chips-list li.wpc-filter-chip {
    display: inline-block !important;
    float: none !important;
    margin: 0 !important;
}

/* Main widget content wrapper */
.widget_wpc_filters_widget .wpc-filters-widget-content {
    padding: 0;
    border-radius: 16px;
}

/* Individual filter section styling */
.widget_wpc_filters_widget .wpc-filters-section {
    padding: 12px 10px;
    border-radius: 14px;
    background: var(--global-palette8); /* Integrates with Kadence global palette */
}

/* Combined typography rule for filter links and product counts */
.widget_wpc_filters_widget .wpc-filter-link,
.widget_wpc_filters_widget .wpc-term-count {
    font-size: 0.9rem;
}

/* Dimensions for filter items that include images (e.g., brand logos) */
.widget_wpc_filters_widget .wpc-term-has-image .wpc-term-image-wrapper {
    width: 90px;
    height: 45px;
}

/* Mobile filter toggle button styling */
section.widget_wpc_filters_widget .wpc-filters-open-button-container a.wpc-open-close-filters-button {
    display: inline-block !important;
    border-radius: 999px !important; /* Pill shape */
    padding: 0 !important;
    margin: 8px 0 !important;
}

/* Mobile filter toggle button text */
.wpc-open-close-filters-button .wpc-filters-button-text {
    font-size: 0.9rem !important;
}

/* Mobile filter toggle button inner padding */
.wpc-open-close-filters-button .wpc-button-inner {
    padding: 6px 12px !important;
}

/* Dynamically hides the active filters container if it contains no actual chips */
.wpc-custom-selected-terms:empty,
.wpc-custom-selected-terms:not(:has(li)) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Failsafe to hide empty chip lists */
.wpc-filter-chips-list:empty {
    display: none !important;
}

.wpc-filters-ul-list {
    margin: 0 !important;
}

/* ==========================================================================
   FIBOSEARCH PLUGIN
   ========================================================================== */

/* Hides FiboSearch in the sidebar on Mobile/Tablet to prevent layout conflicts
   with the main header search bar */
@media (max-width: 1024px) {
    .sidebar .dgwt-wcas-search-wrapp,
    #secondary .dgwt-wcas-search-wrapp {
        display: none !important;
    }
}
