/************************************************************
 PMT Autocomplete — v1.1
 Google-Places-style input, BHHS purple button embedded inside
************************************************************/

/* ── 1. Wrapper ─────────────────────────────────────────── */
.pmt-location-search-wrapper {
    position: relative;
    width: 100%;
}

/* ── 2. Input ───────────────────────────────────────────── */
#pmt_location_search {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 44px;           /* icon left, clear/button right */
    font-size: 16px;
    line-height: 1.2;
    color: #1f2937;
    border: 1px solid #e3e4e8;
    outline: none;
    background: #f6f6f7;
    box-shadow: none;
    display: block;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

#pmt_location_search::placeholder { color: #9aa0a6; }

#pmt_location_search:focus {
    background: #fff;
    border-color: #670038;
    box-shadow: 0 0 0 3px rgba(103, 0, 56, 0.18);
}

/* ── 3. Search icon (left) ──────────────────────────────── */
.pmt-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9aa0a6;
    pointer-events: none;
    transition: color .15s ease;
}
#pmt_location_search:focus ~ .pmt-search-icon,
.pmt-location-search-wrapper:focus-within .pmt-search-icon {
    color: #670038;
}

/* ── 4. Clear button (right, no search btn) ─────────────── */
.pmt-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #e3e4e8;
    color: #5f6368;
    cursor: pointer;
    display: none;              /* shown via .has-value class */
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: background .15s ease;
}
.pmt-clear-btn svg { width: 13px; height: 13px; }
.pmt-clear-btn:hover { background: #d2d4d9; }
.pmt-location-search-wrapper.has-value .pmt-clear-btn { display: flex; }

/* ── 5. Embedded SEARCH button (shortcode button="yes") ─── */
.pmt-location-search-wrapper.has-search-btn #pmt_location_search {
    padding-right: 130px;       /* stop text running under the button */
}

.pmt-search-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    bottom: 6px;
    padding: 0 22px;
    background: #670038;        /* BHHS maroon */
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    z-index: 10;
    transition: background .2s ease, box-shadow .2s ease;
}
.pmt-search-btn:hover {
    background: #4d0029;
    box-shadow: 0 2px 8px rgba(103, 0, 56, 0.35);
}
.pmt-search-btn:active { background: #3a001f; }

.pmt-btn-icon { width: 16px; height: 16px; }

@media (max-width: 480px) {
    .pmt-location-search-wrapper.has-search-btn #pmt_location_search {
        padding-right: 58px;
    }
    .pmt-search-btn { padding: 0 14px; }
    .pmt-search-btn span { display: none; }   /* icon-only on small screens */
}

/* ── 6. Suggestions dropdown ────────────────────────────── */
.pmt-suggestions {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    max-height: 380px;
    overflow-y: auto;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
    display: none;
    z-index: 999999999 !important;
    animation: pmtFadeIn 0.15s ease-out;
}

.pmt-suggestion-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
}
.pmt-suggestion-item:last-child { border-bottom: none; }
.pmt-suggestion-item:hover,
.pmt-suggestion-item.active { background: #f5f7fa; }

.pmt-suggestion-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 8px;
    background: #eef0f2;
}

.pmt-suggestion-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.pmt-suggestion-address {
    font-weight: 600;
    font-size: 15px;
    color: #202124;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pmt-suggestion-address strong { color: #670038; }

.pmt-suggestion-meta {
    font-size: 13px;
    color: #6b7280;
}

/* ── 7. Empty / loading states ──────────────────────────── */
.pmt-no-results,
.pmt-loading {
    padding: 14px 16px;
    text-align: center;
    color: #777;
    font-size: 14px;
}

/* ── 8. Divi safety ─────────────────────────────────────── */
.et_pb_text_1_tb_body,
.et_pb_text_1_tb_body .et_pb_text_inner {
    position: relative !important;
    overflow: visible !important;
    z-index: auto !important;
}
.et_pb_section_parallax .et_parallax_bg,
.et_pb_section_parallax .et_parallax_bg_wrap {
    z-index: 0 !important;
}

/* ── 9. Fade-in animation ───────────────────────────────── */
@keyframes pmtFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
