/* ============================================
   BELTS SEARCH WIDGET STYLES
   Includes slider text input functionality
   
   RESPONSIVE LAYOUT RULES:
   ≥1020px: Side-by-side (search left, 2-4 columns right)
   <1020px: Stacked (search above, 1 column below)
   
   Column breakdowns:
   - ≥1600px: 4 columns
   - 1280-1599px: 3 columns
   - 1020-1279px: 2 columns
   - <1020px: 1 column (stacked)
   ============================================ */

* {
    box-sizing: border-box;
}

/* ============================================
   BASE WIDGET CONTAINER
   ============================================ */
#belts-search-widget {
    width: 100%;
    min-width: 420px;
    max-height: 120vh;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

/* ============================================
   SEARCH PARENT CONTAINER - CENTERING FIX
   ============================================ */
#search-parent {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ============================================
   SLIDER RANGE INFO STYLES - TEXT INPUTS ADDED
   ============================================ */
.slider-range-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0 auto 15px auto;
    font-family: 'Nunito Sans', Arial, sans-serif;
    width: fit-content;
}

.available-range {
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: 0.9em;
    color: #018345;
    font-weight: bold;
}

.available-range .range-label {
    font-weight: bold;
    color: #018345;
    margin-left: 5px;
}

.selected-range {
    display: flex;
    align-items: center;
    white-space: nowrap;
    gap: 8px;
    font-size: 0.95em;
    color: #4230a8;
    font-weight: 500;
}

.input-wrapper {
    display: inline-block;
    position: relative;
}

.validation-message {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 2px;
    padding: 4px 8px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 3px;
    font-size: 0.8em;
    color: #856404;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Slider text inputs with UOM inside */
.slider-input {
    width: 90px;
    height: 24px;
    padding: 2px 6px;
    border: 2px solid #4230a8;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
    color: #4230a8;
    text-align: left;
    background-color: #fff;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.slider-input:focus {
    outline: none;
    border-color: #3020a0;
    box-shadow: 0 0 0 3px rgba(66, 48, 168, 0.1);
    background-color: #fafbff;
}

.slider-input:hover {
    border-color: #3020a0;
}

.slider-input::selection {
    background-color: #4230a8;
    color: white;
}

.range-separator {
    color: #4230a8;
    font-weight: 600;
    padding: 0 2px;
}

/* ============================================
   FIELDSET & LEGEND STYLES
   ============================================ */
#belts-search-widget fieldset {
    margin-bottom: 1em;
    border: 1px solid #ccc;
    padding: 10px;
    overflow: hidden;
}

#belts-search-widget legend {
    font-weight: bold;
    font-size: 0.9em;
    background-color: #018345;
    border-radius: 8px;
    color: #FFFFFF;
    padding: 4px 8px;
    margin-bottom: 5px;
    cursor: pointer;
}

fieldset legend {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    color: #008345;
    background-color: #FFFFFF;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold !important;
    margin-bottom: 15px;
    border-bottom: 2px solid #0073aa;
    text-transform: uppercase;
}

/* Legend Arrow Indicator */
fieldset legend::after {
    content: "▼";
    font-size: 14px;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

fieldset.open legend::after {
    transform: rotate(180deg);
}

/* Slider Filter Legends - No Arrow, Not Clickable */
fieldset.slider-filter legend {
    padding-left: 10px;
    padding-right: 10px;
    pointer-events: none;
    cursor: default;
}

fieldset.slider-filter legend::after {
    content: none;
}

/* Fieldset Accordion Behavior */
fieldset:not(.slider-filter) > *:not(legend, .status-text) {
    display: none;
}

fieldset.open > *:not(legend, .status-text) {
    display: block;
}

/* Slider Filters Always Visible */
fieldset.slider-filter {
    height: auto;
    min-height: 175px;
    padding-left: 15px;
    padding-right: 15px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* General Search Fieldset Always Visible */
#general-search-fieldset {
    display: block !important;
    visibility: visible !important;
}

/* ============================================
   FORM INPUTS & CONTROLS
   ============================================ */
#belts-search-widget label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5em;
    cursor: pointer;
}

#belts-search-widget input[type="checkbox"] {
    margin-right: 10px;
}

#belts-search-widget button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 0.5em 1em;
    cursor: pointer;
    width: 100%;
    border-radius: 5px;
}

#belts-search-widget input[type="range"] {
    width: calc(100% - 10px);
    margin: 5px;
}

.belts-search-widget fieldset legend {
    font-size: 14px;
    font-weight: bold !important;
    color: #008345;
    padding: 8px 12px;
    margin-bottom: 15px;
    border-bottom: 2px solid #0073aa;
    text-transform: uppercase;
}

