/*
 * Shared Property Hive search-form styling.
 * Used on: Property Search, Buy a Home, Rent a Home.
 * Loaded late so it can override Divi / PH Template Assistant CSS.
 *
 * Design tokens match style.css (single-property / enquiry).
 */

/* =========================================
   SEARCH PANEL
========================================= */

body.suja-ph-search-form .property-search-form {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    max-width: var(--suja-max);
    margin: 0 auto 28px !important;
    padding: 28px 32px !important;
    background: var(--suja-bg-light) !important;
    border: 1px solid var(--suja-border);
    border-radius: var(--suja-radius);
    box-sizing: border-box;
    width: 100%;
}

body.suja-ph-search-form .property-search-form .control {
    /* No !important on display — PH JS toggles sales/lettings via inline display */
    display: block;
    float: none !important;
    position: relative;
    flex: 1 1 140px;
    min-width: 130px;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: top;
}

body.suja-ph-search-form .property-search-form .control label {
    display: block;
    margin: 0 0 8px;
    color: var(--suja-navy);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

body.suja-ph-search-form .property-search-form select {
    display: block;
    width: 100% !important;
    min-height: 50px;
    height: 50px;
    margin: 0;
    padding: 0 36px 0 14px !important;
    box-sizing: border-box;
    color: var(--suja-text);
    font-size: 16px;
    font-family: inherit;
    line-height: 1.3;
    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;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

body.suja-ph-search-form .property-search-form input[type="submit"] {
    flex: 0 0 auto;
    align-self: flex-end;
    min-width: 140px;
    min-height: 50px;
    height: 50px;
    margin: 0;
    padding: 0 26px !important;
    background: var(--suja-navy) !important;
    color: var(--suja-white) !important;
    border: 2px solid var(--suja-navy) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

body.suja-ph-search-form .property-search-form input[type="submit"]:hover,
body.suja-ph-search-form .property-search-form input[type="submit"]:focus {
    background: #132038 !important;
    border-color: #132038 !important;
    color: var(--suja-white) !important;
}


/* =========================================
   BUY / RENT PAGES — wrapper + hero gap
   (no Buy/Rent toggle; department stays hidden)
========================================= */

body.suja-buy-home .buy-property-search,
body.suja-rent-home .buy-property-search {
    max-width: var(--suja-max);
    margin: 0 auto;
    padding: 0 !important;
    background: transparent !important;
    box-sizing: border-box;
}

/* Department remains in the DOM for PH submit values; Divi already hides it */
body.suja-buy-home .buy-property-search .control-department,
body.suja-rent-home .buy-property-search .control-department {
    display: none !important;
}

/* Tighten hero → search transition without removing breathing room */
body.suja-buy-home .et_pb_section_1.et_pb_section,
body.suja-rent-home .et_pb_section_1.et_pb_section {
    padding-top: 16px !important;
    padding-bottom: 0 !important;
}

body.suja-buy-home .property-search-form,
body.suja-rent-home .property-search-form {
    margin-bottom: 20px !important;
}


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

@media (max-width: 980px) {

    body.suja-buy-home .buy-property-search,
    body.suja-rent-home .buy-property-search {
        width: calc(100% - 36px);
        margin-left: 18px;
        margin-right: 18px;
    }

    body.suja-buy-home .et_pb_section_1.et_pb_section,
    body.suja-rent-home .et_pb_section_1.et_pb_section {
        padding-top: 14px !important;
    }

    /* Override Divi page CSS that forces a single stacked column at 980px */
    body.suja-buy-home .buy-property-search .property-search-form,
    body.suja-rent-home .buy-property-search .property-search-form {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        align-items: end;
        gap: 14px;
        padding: 22px 20px !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }

    body.suja-buy-home .buy-property-search .property-search-form .control,
    body.suja-rent-home .buy-property-search .property-search-form .control {
        flex: none;
        min-width: 0;
        width: auto !important;
        margin: 0 !important;
    }

    body.suja-buy-home .buy-property-search .property-search-form input[type="submit"],
    body.suja-rent-home .buy-property-search .property-search-form input[type="submit"],
    body.suja-buy-home .buy-property-search .property-search-form button,
    body.suja-rent-home .buy-property-search .property-search-form button {
        grid-column: 1 / -1;
        width: 100% !important;
        min-width: 0;
    }

}

@media (max-width: 767px) {

    body.suja-ph-search-form .property-search-form {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        align-items: end;
        gap: 14px;
        padding: 20px !important;
    }

    body.suja-ph-search-form .property-search-form .control {
        flex: none;
        min-width: 0;
        width: auto;
    }

    body.suja-ph-search-form .property-search-form input[type="submit"] {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }

    /* Property Search page keeps department toggle full-width */
    body.suja-property-search .property-search-form .control-department {
        grid-column: 1 / -1;
        max-width: none;
        min-width: 0;
    }

}

@media (max-width: 340px) {

    body.suja-ph-search-form .property-search-form,
    body.suja-buy-home .buy-property-search .property-search-form,
    body.suja-rent-home .buy-property-search .property-search-form {
        grid-template-columns: 1fr;
    }

}
