@charset "UTF-8";
/* Custom Search Results Styles - Responsive & Map Components */

/**
 * Custom Search Result Styles - Responsive & Map Components
 * 
 * This stylesheet provides responsive styles and map functionality
 * for the listing-search page in the Pro-Found IDX/MLS WordPress plugin.
 * 
 * @since 1.0.0
 */

/* ========================================================================
   Map Components
   ======================================================================== */

#map {
    flex: 1;
    height: 100vh;
    position: sticky;
    top: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.map-search {
    flex: 0 0 calc(50% - 10px);
    background: white;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.map-and-palette-wrapper {
    display: block !important;
    flex: 0 0 calc(50% - 0px);
    position: relative;
}

/* Map Search Section */
.map-search.map-expanded {
    width: 50%;
}

.map-search.map-collapsed {
    width: 60px;
}

/* Map Body */
.map-body {
    flex: 1;
    position: static;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.map-search.map-collapsed .map-body {
    opacity: 0;
    pointer-events: none;
}

.results-map {
    width: 100%;
    height: 100%;
}

.ifound-results-map {
    width: 100%;
    height: calc(100vh - 110px) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

/* Close Map Button */
.close-map-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s ease;
    opacity: 140;
}

.close-map-btn i {
    font-size: 18px;
    color: #333;
}

/* Show close button when map is expanded */
.map-search.map-expanded .close-map-btn {
    display: flex;
    opacity: 1;
}

.map-search.map-collapsed .close-map-btn {
    display: none;
    opacity: 0;
}

/* ========================================================================
   Mobile Filter Popup
   ======================================================================== */

/* Mobile Filter Popup Overlay */
.mobile-filter-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    animation: fadeIn 0.3s ease;
}

/* Mobile Filter Popup Container */
.mobile-filter-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 99999;
    overflow-y: auto;
    animation: slideInUp 0.3s ease;
    overflow-x: hidden;
}

/* Show popup when active */
.mobile-filter-popup.active,
.mobile-filter-popup-overlay.active {
    display: block;
}

/* Popup Header */
.mobile-filter-popup-header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mobile-filter-popup-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.mobile-filter-popup-close {
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
}

.mobile-filter-popup-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.mobile-filter-popup-close i {
    font-size: 18px;
}

/* Popup Content */
.mobile-filter-popup-content {
    padding: 20px;
    padding-bottom: 80px;
    -webkit-overflow-scrolling: touch;
    
}