/* ============================================
   SEARCH INPUT STYLES
   ============================================ */
#search-container {
    margin: 0px 10px 15px 0px;
    align-items: center;
    width: 90%;
    max-width: 500px;
    justify-content: left;
}

form .no-submit {
    width: 180px;
    align-items: center;
    color: white;
    right: 0;
    display: flex;
    padding: 2px;
    border: 1px solid currentColor;
    border-radius: 5px;
    margin: 0 0;
}

input[type="search"] {
    border: none;
    background-color: transparent;
    margin: 0;
    padding: 7px 8px 7px 30px;
    font-size: 16px;
    color: inherit;
    border: 1px solid black;
    border-radius: inherit;
}

input[type="search"]::placeholder {
    color: white;
}

input[type="search"]:focus {
    box-shadow: 0 0 3px 0 #3f69a8;
    border-color: #3f69a8;
    outline: none;
}

#general_search {
    padding-left: 30px;
    background-repeat: no-repeat;
    background-position: 5px center;
    background-size: 20px;
}

/* ============================================
   FILTER BOXES & DROPDOWNS
   ============================================ */
.belts-search-filter {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #fff;
    margin-bottom: 15px;
    border-radius: 5px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.fabrication-type_filter_box.asp_sett_scroll,
.fabrication_color_filter_box.asp_sett_scroll {
    max-height: none !important;
    overflow: visible !important;
}

.fabrication-type_filter_box,
.fabrication_color_filter_box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.fabrication-type_filter_box .asp_option,
.fabrication_color_filter_box .asp_option {
    display: flex;
    align-items: center;
}

fieldset .fabrication-type_filter_box,
#custom-dropdown {
    position: relative;
    width: 100%;
    max-width: 430px;
    font-family: Nunito Sans;
}

#typeahead-input {
    width: 80%;
    padding: 10px;
    margin-bottom: 5px;
    border: 1px solid #ccc;
}

#dropdown-options {
    display: none;
    flex-direction: column;
    position: absolute;
    width: 80%;
    background: white;
    border: 1px solid #ccc;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
}

.dropdown-option {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
}

.dropdown-option:hover {
    background-color: #f0f0f0;
}

.part-number {
    background-color: #e0e0e0;
    padding: 2px 5px;
    border-radius: 4px;
    margin-right: 10px;
    white-space: nowrap;
}

.description {
    background-color: transparent;
}

/* ============================================
   SLIDER STYLES (noUiSlider)
   ============================================ */
.range-slider {
    margin: 20px auto;
    height: 300px;
    width: 80%;
}

.slider-values {
    display: flex;
    color: #018345;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.slider-values > * {
    margin: 0 5px;
}

.slider-values span {
    color: #018345;
    font-weight: bold;
    margin: 0 5px;
}

.noUi-target {
    background: #ccc;
    border-radius: 5px;
    height: 6px;
}

.noUi-connect {
    background: #018345;
}

.noUi-handle {
    width: 8px;
    height: 10px;
    background: #018345;
    border: 2px solid #e3e2ad;
    cursor: pointer;
}

.noUi-tooltip {
    display: none;
}

.noUi-active .noUi-tooltip {
    display: block;
}

