/* Container for horizontal layout */
.uwcf-horizontal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

/* Ensure inputs share space equally */
.uwcf-horizontal-filters > * {
    flex: 1 1 16%;
    min-width: 160px; 
}

/* Match native search box styling to Select2 */
.uwcf-search-input {
    padding: 0 12px !important;
    border: 1px solid #aaa !important;
    border-radius: 4px !important;
    height: 38px !important;
    background-color: #fff !important;
    box-sizing: border-box !important;
    font-size: 14px;
}

/* Enforce consistent Select2 Height */
.select2-container .select2-selection--single {
    height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

/* Override WooCommerce Button Styles for the Home Form */
.uwcf-home-form button {
    height: 38px;
    padding: 0 20px;
    white-space: nowrap;
    flex: 0 1 auto; 
}

/* --- Pill Styles --- */
#uwcf-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.uwcf-pill {
    background-color: #e2e8f0;
    color: #333;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}

.uwcf-pill-remove {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    color: #64748b;
}

.uwcf-pill-remove:hover {
    color: #0f172a;
}

/* Loading Overlay */
ul.products.loading-products {
    position: relative;
    opacity: 0.5;
    transition: opacity 0.3s ease-in-out;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: wait;
    background-color: rgba(255, 255, 255, 0.2);
}

#uwcf-load-more-container {
    text-align: center;
    padding: 20px 0;
}

.uwcf-load-more.disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* =========================================================
   Divi / WooCommerce Grid Override
   ========================================================= */

#uwcf-filter-container ul.products {
    display: grid !important;
    grid-gap: 20px; 
    margin: 0;
    padding: 0;
}

/* Force children to behave in the grid */
#uwcf-filter-container ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    clear: none !important;
}

/* Desktop (5 Columns) */
@media (min-width: 981px) {
    #uwcf-filter-container ul.products { 
        grid-template-columns: repeat(5, 1fr) !important; 
    }
}

/* iPad / Tablet (4 Columns) */
@media (min-width: 768px) and (max-width: 980px) {
    #uwcf-filter-container ul.products { 
        grid-template-columns: repeat(4, 1fr) !important; 
    }
}

/* Mobile (2 Columns) */
@media (max-width: 767px) {
    #uwcf-filter-container ul.products { 
        grid-template-columns: repeat(2, 1fr) !important; 
    }
}