/* Scott Communities Home Search */

.scott-home-search {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    width: 100%;
}

.scott-search-sidebar {
    background: #f7f7f7;
    padding: 24px;
    border-radius: 6px;
}

.scott-search-sidebar h3,
.scott-results-header h3 {
    margin: 0 0 24px;
    font-size: 24px;
    line-height: 1.3;
}

.scott-search-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scott-search-form label {
    display: block;
    margin: 12px 0 0;
    font-size: 14px;
    font-weight: 600;
}

.scott-search-form select,
.scott-search-form input {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 4px;
    font-size: 14px;
}

.scott-range-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.scott-search-submit,
.scott-search-reset {
    width: 100%;
    min-height: 46px;
    padding: 12px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.scott-search-submit {
    margin-top: 22px;
    background: #252525;
    color: #fff;
    border: 1px solid #252525;
}

.scott-search-reset {
    background: transparent;
    color: #252525;
    border: 1px solid #aaa;
}

.scott-search-submit:disabled {
    opacity: .55;
    cursor: wait;
}

.scott-search-results {
    min-width: 0;
}

.scott-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.scott-results-header h3 {
    margin: 0;
}

.scott-results-count {
    font-size: 14px;
    color: #666;
}

.scott-home-search .listing-view .card-deck {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
}

.scott-home-search .listing-view .card-deck > * {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    margin: 0;
}

.scott-home-search .listing-view .card-deck .item-wrap {
    flex: none;
}

.scott-no-results,
.scott-search-error {
    grid-column: 1 / -1;
    padding: 36px 20px;
    text-align: center;
    background: #f7f7f7;
    border-radius: 6px;
}

.scott-is-loading .scott-search-results {
    opacity: .5;
    pointer-events: none;
}

.scott-home-search .pagination {
    margin-top: 24px;
}

@media (max-width: 1024px) {
    .scott-home-search {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .scott-home-search {
        grid-template-columns: 1fr;
    }

    .scott-search-sidebar {
        padding: 20px;
    }

    .scott-home-search .listing-view .card-deck {
        grid-template-columns: 1fr;
    }
}

/* Dual-handle range controls */

.scott-range {
    margin-top: 8px;
}

.scott-range > label {
    margin-bottom: 20px;
}

.scott-slider-track {
    position: relative;
    height: 5px;
    margin: 18px 10px 25px;
    background: #d8d8d8;
    border-radius: 5px;
}

.scott-slider-fill {
    position: absolute;
    height: 100%;
    left: 0;
    width: 100%;
    background: #005075;
    border-radius: inherit;
    pointer-events: none;
}

.scott-slider-track input[type="range"] {
    position: absolute;
    top: -18px;
    left: 0;
    width: 100%;
    height: 40px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: none;
}

.scott-slider-track input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 2px solid #005075;
    border-radius: 50%;
    cursor: grab;
    pointer-events: auto;
}

.scott-slider-track input[type="range"]::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #fff;
    border: 2px solid #005075;
    border-radius: 50%;
    cursor: grab;
    pointer-events: auto;
}

.scott-slider-track input[type="range"]:focus-visible::-webkit-slider-thumb {
    outline: 3px solid #90cdbb;
    outline-offset: 3px;
}

.scott-slider-track .scott-slider-max {
    z-index: 2;
}

.scott-range .scott-range-inputs {
    gap: 10px;
}

.scott-range-field {
    min-width: 0;
}

.scott-range-field span {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #666;
}

.scott-search-form .scott-range-field input {
    height: 40px;
    font-size: 13px;
}

/* Scott Communities steppers */
.scott-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.scott-stepper label {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.scott-stepper-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.scott-search-form .scott-stepper-controls input {
    width: 38px;
    height: 36px;
    padding: 0;
    text-align: center;
    border: 0;
    background: transparent;
    font-weight: 600;
    appearance: textfield;
    -moz-appearance: textfield;
}

.scott-stepper-controls input::-webkit-inner-spin-button,
.scott-stepper-controls input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.scott-stepper-controls button {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #b8c8cc;
    border-radius: 50%;
    background: #fff;
    color: #005075;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.scott-stepper-controls button:disabled {
    opacity: .35;
    cursor: default;
}

/* =========================================
   Scott Communities - Property Card Styling
   ========================================= */

/* Consistent card layout */
.scott-home-search .item-wrap {
    min-width: 0;
    height: 100%;
}

.scott-home-search .item-wrap .property-item {
    height: 100%;
}

.scott-home-search .item-wrap .item-body {
    padding: 18px 4px 12px;
}

/* Property photos */
.scott-home-search .item-wrap .listing-image-wrap,
.scott-home-search .item-wrap .listing-thumb {
    overflow: hidden;
    border-radius: 6px;
}

.scott-home-search .item-wrap .listing-thumb img,
.scott-home-search .item-wrap .listing-image-wrap img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Titles: show up to two lines */
.scott-home-search .item-wrap .item-title,
.scott-home-search .item-wrap .item-title a {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
    color: #173b50;
}

.scott-home-search .item-wrap .item-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    margin-bottom: 7px;
    min-height: 2.9em;
}

