/*
 * Suja Property Search / Results (page-specific)
 * Form panel / fields / button live in search-forms.css (shared).
 * This file: heading, Buy/Rent toggle, toolbar, cards, pagination,
 * and archive content-width alignment with Theme Builder header/footer.
 */

/* =========================================
   CONTENT WIDTH
   PH Template Assistant injects:
     .propertyhive { max-width:1200px; margin:0 auto; }
   Body also has class "propertyhive", so that rule boxes the ENTIRE
   page (header/footer included) to 1200px — narrower than Divi pages.
   Reset body, then size #container like Theme Builder rows (90%/1280).
========================================= */

body.suja-property-search {
    --suja-max: 1280px;
}

/* Undo PH Template Assistant page-box on body.propertyhive */
body.suja-property-search.propertyhive {
    max-width: none;
    width: auto;
    margin-left: 0;
    margin-right: 0;
}

body.suja-property-search #container {
    width: 90%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

body.suja-property-search #content {
    width: 100%;
    max-width: none;
}

body.suja-property-search h1.page-title,
body.suja-property-search .property-search-form,
body.suja-property-search ul.properties,
body.suja-property-search .propertyhive-pagination {
    max-width: none;
    width: 100%;
}


/* =========================================
   PAGE HEADING
========================================= */

body.suja-property-search h1.page-title {
    margin: 0 auto 24px;
    padding: 8px 0 0;
    color: var(--suja-navy);
    font-size: 34px;
    font-weight: 600;
    line-height: 1.25;
}


/* =========================================
   DEPARTMENT CONTROL WIDTH (Property Search)
========================================= */

body.suja-property-search .property-search-form .control-department {
    flex: 0 1 220px;
    min-width: 200px;
    max-width: 260px;
}


/* =========================================
   BUY / RENT SEGMENTED TOGGLE
   Keeps native radios + values intact
   Property Search page only — not Buy/Rent pages
========================================= */

body.suja-property-search .property-search-form .control-department > label {
    display: inline-block;
    width: 50%;
    margin: 0;
    padding: 13px 10px;
    box-sizing: border-box;
    text-align: center;
    vertical-align: top;
    font-size: 0;
    line-height: 0;
    color: var(--suja-navy);
    background: var(--suja-white);
    border: 1px solid var(--suja-border);
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

body.suja-property-search .property-search-form .control-department > label:first-of-type {
    border-radius: 6px 0 0 6px;
}

body.suja-property-search .property-search-form .control-department > label:last-of-type {
    border-radius: 0 6px 6px 0;
    margin-left: -1px;
}

body.suja-property-search .property-search-form .control-department > label::after {
    content: "Buy";
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

body.suja-property-search .property-search-form .control-department > label:last-of-type::after {
    content: "Rent";
}

body.suja-property-search .property-search-form .control-department input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

body.suja-property-search .property-search-form .control-department > label:has(input:checked) {
    background: var(--suja-navy);
    border-color: var(--suja-navy);
    color: var(--suja-white);
    z-index: 1;
}

body.suja-property-search .property-search-form .control-department > label:has(input:focus-visible) {
    outline: 2px solid var(--suja-navy);
    outline-offset: 2px;
}


/* =========================================
   RESULTS TOOLBAR
========================================= */

body.suja-property-search .propertyhive-result-count {
    float: left;
    max-width: calc(100% - 280px);
    margin: 4px 0 22px !important;
    color: var(--suja-text-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 48px;
}

body.suja-property-search form.propertyhive-ordering {
    float: right;
    margin: 0 0 22px !important;
}

body.suja-property-search form.propertyhive-ordering select.orderby {
    min-width: 240px;
    min-height: 48px;
    height: 48px;
    padding: 0 36px 0 14px !important;
    box-sizing: border-box;
    color: var(--suja-text);
    font-size: 14px;
    font-family: inherit;
    background: var(--suja-white) !important;
    border: 1px solid var(--suja-border) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23192F55' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    cursor: pointer;
}

body.suja-property-search form.propertyhive-ordering select.orderby:focus {
    outline: none;
    border-color: var(--suja-navy) !important;
    box-shadow: 0 0 0 3px rgba(25, 47, 85, 0.12) !important;
}


/*
 * Property cards: shared styles live in property-cards.css
 * (body.suja-property-cards). This file keeps page chrome only.
 */


/* =========================================
   PAGINATION
========================================= */

body.suja-property-search .propertyhive-pagination {
    clear: both;
    max-width: var(--suja-max);
    margin: 20px auto 40px;
    text-align: center;
}

body.suja-property-search .propertyhive-pagination ul.page-numbers {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.suja-property-search .propertyhive-pagination ul.page-numbers li {
    display: inline-block;
    float: none !important;
    width: auto !important;
    margin: 0 4px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

body.suja-property-search .propertyhive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--suja-border);
    border-radius: 6px;
    background: var(--suja-white);
    color: var(--suja-navy);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
}

body.suja-property-search .propertyhive-pagination a.page-numbers:hover {
    border-color: var(--suja-navy);
}

body.suja-property-search .propertyhive-pagination .page-numbers.current {
    background: var(--suja-navy);
    border-color: var(--suja-navy);
    color: var(--suja-white);
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 980px) {

    body.suja-property-search h1.page-title {
        font-size: 30px;
        padding-left: 18px;
        padding-right: 18px;
    }

    /* Side inset without 100%-width + margin overflow */
    body.suja-property-search .property-search-form,
    body.suja-property-search ul.properties,
    body.suja-property-search .propertyhive-pagination {
        width: calc(100% - 36px) !important;
        max-width: var(--suja-max);
        margin-left: 18px !important;
        margin-right: 18px !important;
        box-sizing: border-box;
    }

    body.suja-property-search .propertyhive-result-count,
    body.suja-property-search form.propertyhive-ordering {
        margin-left: 18px !important;
        margin-right: 18px !important;
    }

}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 767px) {

    body.suja-property-search h1.page-title {
        font-size: 28px;
        margin-bottom: 18px;
        padding-left: 18px;
        padding-right: 18px;
    }

    body.suja-property-search .property-search-form .control-department > label {
        padding: 14px 10px;
    }

    body.suja-property-search .propertyhive-result-count,
    body.suja-property-search form.propertyhive-ordering {
        float: none !important;
        display: block;
        width: calc(100% - 36px) !important;
        max-width: none;
        line-height: 1.4;
        box-sizing: border-box;
    }

    body.suja-property-search .propertyhive-result-count {
        margin-bottom: 10px !important;
    }

    body.suja-property-search form.propertyhive-ordering {
        margin-bottom: 20px !important;
    }

    body.suja-property-search form.propertyhive-ordering select.orderby {
        width: 100%;
        min-width: 0;
    }

}

@media (max-width: 340px) {

    body.suja-property-search h1.page-title {
        font-size: 26px;
    }

}
