/*
 * Ammara MyHome Search Builder v2.0
 * Visual presentation only. MyHome continues to control filters, dependencies,
 * taxonomy tabs, search URLs, REST requests, and listing results.
 */

.elementor-widget-ammara-myhome-search,
.elementor-widget-ammara-myhome-search > .elementor-widget-container,
.ammara-myhome-search,
.ammara-myhome-search > mh-search-form,
.ammara-myhome-search .ammara-search-form {
    display: block;
    width: 100% !important;
    max-width: none !important;
}

.ammara-myhome-search {
    --ammara-green: #27b779;
    --ammara-green-dark: #169c63;
    --ammara-green-soft: #e8f7f0;
    --ammara-text: #171a19;
    --ammara-muted: #66706c;
    --ammara-border: #d9dfdc;
    --ammara-panel-radius: 12px;
    --ammara-field-radius: 8px;
    --ammara-gap: 12px;
    --ammara-panel-padding: 16px;
    position: relative;
    box-sizing: border-box;
}

.ammara-myhome-search,
.ammara-myhome-search * {
    box-sizing: border-box;
}

.ammara-myhome-search .ammara-search-form {
    position: relative;
    overflow: visible !important;
}

.ammara-myhome-search .ammara-search-form__panel {
    position: relative !important;
    z-index: 1;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: var(--ammara-panel-padding) !important;
    background: #ffffff;
    border: 1px solid rgba(20, 34, 29, 0.06);
    border-radius: var(--ammara-panel-radius);
    box-shadow: 0 10px 30px rgba(16, 35, 45, 0.12);
    overflow: visible !important;
}

/* Native MyHome dependency terms appear separately above the panel. */
.ammara-myhome-search .ammara-search-form__term-bar {
    position: relative;
    z-index: 30;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 0 0 12px;
    padding: 0;
    overflow: visible;
}

.ammara-myhome-search .ammara-search-form__term-bar > * {
    max-width: 100%;
}