/* Community and location */
.scott-home-search .item-wrap .item-address {
    font-size: 13px;
    line-height: 1.5;
    color: #777;
    margin-bottom: 14px;
}

/* Property stats */
.scott-home-search .item-wrap .item-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 15px;
    margin-bottom: 14px;
}

.scott-home-search .item-wrap .item-amenities li {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.scott-home-search .item-wrap .item-amenities i {
    color: #548b79;
}

/* Buttons */
.scott-home-search .item-wrap .btn-primary,
.scott-home-search .item-wrap .btn-secondary {
    background: #003c59;
    border-color: #003c59;
    color: #fff;
    border-radius: 4px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color .2s ease;
}

.scott-home-search .item-wrap .btn-primary:hover,
.scott-home-search .item-wrap .btn-secondary:hover {
    background: #006084;
    border-color: #006084;
    color: #fff;
}

/* Keep card actions from overlapping content */
.scott-home-search .item-wrap .item-footer {
    margin-top: 14px;
}

/* Mobile refinements */
@media (max-width: 767px) {
    .scott-home-search .item-wrap .item-body {
        padding: 16px 2px;
    }

    .scott-home-search .item-wrap .item-title {
        min-height: 0;
    }
}

/* ==========================================
   Scott Communities - Houzez V1 Layout Fix
   ========================================== */

/* Each listing is an independent vertical card */
.scott-home-search .item-listing-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    border: 0;
    box-shadow: none;
    background: transparent;
}

/* Override Houzez's horizontal flex behavior */
.scott-home-search .item-wrap-v1 > .d-flex {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: 100%;
}

/* Photo takes full card width */
.scott-home-search .item-wrap-v1 .item-header {
    width: 100%;
    max-width: 100%;
    flex: none;
}

/* Details sit below the photo */
.scott-home-search .item-wrap-v1 .item-body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 18px 4px 12px;
    background: transparent;
}

/* Remove inherited truncation constraints */
.scott-home-search .item-wrap-v1 .item-title {
    display: block;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    min-height: 0;
    margin-bottom: 8px;
}

.scott-home-search .item-wrap-v1 .item-title a {
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.4;
}

/* Let the community name wrap */
.scott-home-search .item-wrap-v1 .item-address {
    white-space: normal;
    overflow: visible;
    margin-bottom: 14px;
}

/* Prevent Houzez's floated button from overlapping stats */
.scott-home-search .item-wrap-v1 .item-body .btn {
    float: none !important;
    position: static !important;
    align-self: flex-start;
    margin-top: 16px;
    margin-left: 0;
    clear: both;
}

/* Make the property features wrap naturally */
.scott-home-search .item-wrap-v1 .item-amenities {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    width: 100%;
    margin-bottom: 8px;
}

.scott-home-search .item-wrap-v1 .item-amenities li {
    float: none;
    margin: 0;
}

/* Keep the cards separated */
.scott-home-search .listing-view .card-deck {
    align-items: stretch;
    gap: 32px 28px;
}

/* Mobile */
@media (max-width: 767px) {
    .scott-home-search .item-wrap-v1 .item-body {
        padding: 16px 2px;
    }
}

/* =========================================
   Scott Communities - Custom Property Cards
   ========================================= */

.scott-home-search .scott-property-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e9eb;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 35, 55, .04);
}

.scott-home-search .scott-property-image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #edf0f0;
}

.scott-home-search .scott-property-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.scott-home-search .scott-property-image:hover img {
    transform: scale(1.035);
}

.scott-home-search .scott-property-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 7px 10px;
    border-radius: 3px;
    background: #003c59;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.scott-home-search .scott-property-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 22px;
}

.scott-home-search .scott-property-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 8px;
    margin-bottom: 12px;
    color: #003c59;
}

.scott-home-search .scott-property-price span {
    font-size: 13px;
    color: #687780;
}

.scott-home-search .scott-property-price strong {
    font-size: 23px;
    font-weight: 700;
    line-height: 1.2;
}

.scott-home-search .scott-property-title {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
}

.scott-home-search .scott-property-title a {
    color: #173b50;
    text-decoration: none;
}

.scott-home-search .scott-property-title a:hover {
    color: #007397;
}

.scott-home-search .scott-property-location {
    margin-bottom: 20px;
    color: #748087;
    font-size: 13px;
    line-height: 1.5;
}

.scott-home-search .scott-property-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 8px;
    margin-top: auto;
    padding-bottom: 20px;
    color: #46545b;
    font-size: 13px;
}

