/* Container for listing items */
.listing-item-container .container {
    display: block;
    width: 100%;
    clear: both;
    overflow: hidden;
}

/* Ensure proper grid layout for listing items */
.listing-item {
    float: left;
    width: 50%;
    position: relative;
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* Fix padding for even/odd items */
.listing-item:nth-child(odd) {
    padding-right: 10px;
    clear: left; 
}

.listing-item:nth-child(even) {
    padding-left: 10px;
}

/* Add clearfix after every two items */
.listing-item:nth-child(2n+1) {
    clear: both;
}

/* Ensure consistent height for listing items */
.geodir-category-listing {
    height: 100%;
    margin-bottom: 0;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
}

/* Fix for one column layout */
.listing-item.has_one_column {
    width: 100%;
    padding: 0 !important;
    clear: both;
}

/* Fix for map container interaction */
.map-container.column-map {
    position: fixed;
    top: 80px;
    bottom: 0;
    height: calc(100vh - 80px);
    width: calc(100% - 850px);
    overflow: hidden;
}

/* Ensure the map container captures all touch events */
#map-main {
    width: 100%;
    height: 100%;
    touch-action: none;
    pointer-events: auto !important;
}

/* Add clearfix to prevent footer overlap */
.listing-item-container:after {
    content: "";
    display: table;
    clear: both;
}

/* Fix for sub-footer to ensure it's below all content */
.sub-footer {
    clear: both;
    position: relative;
    z-index: 1;
}

/* Fix for listing container to ensure proper spacing */
.listing-item-container {
    overflow: hidden;
}

/* Fix for listing items to ensure they don't overlap */
.listing-item:after {
    content: "";
    display: block;
    clear: both;
}

/* Fix for geodir-category-listing to ensure proper spacing */
.geodir-category-listing {
    margin-bottom: 15px;
}

/* Fix for mobile view */
@media only screen and (max-width: 768px) {
    .listing-item,
    .listing-item:nth-child(odd),
    .listing-item:nth-child(even) {
        width: 100%;
        padding: 0 0 20px 0 !important;
        clear: both;
    }

    .map-container.column-map {
        position: relative;
        width: 100%;
        height: 300px;
    }
}