.noUi-pips {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.noUi-value {
    font-size: 12px;
    text-align: center;
}

.noUi-marker-horizontal.noUi-marker-large {
    height: 6px;
}

/* ============================================
   SEARCH CONTROLS - CENTERED LAYOUT
   ============================================ */
.search-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    width: 100%;
    flex-wrap: nowrap;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

/* Search and Reset Buttons - Base Styles */
.search-controls button,
.search-controls #search-button,
.search-controls #reset-search,
.search-controls #search-button-bottom,
.search-controls #reset-search-bottom {
    min-width: 100px;
    max-width: 140px;
    flex: 1 1 auto;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-controls button[type="submit"] {
    background-color: #018345;
    color: white;
    border: 2px solid #018345;
}

.search-controls button[type="submit"]:hover {
    background-color: #016835;
    border-color: #016835;
}

.search-controls button.reset-button {
    background-color: white;
    color: #018345;
    border: 2px solid #018345;
}

.search-controls button.reset-button:hover {
    background-color: #f0f0f0;
}

/* Chevron Icons - Base Styles */
.expand-all-filters,
.collapse-all-filters {
    width: 28px;
    height: 28px;
    min-width: 24px;
    min-height: 24px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.expand-all-filters:hover,
.collapse-all-filters:hover {
    transform: scale(1.1);
}

/* Chevrons Container - Keep Together */
.search-controls .expand-all-filters,
.search-controls .collapse-all-filters {
    margin-left: 2px;
    margin-right: 2px;
}

/* ============================================
   UNIT TOGGLE
   ============================================ */
.unit-toggle {
    margin: 15px auto;
    width: auto !important;
    max-width: 100% !important;
    min-width: auto !important;
    padding: 8px 12px;
    text-align: left;
    box-sizing: border-box;
    display: inline-block;
}

/* Desktop: keep centered */
.unit-system-toggle {
    display: inline-flex !important;
    justify-content: left;
    align-items: left;
    gap: 12px;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

.unit-label {
    font-weight: bold;
    color: #018345;
    white-space: nowrap !important;
    display: inline-block;
}

.unit-toggle-options {
    display: inline-flex !important;
    gap: 15px;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

.unit-option {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap !important;
}

.unit-option label {
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
}

.unit-option input[type="radio"] {
    margin: 0 !important;
    flex-shrink: 0 !important;
    width: auto !important;
}

/* Keep the main legend text uppercase */
#nominal-oag-legend,
#strength-legend,
#temperature-legend,
#minpulley-legend,
#maxwidth-legend {
    text-transform: uppercase;
}

/* Preserve original case for units */
.unit-text {
    text-transform: none !important;
}

/* ============================================
   STATUS TEXT & LOADER
   ============================================ */
.status-container {
    display: flex;
    justify-content: center;
}

.status-text {
    text-align: center;
    font-size: 0.9em;
    font-weight: 500;
    color: #830137;
}

#search-status-popup {
    display: none;
    text-align: center;
}

.loader {
    border: 6px solid #ccc;
    border-top: 6px solid #0073aa;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   MODALS
   ============================================ */
.search-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9000;
    justify-content: center;
    align-items: center;
}

.search-modal-content {
    position: absolute;
    background: white;
    font-family: Arial, sans-serif;
    top: 10%;
    left: 50%;
    transform: translate(-50%, 0);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 80%;
}

.search-modal-overlay.visible {
    display: flex;
}

#search-summary {
    list-style-type: none;
    padding: 0;
}

#search-summary ul {
    margin: 5px 0 10px 25px;
    padding-left: 0;
}

.search-summary-inline {
    display: block;
    margin-left: 25px;
}

.search-modal-content h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

.search-modal-content ul {
    list-style-type: none;
    padding: 0;
    text-align: left;
}

.search-modal-content ul li {
    margin-bottom: 5px;
}

.no-results-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.no-results-modal-overlay.visible {
    display: flex;
}

.no-results-modal-content {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translate(-50%, 0);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 80%;
    text-align: center;
}

.no-results-modal-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
}