.scott-home-search .scott-property-stats span {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.scott-home-search .scott-property-stats i {
    color: #639482;
}

.scott-home-search .scott-property-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 12px 18px;
    border-radius: 4px;
    background: #003c59;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s ease;
}

.scott-home-search .scott-property-button:hover {
    background: #006084;
    color: #fff;
}

@media (max-width: 767px) {
    .scott-home-search .scott-property-content {
        padding: 18px;
    }

    .scott-home-search .scott-property-price strong {
        font-size: 21px;
    }
}

/* Ensure both initial and AJAX results use the same grid */
.scott-home-search #houzez_ajax_container > .card-deck,
.scott-home-search #houzez_ajax_container .card-deck {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    align-items: stretch;
    margin: 0;
}

.scott-home-search #houzez_ajax_container .card-deck > .scott-property-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

@media (max-width: 767px) {
    .scott-home-search #houzez_ajax_container .card-deck {
        grid-template-columns: 1fr;
    }
}

/* Scott Communities final card proportions */

.scott-home-search .scott-property-image {
    aspect-ratio: 16 / 10;
}

.scott-home-search .scott-property-content {
    padding: 18px;
}

.scott-home-search .scott-property-price {
    margin-bottom: 8px;
}

.scott-home-search .scott-property-title {
    font-size: 18px;
    margin-bottom: 6px;
}

.scott-home-search .scott-property-location {
    margin-bottom: 14px;
}

.scott-home-search .scott-property-stats {
    gap: 8px;
    padding-bottom: 16px;
}

.scott-home-search #houzez_ajax_container .card-deck {
    gap: 24px;
}

/* Quick Move-In lot and address */
.scott-home-search .scott-property-subtitle {
    margin: 0 0 5px;
    color: #536773;
    font-size: 12px;
    line-height: 1.45;
}

.scott-home-search .scott-property-title {
    text-transform: none;
}

/* Collapsible mobile search filters */
.scott-mobile-filter-toggle {
    display: none;
}

@media (max-width: 767px) {
    .scott-home-search {
        gap: 18px;
    }

    .scott-home-search .scott-search-sidebar {
        padding: 12px 16px;
    }

    .scott-mobile-filter-toggle {
        display: block;
        width: 100%;
        padding: 12px 4px;
        border: 0;
        background: transparent;
        color: #003c59;
        font-size: 16px;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
    }

    .scott-mobile-filter-toggle::after {
        content: '+';
        float: right;
        font-size: 22px;
        line-height: 1;
    }

    .scott-mobile-filter-toggle[aria-expanded="true"]::after {
        content: '−';
    }

    .scott-home-search .scott-search-sidebar form[hidden] {
        display: none !important;
    }

    .scott-home-search .scott-property-content {
        padding: 16px;
    }

    .scott-home-search .scott-property-image {
        aspect-ratio: 16 / 10;
    }
}

/* Mobile filter heading cleanup */
@media (max-width: 767px) {
    .scott-home-search .scott-search-sidebar > h2,
    .scott-home-search .scott-search-sidebar > h3 {
        display: none;
    }

    .scott-home-search .scott-mobile-filter-toggle {
        margin: 0;
        padding: 12px 4px;
    }
}

/* Tablet: collapsible filters above two-column listings */
@media (min-width: 768px) and (max-width: 1024px) {

    .scott-home-search {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .scott-home-search .scott-search-sidebar {
        padding: 12px 20px;
    }

    .scott-home-search .scott-search-sidebar > h2,
    .scott-home-search .scott-search-sidebar > h3 {
        display: none;
    }

    .scott-home-search .scott-mobile-filter-toggle {
        display: block;
        width: 100%;
        padding: 12px 4px;
        margin: 0;
        border: 0;
        background: transparent;
        color: #003c59;
        font-size: 16px;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
    }

    .scott-home-search .scott-mobile-filter-toggle::after {
        content: '+';
        float: right;
        font-size: 22px;
        line-height: 1;
    }

    .scott-home-search .scott-mobile-filter-toggle[aria-expanded="true"]::after {
        content: '−';
    }

    .scott-home-search .scott-search-sidebar form[hidden] {
        display: none !important;
    }

    .scott-home-search #houzez_ajax_container .card-deck {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

/* Scott Communities feature filters */
.scott-search-form .scott-features {
    border: 0;
    padding: 0;
    margin: 20px 0 0;
    min-width: 0;
}

.scott-features legend {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}

.scott-search-form .scott-feature-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    cursor: pointer;
}

.scott-search-form .scott-feature-option input[type="checkbox"] {
    flex: 0 0 17px;
    width: 17px;
    min-width: 17px;
    height: 17px;
    margin: 1px 0 0;
    padding: 0;
    accent-color: #005075;
}

.scott-stepper-limits {
    display: block;
    color: #777;
    font-size: 11px;
    font-weight: 400;
}