/* Make search-criteria-wrapper visible inside popup */
.mobile-filter-popup-content .search-criteria-wrapper {
    display: block !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Search buttons at bottom of popup */
.mobile-filter-popup-content .default-criteria-wrapper {
    display: block !important;
    border: none !important;
    padding: 10px 0 !important;
    margin-top: 20px !important;
}

.mobile-filter-popup-content button[type="submit"],
.mobile-filter-popup-content .button {
    width: 100% !important;
    margin-bottom: 10px !important;
}

/* Input fields inside popup */
.mobile-filter-popup-content input[type="text"],
.mobile-filter-popup-content input[type="number"],
.mobile-filter-popup-content input[type="email"],
.mobile-filter-popup-content select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Style filter buttons inside popup */
.mobile-filter-popup-content .dynamic-button {
    margin-bottom: 10px;
}

/* Ensure dropdowns/overlays are visible */
.mobile-filter-popup-content .lookups-body {
    display: none;
    max-width: 100% !important;
    min-width: auto !important;
    position: relative !important;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 10px;
    margin-top: 5px;
}

/* Fix overlay positioning inside popup */
.mobile-filter-popup-content .custom-overlay-container {
    position: relative;
}

.mobile-filter-popup-content .more-filters-overlay,
.mobile-filter-popup-content .budget-search-overlay {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 5px !important;
    z-index: 100 !important;
}

.mobile-filter-popup-content .custom-overlay-container.active .more-filters-overlay,
.mobile-filter-popup-content .custom-overlay-container.active .budget-search-overlay {
    display: block !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* ========================================================================
   Media Queries
   ======================================================================== */

/* Min-width: 1200px and Max-width: 1550px */
@media (min-width: 1200px) and (max-width: 1550px) {
    .budget-search-overlay {
        position: fixed;
        width: 400px;
        max-width: calc(100vw - 40px);
    }
}

/* Min-width: 768px */
@media (min-width: 768px) {
    .budget-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .lookup-checkbox-item {
        flex-direction: column;
    }

    .min-max-input-container {
        display: flex;
        flex-direction: row;
        gap: 5px;
    }

    .min-max-separator {
        display: block;
        padding: 0 10px 10px;
        font-size: 18px;
        color: #6b7280;
    }

    .min-max-apply-button {
        flex: 0 0 auto;
        width: auto;
        min-width: 100px;
        margin-top: 0;
    }
}

/* Max-width: 992px */
@media (max-width: 992px) {
    .search-container {
        flex-direction: column;
    }

    #map {
        position: relative;
        height: 400px;
    }

    .results-section {
        max-height: unset;
        overflow: visible;
    }
}

/* Max-width: 768px */
@media (max-width: 768px) {
    .site-inner {
        margin: 0px auto 0 !important;
        padding-left: 1%;
        padding-right: 1%;
        padding-top: 23px;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .map-search {
        position: static;
        height: auto;
    }

    .responsive-grid {
        display: flex;
    }

    .search-criteria-body {
        white-space: normal;
    }

    .search-filter-header {
        display: block;
    }

    #ifound_save_this_search-2 .button.save-this,
    .widget_ifound_save_this_search .button.save-this {
        white-space: nowrap !important;
    }

    .map-result-res {
        display: block;
    }

    .ifound-price-stats {
        position: static !important;
    }

    .more-filters-overlay,
    .budget-search-overlay {
        position: fixed;
        width: calc(100vw - 30px);
        max-width: 95vw;
        left: 15px !important;
        right: 15px !important;
    }

    .price-sort {
        white-space: nowrap;
        display: block;
        justify-content: space-between;
    }

    .ifound_no_results {
        padding: 40px 15px;
        min-height: 300px;
    }

    .no-results-icon svg {
        width: 100px;
        height: 100px;
    }

    .no-results-heading {
        font-size: 24px;
    }

    .no-results-message {
        font-size: 15px;
    }

    .no-results-button {
        padding: 12px 24px;
        font-size: 15px;
    }

    .clear-all-filters-btn {
        padding: 8px !important;
        border-radius: 50%;
        width: 25px;
        height: 25px;
        justify-content: center;
        margin-left: 6px;
        margin-right: 0;
        border: none !important;
        background: none;
    }

    .clear-all-filters-btn .clear-all-text {
        display: none;
    }

    .clear-all-filters-btn .clear-all-icon {
        display: inline;
        margin: 0;
        font-size: 27px;
    }

    .selected-filters-container {
        padding: 15px 6px;
    }

    .pagination-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 0;
    }

    .desktop-pagination-nav {
        display: none !important;
    }

    .mobile-bottom-pagination {
        display: flex !important;
    }

    .pagination-container>.sort-container:not(.mobile-sort) {
        display: none;
    }

    .mobile-sort {
        display: block !important;
        flex-shrink: 0;
    }

    .mobile-sort select {
        min-width: 120px;
        font-size: 12px;
        padding: 6px 10px;
        border: 1px solid #e9ecef;
        background: #f8f9fa;
        color: #1B5EA3;
        font-weight: 500;
        cursor: pointer;
        border-radius: 4px;
    }

    .mobile-sort .sort-select-wrap {
        margin: 0;
    }

    .listing-results-container {
        flex-direction: column;
    }

    .map-search.map-expanded {
        width: 100%;
        height: 40vh;
    }

    .map-search.map-expanded~.replace-results-here .search-grid,
    .map-search.map-collapsed~.replace-results-here .search-grid {
        grid-template-columns: 1fr;
    }

    .price-sort {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Mobile Map Fix - Works for all pages */
    /* Hide map by default on mobile - show only when .show-mobile class is added */
    .map-search:not(.show-mobile),
    .map-and-palette-wrapper:not(.show-mobile) {
        display: none !important;
    }


    /* When map has show-mobile class, make it fullscreen */
    .map-search.show-mobile,
    .map-and-palette-wrapper.show-mobile {
        display: block !important;
        top: 0;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: calc(100vh - 150px) !important;
        z-index: 9998 !important;
        background: white !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Map body should fill the container */
    .map-search.show-mobile .map-body,
    .map-and-palette-wrapper.show-mobile .map-body {
        width: 100% !important;
        height: 100% !important;
        position: relative !important;
    }

    /* Google Maps container should fill parent */
    .map-search.show-mobile .ifound-results-map,
    .map-and-palette-wrapper.show-mobile .ifound-results-map,
    .map-search.show-mobile .results-map,
    .map-and-palette-wrapper.show-mobile .results-map {
        width: 100% !important;
        height: 100% !important;
        position: relative !important;
        display: block !important;
    }

    /* Hide the "Click here to open map" overlay when map is in mobile fullscreen mode */


    /* Hide list when map is shown */
    .replace-results-here.hide-mobile {
        display: none !important;
    }

    /* Close button positioning */
    .map-search.show-mobile .close-map-btn {
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        z-index: 9999 !important;
        display: flex !important;
    }

    /* Prevent body scroll when map is open */
    body.map-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }

    /* Hide filters when map is fullscreen */
    .map-search.show-mobile~.ifound-dynamic-form-wrapper {
        display: none !important;
    }

    /* Make existing filter toggle trigger the popup on mobile */
    .search-criteria-heading,
    .search-filter-header,
    .filter-toggle {
        cursor: pointer;
    }

    /* Hide the normal dropdown behavior on mobile */
    .search-criteria-wrapper {
        display: none !important;
    }

    .dynamic-button {
        border-radius: 5px !important;
        padding: 2px 5px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        max-width: 700px;
        margin-right: 2px;
        font-size: 14px !important;
        font-weight: 500 !important;
        height: fit-content;
    }

    .search-results-after-map {
        margin: 0px 0 !important;
    }

    .mobile-filter-popup-content .more-filters-overlay,
    .mobile-filter-popup-content .budget-search-overlay {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 90vw !important;
        margin-top: 5px !important;
        z-index: 100 !important;
    }

    .mobile-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 24px !important;
        border: none;
        border-radius: 5px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        white-space: nowrap;
        outline: none;
        min-width: 120px;
    }

    .mobile-view-toggle {
        display: flex !important;
        position: fixed !important;
        bottom: 3% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        padding: 6px !important;
        z-index: 9999 !important;
        gap: 4px !important;
        animation: slideUp 0.3s ease-out !important;
    }
}

/* Screen and Max-width: 768px */
@media screen and (max-width: 768px) {
    .results-section {
        flex: 1;
        overflow: visible;
        scrollbar-width: thin;
        scrollbar-color: #bbb #f1f1f1;
    }

    .ifound-dynamic-form-wrapper {
        position: sticky;
        top: 49px !important;
        z-index: 100;
        right: 0px;
        width: 100%;
        display: block;
    }

    .site-header {
        top: 0px;
    }
}

/* Max-width: 500px */
@media (max-width: 500px) {
    .site-inner {
        margin: 31px auto 0 !important;
    }

    .more-budget .mobile-only {
        display: block !important;
    }

    .more-budget.desktop-only .more-filters-container,
    .more-budget.desktop-only .budget-container,
    .more-budget.desktop-only .budget-search-container {
        display: none !important;
    }

    #ifound_save_this_search-2 .button.save-this,
    .widget_ifound_save_this_search .button.save-this {
        padding: 9px 4px !important;
        width: 100% !important;
        white-space: nowrap !important;
    }

    .results-map .gmnoprint[role="menubar"]:not(.gm-style-mtc-bbw) {
        right: 17% !important;
        left: auto !important;
    }

    .budget-search-container .dynamic-button {
        padding: 0px !important;
    }

    .results-page .qsearch-button-wrapper {
        height: 40px;
        padding: 0 !important;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        width: 100% !important;
        cursor: pointer;
        transition: all 0.2s;
        margin: 0 !important;
        text-align: center;
    }

    .gmnoprint[role="menubar"]:not(.gm-style-mtc-bbw) {
        right: 17% !important;
        left: auto !important;
    }
}

/* Max-width: 480px */
@media (max-width: 480px) {
    .search-bar .lookups-body {
        min-width: auto;
    }

    .lookups-body {
        min-width: 322px !important;
        padding: 6px 10px;
    }

    .price-range-container {
        min-width: 100%;
        width: auto;
        box-sizing: border-box;
    }

    .budget-search-container .lookups-body {
          width: 90vw;
        padding: 6px 10px;
        height: 42vh;
        overflow: auto;
        right: 31vw;
    }
    

    .lookup-multi-checkbox-wrapper {
        grid-template-columns: 1fr;
    }

    .pagination-container {
        padding: 10px 6px;
        gap: 10px;
    }

    .total-properties {
        font-size: 15px;
    }

    .mobile-sort select {
        min-width: 100px;
        font-size: 11px;
        padding: 5px 8px;
    }

    .pagination-nav {
        gap: 4px;
    }

    .budget-search-container .ifound-wrap .dynamic-button {
        padding: 0px 0 0 8px !important;
    }

    .mobile-filter-popup-content .more-filters-overlay,
    .mobile-filter-popup-content .budget-search-overlay {
        width: 90vw !important;
        max-width: none !important;
        max-height: 60vh !important;
        left: 0% !important;
        right: auto !important;
        padding: 15px !important;
    }

    .mobile-show-criteria:before {
        font-size: 12px !important;
    }

    .ifound-wrap.responsive-grid .search-criteria-heading.search-filter-header {
        display: block;
        align-items: center !important;
        gap: 6px !important;
        padding: 2px 11px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        margin: 3px 5px 4px 0px;
        border: 1px solid;
        border-radius: 5px;
    }

    .search-criteria-heading.search-filter-header i {
        font-size: 12px !important;
        color: #fff !important;
        display: none;
    }

    .search-criteria-heading.search-filter-header .criteria-collapse-control {
        margin-left: 6px !important;
    }

    .results-section {
        margin-top: 0px !important;
    }

    .ifound-quick-search select,
    .ifound-quick-search textarea,
    .home .widget-wrap .quick-search .number-input,
    .home .widget_ifound_quick_search .ifound-multibox-quicksearch-spa .ifound-react-select-multibox-quicksearch__control {
        width: 150px
    }

    .ifound-react-select-multibox-advanced-container {
        width: 254px;
    }

    .ifound-react-select-multibox-advanced-container .ifound-react-select-multibox-advanced__option {
        text-align: left;
        font-size: 14px;
        padding: 8px 12px 8px 36px;
        white-space: normal;
        overflow: visible;
        line-height: 1.4;
        display: flex;
        align-items: center;
    }
}

/* Min-width: 500px */
@media (min-width: 500px) {
    .more-budget.mobile-only {
        display: none;
    }

    .results-page .button.save-this {
        margin-top: 1px !important;
    }
}

/* Min-width: 769px */
@media (min-width: 769px) {
    .mobile-filter-popup,
    .mobile-filter-popup-overlay {
        display: none !important;
    }

    .results-page .button.save-this {
        margin-top: 2px !important;
    }
}

/* Max-width: 600px */
@media only screen and (max-width: 600px) {
    .entry-title {
        font-size: 2.2rem !important;
        display: flex;
        justify-content: center;
        margin: 7px !important;
    }

    .modify-search-button-wrapper {
        display: flex;
        justify-content: center;
    }

    .site-inner {
        margin-top: 0;
        padding-left: 0% !important;
        padding-right: 0% !important;
        padding-top: 0px !important;
    }

    .clear-all-filters-btn .clear-all-text {
        display: none !important;
    }

    .clear-all-filters-btn .clear-all-icon {
        display: block !important;
        font-size: 16px;
    }
}

/* Max-width: 800px */
@media only screen and (max-width: 800px) {
    article.advanced-search,
    article.results-page,
    article.listing-details {
        padding: 0px !important;
    }

    .wrap {
        padding-left: 0% !important;
        padding-right: 0% !important;
    }
}

/* Min-width: 1600px */
@media (min-width: 1600px) {
    .map-search {
        flex: 0 0 calc(60% - 10px);
    }

    .replace-results-here {
        flex: 0 0 calc(40% - 0px) !important;
    }

    .map-and-palette-wrapper {
        flex: 0 0 calc(60% - 0px);
    }
}

/* Google Maps Styles */
.gm-style .gm-style-iw-d {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    overflow: auto;
}