/* First row inside the panel: property autocomplete and Search button. */
.ammara-myhome-search .ammara-search-form__primary-row {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(150px, 185px);
    gap: var(--ammara-gap);
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.ammara-myhome-search
.ammara-search-form--no-tabs
.ammara-search-form__primary-row {
    grid-template-columns: minmax(280px, 1fr) minmax(150px, 185px);
}

/* Dynamic taxonomy tabs: terms stay editable in MyHome/Elementor. */
.ammara-myhome-search .ammara-search-form__tabs-wrapper {
    position: relative !important;
    z-index: 31 !important;
    display: inline-block !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 48px;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: auto !important;
}

.ammara-myhome-search .ammara-search-form__tabs {
    position: relative !important;
    z-index: 32 !important;
    display: inline-flex !important;
    align-items: stretch;
    width: auto !important;
    max-width: 100% !important;
    height: 48px;
    margin: 0 !important;
    padding: 3px !important;
    background: #ffffff;
    border: 1px solid var(--ammara-border);
    border-radius: var(--ammara-field-radius);
    box-shadow: 0 7px 20px rgba(16, 35, 45, 0.10);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    pointer-events: auto !important;
}

.ammara-myhome-search .ammara-search-form__tabs::-webkit-scrollbar {
    display: none;
}

.ammara-myhome-search .ammara-search-form__tab {
    position: relative !important;
    z-index: 22 !important;
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 106px;
    min-height: 40px;
    margin: 0 !important;
    padding: 0 24px !important;
    color: var(--ammara-text) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    text-transform: none !important;
    white-space: nowrap;
    cursor: pointer !important;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: auto !important;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.ammara-myhome-search .ammara-search-form__tab::before,
.ammara-myhome-search .ammara-search-form__tab::after {
    display: none !important;
}

.ammara-myhome-search .ammara-search-form__tab:hover {
    color: var(--ammara-green-dark) !important;
    background: #f2faf6 !important;
}

.ammara-myhome-search
.ammara-search-form__tab.myhome-search-form__tab--active {
    color: var(--ammara-green-dark) !important;
    background: var(--ammara-green-soft) !important;
    font-weight: 700;
}

/* Dynamic property autocomplete. */
.ammara-myhome-search .ammara-property-autocomplete {
    position: relative;
    z-index: 15;
    width: 100%;
    min-width: 0;
}

.ammara-myhome-search .ammara-property-autocomplete__control {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    background: #ffffff;
    border: 1px solid var(--ammara-border);
    border-radius: var(--ammara-field-radius);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ammara-myhome-search .ammara-property-autocomplete__control:hover {
    border-color: #b9c4bf;
}

.ammara-myhome-search .ammara-property-autocomplete__control:focus-within {
    border-color: var(--ammara-green-dark);
    box-shadow: 0 0 0 3px rgba(39, 183, 121, 0.12);
}

.ammara-myhome-search .ammara-property-autocomplete__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    margin-left: 15px;
    flex: 0 0 21px;
    color: #087d6d;
}

.ammara-myhome-search .ammara-property-autocomplete__icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.ammara-myhome-search .ammara-property-autocomplete__input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: 0 !important;
    padding: 0 44px 0 12px !important;
    color: var(--ammara-text);
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    font: inherit;
    font-size: 14px;
    font-style: normal !important;
    appearance: none;
    -webkit-appearance: none;
}

.ammara-myhome-search .ammara-property-autocomplete__input::placeholder {
    color: #424b47;
    opacity: 1;
}

.ammara-myhome-search .ammara-property-autocomplete__spinner {
    position: absolute;
    right: 15px;
    top: 50%;
    width: 17px;
    height: 17px;
    margin-top: -8.5px;
    border: 2px solid rgba(0, 0, 0, 0.14);
    border-top-color: #087d6d;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.ammara-myhome-search .ammara-property-autocomplete__spinner.is-visible {
    opacity: 1;
    animation: ammara-search-spin 0.7s linear infinite;
}

@keyframes ammara-search-spin {
    to { transform: rotate(360deg); }
}

.ammara-myhome-search .ammara-search-form__native-keyword {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.ammara-myhome-search .ammara-property-autocomplete__dropdown {
    position: absolute;
    z-index: 99999;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    max-height: 390px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 7px;
    background: #ffffff;
    border: 1px solid rgba(18, 38, 32, 0.14);
    border-radius: 10px;
    box-shadow: 0 16px 38px rgba(16, 35, 45, 0.18);
}

.ammara-myhome-search .ammara-property-autocomplete__dropdown[hidden] {
    display: none !important;
}

.ammara-myhome-search .ammara-property-autocomplete__option {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 66px;
    padding: 8px;
    color: #17221f;
    border-radius: 7px;
    text-decoration: none !important;
    transition: background-color 0.16s ease;
}

.ammara-myhome-search .ammara-property-autocomplete__option:hover,
.ammara-myhome-search .ammara-property-autocomplete__option.is-active {
    color: #17221f;
    background: #eef7f4;
}

.ammara-myhome-search .ammara-property-autocomplete__image {
    display: block;
    width: 58px;
    height: 50px;
    object-fit: cover;
    background: #eef1f0;
    border-radius: 6px;
}

.ammara-myhome-search .ammara-property-autocomplete__copy {
    min-width: 0;
}

.ammara-myhome-search .ammara-property-autocomplete__title,
.ammara-myhome-search .ammara-property-autocomplete__excerpt {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ammara-myhome-search .ammara-property-autocomplete__title {
    color: #17221f;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.ammara-myhome-search .ammara-property-autocomplete__excerpt {
    margin-top: 4px;
    color: #69736f;
    font-size: 12px;
    line-height: 1.35;
}

.ammara-myhome-search .ammara-property-autocomplete__arrow {
    padding-right: 4px;
    color: #087d6d;
    font-size: 21px;
    line-height: 1;
}

.ammara-myhome-search .ammara-property-autocomplete__message {
    padding: 14px;
    color: #68726e;
    font-size: 13px;
    text-align: center;
}

/* Search button. */
.ammara-myhome-search .ammara-search-form__button {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 48px;
    height: auto !important;
    margin: 0 !important;
    padding: 0 22px !important;
    color: #ffffff !important;
    background: var(--ammara-green) !important;
    border: 0 !important;
    border-radius: var(--ammara-field-radius) !important;
    box-shadow: none !important;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-transform: none !important;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.ammara-myhome-search .ammara-search-form__button:hover {
    color: #ffffff !important;
    background: var(--ammara-green-dark) !important;
}

.ammara-myhome-search .ammara-search-form__button:active {
    transform: translateY(1px);
}

.ammara-myhome-search .ammara-search-form__button span {
    color: inherit !important;
    font: inherit;
}

/* Second row: every MyHome field selected after Keyword. */
.ammara-myhome-search .ammara-search-form__secondary-fields {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: var(--ammara-gap);
    width: 100% !important;
    min-width: 0 !important;
    margin: var(--ammara-gap) 0 0 !important;
    padding: 0 !important;
}

.ammara-myhome-search .ammara-search-form__secondary-fields > *,
.ammara-myhome-search .myhome-search-form-field {
    position: relative !important;
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.ammara-myhome-search
.ammara-search-form__secondary-fields
.myhome-search-form-field {
    min-height: 48px;
    background: #ffffff !important;
    border: 1px solid var(--ammara-border) !important;
    border-radius: var(--ammara-field-radius) !important;
    box-shadow: none !important;
    overflow: visible;
}

.ammara-myhome-search .myhome-search-form-field > div,
.ammara-myhome-search .myhome-search-form-field__input,
.ammara-myhome-search .myhome-search-form-field__content {
    width: 100%;
    min-height: 46px;
}

.ammara-myhome-search .myhome-search-form-field input,
.ammara-myhome-search .myhome-search-form-field select,
.ammara-myhome-search .myhome-search-form-field textarea {
    width: 100%;
    min-height: 46px;
    margin: 0 !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    color: var(--ammara-text) !important;
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    font-size: 14px;
}

.ammara-myhome-search .myhome-search-form-field .v-select,
.ammara-myhome-search .myhome-search-form-field .vs__dropdown-toggle,
.ammara-myhome-search .myhome-search-form-field .multiselect,
.ammara-myhome-search .myhome-search-form-field .multiselect__tags,
.ammara-myhome-search .myhome-search-form-field .select2-selection {
    width: 100%;
    min-height: 46px !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: var(--ammara-field-radius) !important;
    box-shadow: none !important;
}

.ammara-myhome-search .myhome-search-form-field:focus-within {
    border-color: var(--ammara-green-dark) !important;
    box-shadow: 0 0 0 3px rgba(39, 183, 121, 0.10) !important;
}

.ammara-myhome-search .ammara-search-form__panel::before,
.ammara-myhome-search .ammara-search-form__panel::after,
.ammara-myhome-search .ammara-search-form__primary-row::before,
.ammara-myhome-search .ammara-search-form__primary-row::after {
    pointer-events: none !important;
}

@media (max-width: 991px) {
    .ammara-myhome-search .ammara-search-form__primary-row {
        grid-template-columns: minmax(0, 1fr) minmax(145px, 180px);
    }


    .ammara-myhome-search
    .ammara-search-form--no-tabs
    .ammara-search-form__primary-row {
        grid-template-columns: minmax(0, 1fr) minmax(145px, 180px);
    }
}

@media (max-width: 767px) {
    .ammara-myhome-search {
        --ammara-panel-padding: 13px;
        --ammara-gap: 10px;
    }

    .ammara-myhome-search .ammara-search-form__primary-row,
    .ammara-myhome-search
    .ammara-search-form--no-tabs
    .ammara-search-form__primary-row {
        grid-template-columns: 1fr;
    }

    .ammara-myhome-search .ammara-property-autocomplete,
    .ammara-myhome-search .ammara-search-form__button {
        grid-column: 1 / -1;
    }

    .ammara-myhome-search .ammara-search-form__term-bar {
        margin-bottom: 10px;
    }

    .ammara-myhome-search .ammara-search-form__tabs-wrapper,
    .ammara-myhome-search .ammara-search-form__tabs {
        width: 100% !important;
    }

    .ammara-myhome-search .ammara-search-form__tab {
        flex: 1 0 auto;
        min-width: 100px;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .ammara-myhome-search .ammara-search-form__secondary-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .ammara-myhome-search .ammara-search-form__secondary-fields {
        grid-template-columns: 1fr;
    }

    .ammara-myhome-search .ammara-property-autocomplete__option {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .ammara-myhome-search .ammara-property-autocomplete__image {
        width: 48px;
        height: 44px;
    }

    .ammara-myhome-search .ammara-property-autocomplete__arrow {
        display: none;
    }
}


/* Advanced visibility rules */
.ammara-myhome-search .ammara-search-form__field-shell {
    min-width: 0;
}

.ammara-myhome-search .ammara-search-form__field-shell.is-hidden,
.ammara-myhome-search .ammara-property-autocomplete.is-hidden {
    display: none !important;
}


/* NOTE: v1.6.8 through v2.1.6 forced every dropdown option (including
   MyHome's own legitimately-disabled 0-count options) to stay clickable
   and fully opaque here, unconditionally, on every page load. That
   permanently defeated MyHome's built-in protection against selecting an
   impossible filter combination, and is the confirmed cause of term
   counts showing 0 after enough interaction. Removed in v2.1.7 — disabled
   options are left alone and MyHome's own disabled styling/behavior now
   applies normally. See readme.txt changelog for details. */