.no-results-modal-button:hover {
    background: #0056b3;
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */
.slider-input:focus-visible {
    outline: 3px solid #4230a8;
    outline-offset: 2px;
}

/* Better contrast for error states */
.slider-input.error {
    border-color: #d9534f;
    background-color: #fff5f5;
}

.slider-input.error:focus {
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.1);
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   PREVENT OVERFLOW & ENSURE BOX MODEL
   ============================================ */
#search-widget-div,
#search-data-div,
#belts-search-widget,
.belts-loop-grid {
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.noUi-target,
.noUi-horizontal {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.noUi-pips,
.noUi-pips * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.noUi-marker,
.noUi-value {
    display: block !important;
    visibility: visible !important;
}

.noUi-horizontal {
    min-width: 320px !important;
}

/* ============================================
   FIX: PRODUCT GRID OVERFLOW
   ============================================ */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.elementor-section,
.e-con,
.elementor-container {
    overflow-x: hidden !important;
}

.belts-loop-grid,
.fabrications-loop-grid,
.elementor-widget-loop-grid {
    max-width: 100% !important;
    width: 100% !important;
    overflow: visible !important;
}

.elementor-loop-container,
.e-loop-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ============================================
   ===========================================
   RESPONSIVE LAYOUT SYSTEM
   ===========================================
   ============================================ */

/* ============================================
   1. SIDE-BY-SIDE LAYOUT (≥1020px)
   Search widget left, 2-4 column grid right
   ============================================ */
@media (min-width: 1020px) {
    /* Parent container - horizontal flex */
    #search-parent,
    #search-parent.e-con,
    #search-parent .e-con-inner,
    .elementor-196785 .elementor-element.elementor-element-f5b2f50 {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
        gap: 20px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Search widget container - fixed width */
    #search-widget-div,
    #search-widget-div.e-con,
    .elementor-196785 .elementor-element.elementor-element-a3b1c51 {
        width: 420px !important;
        min-width: 420px !important;
        max-width: 450px !important;
        flex: 0 0 420px !important;
        flex-shrink: 0 !important;
        --margin-right: 0px !important;
        margin-right: 0 !important;
    }

    /* Results container - takes remaining space */
    #search-data-div,
    #search-data-div.e-con,
    .elementor-196785 .elementor-element.elementor-element-a8ef7a9 {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        --margin-right: 0px !important;
        margin-right: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Search widget itself */
    #belts-search-widget,
    #fabrications-search-widget {
        width: 100% !important;
        min-width: 420px !important;
    }
    
    /* Grid - responsive columns based on available space */
    .elementor-loop-container.elementor-grid,
    .elementor-grid,
    .e-loop-container {
        display: grid !important;
        gap: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Grid items */
    .elementor-loop-container .elementor-grid-item,
    .e-loop-container .e-loop-item,
    .elementor-grid > * {
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    /* Search controls */
    .search-controls {
        gap: 12px;
    }
    
    .search-controls button {
        min-width: 110px;
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .expand-all-filters,
    .collapse-all-filters {
        width: 30px;
        height: 30px;
    }
    
    /* noUiSlider */
    #search-widget-div .noUi-target,
    #belts-search-widget .noUi-target {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    #search-widget-div form,
    #search-widget-div fieldset,
    #search-widget-div .range-slider,
    #belts-search-widget form,
    #belts-search-widget fieldset,
    #belts-search-widget .range-slider {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* 2-column grid (1020px - 1279px) */
@media (min-width: 1020px) and (max-width: 1279px) {
    .elementor-loop-container.elementor-grid,
    .elementor-grid,
    .e-loop-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* 3-column grid (1280px - 1599px) */
@media (min-width: 1280px) and (max-width: 1599px) {
    .elementor-loop-container.elementor-grid,
    .elementor-grid,
    .e-loop-container {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* 4-column grid (≥1600px) */
@media (min-width: 1600px) {
    .elementor-loop-container.elementor-grid,
    .elementor-grid,
    .e-loop-container {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ============================================
   2. STACKED LAYOUT (<1020px)
   Search widget above (wider), single column below
   ============================================ */
@media (max-width: 1019px) {
    /* Parent container - vertical stack */
    #search-parent,
    #search-parent.e-con,
    #search-parent .e-con-inner,
    .elementor-196785 .elementor-element.elementor-element-f5b2f50 {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Reset Elementor's asymmetric margins */
    .elementor-196785 .elementor-element.elementor-element-a3b1c51 {
        --margin-right: 0px !important;
        margin-right: 0 !important;
    }
    
    .elementor-196785 .elementor-element.elementor-element-a8ef7a9 {
        --margin-right: 0px !important;
        margin-right: 0 !important;
    }
    
    /* Center the outer container */
    .elementor-196785 .elementor-element.elementor-element-7940c64 {
        --margin-left: 0px !important;
        --margin-right: 0px !important;
    }

    /* Search widget container - full width, centered content */
    #search-widget-div,
    #search-widget-div.e-con {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        flex: 0 0 auto !important;
        display: flex !important;
        justify-content: center !important;
        margin-bottom: 25px !important;
    }
    
    /* Search widget itself - wider when stacked (570px = 420 + 150) */
    #belts-search-widget,
    #fabrications-search-widget {
        width: 570px !important;
        min-width: 420px !important;
        max-width: calc(100% - 40px) !important;
    }

    /* Results container - full width, centered content */
    #search-data-div,
    #search-data-div.e-con {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        flex: 0 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    /* Grid - SINGLE COLUMN ONLY */
    .elementor-loop-container.elementor-grid,
    .elementor-grid,
    .e-loop-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 25px !important;
        width: 100% !important;
    }
    
    /* Grid items - fixed width, centered */
    .elementor-loop-container .elementor-grid-item,
    .e-loop-container .e-loop-item,
    .elementor-grid > * {
        width: 500px !important;
        max-width: calc(100% - 40px) !important;
        min-width: unset !important;
        margin: 0 auto !important;
    }
    
    /* Search controls centered */
    .search-controls {
        justify-content: center !important;
    }
    
    /* noUiSlider adjustments */
    #search-widget-div .noUi-target,
    #belts-search-widget .noUi-target {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    #search-widget-div form,
    #search-widget-div fieldset,
    #search-widget-div .range-slider,
    #belts-search-widget form,
    #belts-search-widget fieldset,
    #belts-search-widget .range-slider {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ============================================
   3. TABLET STACKED (768px - 1019px)
   Slightly larger items
   ============================================ */
@media (min-width: 768px) and (max-width: 1019px) {
    /* Wider search widget on tablet */
    #belts-search-widget,
    #fabrications-search-widget {
        width: 600px !important;
    }
    
    /* Wider loop items on tablet */
    .elementor-loop-container .elementor-grid-item,
    .e-loop-container .e-loop-item,
    .elementor-grid > * {
        width: 550px !important;
    }
    
    /* Container padding */
    #search-parent .e-con-inner,
    #search-parent.e-con {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    #search-widget-div,
    #search-data-div {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Search controls */
    .search-controls {
        gap: 10px;
        padding: 10px 12px;
    }
    
    .search-controls button {
        min-width: 100px;
        padding: 9px 16px;
        font-size: 13px;
    }
    
    .expand-all-filters,
    .collapse-all-filters {
        width: 28px;
        height: 28px;
    }
    
    .unit-toggle {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .unit-system-toggle {
        justify-content: flex-start !important;
        gap: 8px !important;
    }
    
    .unit-toggle-options {
        gap: 10px !important;
    }
    
    .unit-option {
        gap: 3px !important;
    }
}

/* ============================================
   4. MOBILE (<768px)
   Full width everything
   ============================================ */
@media (max-width: 767px) {
    #search-parent,
    #search-parent.e-con,
    #search-parent .e-con-inner {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    #search-widget-div,
    #search-widget-div.e-con,
    #search-data-div,
    #search-data-div.e-con {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 320px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Full-width search widget */
    #belts-search-widget,
    #fabrications-search-widget {
        width: 100% !important;
        min-width: unset !important;
        max-width: calc(100% - 20px) !important;
        padding: 12px 10px;
    }
    
    /* Full-width loop items */
    .elementor-loop-container .elementor-grid-item,
    .e-loop-container .e-loop-item,
    .elementor-grid > * {
        width: 100% !important;
        max-width: calc(100% - 20px) !important;
        min-width: unset !important;
    }
    
    /* Single column grid - tighter gap */
    .elementor-loop-container.elementor-grid,
    .elementor-grid,
    .e-loop-container {
        gap: 20px !important;
    }
    
    /* noUiSlider mobile */
    .noUi-horizontal {
        min-width: 280px !important;
    }
    
    /* Mobile slider input adjustments */
    .slider-input {
        width: 75px;
        font-size: 0.85em;
        padding: 3px 6px;
    }
    
    .selected-range {
        font-size: 0.85em;
        gap: 6px;
    }
    
    .available-range {
        font-size: 0.85em;
    }
    
    .slider-range-info {
        gap: 6px;
        margin-bottom: 10px;
    }
    
    .validation-message {
        font-size: 0.75em;
        white-space: normal;
        max-width: 200px;
    }
    
    /* Compact search controls */
    .search-controls {
        gap: 8px;
        padding: 8px 10px;
        flex-wrap: nowrap;
        justify-content: center;
        position: relative !important;
        z-index: 1 !important;
        margin-top: 15px !important;
        padding-top: 8px !important;
    }
    
    .search-controls button {
        min-width: 85px;
        max-width: 120px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .expand-all-filters,
    .collapse-all-filters {
        width: 24px;
        height: 24px;
        min-width: 22px;
        min-height: 22px;
    }
    
    .unit-toggle {
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .unit-system-toggle {
        justify-content: flex-start !important;
        gap: 6px !important;
    }
    
    .unit-toggle-options {
        gap: 8px !important;
    }
    
    .unit-option {
        gap: 2px !important;
    }
    
    #search-widget-div {
        margin-top: -20px !important;
        margin-bottom: 10px !important;
    }
    
    #search-data-div {
        padding-left: 10px !important;
        padding-right: 10px !important;
        display: flex !important;
        justify-content: center !important;
    }
}

/* ============================================
   5. VERY SMALL MOBILE (<360px)
   Scale down further
   ============================================ */
@media (max-width: 360px) {
    #search-widget-div,
    #search-widget-div.e-con {
        min-width: 300px !important;
    }
    
    #belts-search-widget {
        min-width: 280px;
    }
    
    .slider-input {
        width: 65px;
        font-size: 0.8em;
    }
    
    .search-controls {
        gap: 6px;
        padding: 6px 8px;
    }
    
    .search-controls button {
        min-width: 75px;
        max-width: 100px;
        padding: 7px 10px;
        font-size: 12px;
    }
    
    .expand-all-filters,
    .collapse-all-filters {
        width: 22px;
        height: 22px;
        min-width: 20px;
        min-height: 20px;
    }
}