/**
 * Off-Plan Search Styles
 */

.houzez-offplan-shortcode-wrapper {
    padding-top: 2rem;
    padding-bottom: 2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 25px;
    text-transform: none;
}

.offplan-search-filters {
    margin-bottom: 2rem;
}

.offplan-search-filters .filter-bar {
    margin-bottom: 1.5rem;
}

/* Style filter inputs with rounded corners, background, and shadow */
.offplan-search-filters .bootstrap-select .dropdown-toggle,
.offplan-search-filters .bootstrap-select .form-control {
    background-color: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e0e0e0;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 25px;
    color: #000;
}

.offplan-search-filters .bootstrap-select .dropdown-toggle:hover,
.offplan-search-filters .bootstrap-select .dropdown-toggle:focus {
    border-color: #d0d0d0;
}

.offplan-search-filters .bootstrap-select.open .dropdown-toggle {
    border-color: #d0d0d0;
}

/* Title and Sort Row */
.offplan-title-sort-row {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.offplan-title-sort-row .page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #000;
    font-family: 'Be Vietnam Pro', sans-serif;
    line-height: 25px;
}

.offplan-title-sort-row .sort-by {
    display: flex;
    align-items: center;
}

.offplan-title-sort-row .sort-by-title {
    margin-right: 0.75rem;
    font-weight: 400;
    color: #333;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 25px;
}

.offplan-title-sort-row .bootstrap-select .dropdown-toggle,
.offplan-title-sort-row .bootstrap-select .form-control {
    background-color: #ffffff;
    border-radius: 0.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 25px;
}

.offplan-search-filters .form-group {
    margin-bottom: 0;
}

.offplan-search-filters .form-label {
    font-weight: 400;
    margin-bottom: 0.5rem;
    display: block;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    color: #000;
    line-height: 25px;
}

.offplan-search-filters #offplan-search-btn {
    min-width: 120px;
    height: 45px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 25px;
    text-transform: none;
    background-color: #262626;
    border-color: #262626;
    color: #ffffff;
}

.offplan-search-filters #offplan-search-btn:hover,
.offplan-search-filters #offplan-search-btn:focus {
    background-color: #262626;
    border-color: #262626;
    color: #ffffff;
}

/* Per-field clear (x) inside each filter - aligned to dropdown row */
.offplan-search-filters .offplan-filter-wrap {
    position: relative;
}

.offplan-search-filters .offplan-filter-clear {
    display: none;
    position: absolute;
    right: 10px;
    bottom: 11px;
    top: auto;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #666;
    font-size: 20px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transform: none;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    outline: none;
}

.offplan-search-filters .offplan-filter-clear:hover {
    color: #000;
}

.offplan-search-filters .offplan-filter-clear:focus {
    outline: none;
}

/* Show clear icon only when this field has a selected value */
.offplan-search-filters .offplan-filter-wrap.has-value .offplan-filter-clear {
    display: inline-block;
}

/* Loading indicator */
#offplan-loading {
    margin: 1.5rem 0;
}

#offplan-loading .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Results container – smooth opacity transitions */
#offplan-results-container {
    transition: opacity 0.2s ease-out;
}

#offplan-results-container.loading {
    opacity: 0.55;
    pointer-events: none;
}

#offplan-loading {
    transition: opacity 0.15s ease-out;
}

/* Gallery images full width after AJAX: allow grid items to shrink so images fit inside the card */
#offplan-results-container > .item-listing-wrap {
    min-width: 0;
    max-width: 100%;
}
#offplan-results-container .item-header,
#offplan-results-container .listing-image-wrap,
#offplan-results-container .listing-thumb,
#offplan-results-container .image-wrap,
#offplan-results-container .hover-effect.image-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
#offplan-results-container .image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Gallery carousel (after theme JS runs) – keep inside card */
#offplan-results-container .listing-gallery-wrap,
#offplan-results-container .listing-gallery-wrap .hover-effect,
#offplan-results-container .houzez-listing-carousel,
#offplan-results-container .houzez-listing-carousel .slick-slide img {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
#offplan-results-container .houzez-listing-carousel .slick-slide img {
    height: 100%;
    object-fit: cover;
}

/* Load more (matches theme .btn-load-more) */
.offplan-pagination-wrapper {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Busy state while off-plan AJAX load-more runs (theme button + .houzez-loader-js) */
.offplan-pagination-wrapper .houzez-infinite-load.offplan-ajax-busy {
    pointer-events: none;
    opacity: 0.85;
}

/* Desktop: Search button 10% width */
@media (min-width: 992px) {
    .offplan-search-filters .offplan-search-btn-wrapper {
        width: 10%;
        flex: 0 0 10%;
        max-width: 10%;
    }
    
    .offplan-search-filters .row > .col-lg-3:not(.offplan-search-btn-wrapper) {
        width: 30%;
        flex: 0 0 30%;
        max-width: 30%;
    }
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .offplan-search-filters .filter-bar {
        padding: 1rem;
    }


    /* Two filter columns per row (each .offplan-filter-wrap); bootstrap-select stays 100% of cell */
    .offplan-search-filters .row > .col-md-6 {
        flex: 0 0 50%;
        width: 50%;
        max-width: 50%;
    }
    
    .offplan-search-filters #offplan-search-btn {
        width: 100%;
    }
    

    /* Title left, sort right; title stays on one line */
    .offplan-title-sort-row {
        flex-wrap: nowrap;
        gap: 8px;
    }



    .offplan-title-sort-row .sort-by {
        width: auto;
        flex: 0 1 auto;
        min-width: 0;
        margin-left: auto;
    }

    .offplan-title-sort-row .sort-by > .d-flex {
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    .offplan-title-sort-row .bootstrap-select {
        width: auto !important;
        min-width: 130px;
        max-width: min(52vw, 220px);
    }
}

/* Ensure selectpicker dropdowns are visible */
.offplan-search-filters .bootstrap-select {
    width: 100% !important;
}

.offplan-search-filters .bootstrap-select .dropdown-toggle {
    height: 45px;
    line-height: 45px;
}

