/* Extended marketplace — Airbnb-style location search bar */

.extended-search-wrap {
    margin: 0 0 1.75rem;
}

.extended-search__compact,
.extended-search__backdrop,
.extended-search__panel-head {
    display: none;
}

.extended-search__shell {
    display: contents;
}

.extended-search__panel {
    display: block;
}

.extended-search {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--brand-200);
    border-radius: 9999px;
    box-shadow: 0 8px 28px -12px rgba(15, 23, 42, 0.18);
    overflow: visible;
}

.extended-search__field {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 0.65rem 1.1rem;
}

.extended-search__field--location {
    flex: 1 1 auto;
    border-right: 1px solid var(--brand-200);
}

.extended-search__field--beds,
.extended-search__field--baths {
    border-right: 1px solid var(--brand-200);
    min-width: 7.5rem;
}

.extended-search__label {
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand-800);
    margin-bottom: 0.15rem;
}

.extended-search__input,
.extended-search__select {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--brand-900, #0f172a);
    padding: 0;
    margin: 0;
    outline: none;
    box-shadow: none;
}

.extended-search__input::placeholder {
    color: var(--brand-800);
    opacity: 0.75;
    font-weight: 400;
}

.extended-search__select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 1rem;
}

.extended-search__input-wrap {
    position: relative;
}

.extended-search__suggestions {
    position: absolute;
    z-index: 30;
    top: calc(100% + 0.5rem);
    left: -0.5rem;
    right: -0.5rem;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--white);
    border: 1px solid var(--brand-200);
    border-radius: 1rem;
    box-shadow: 0 16px 40px -16px rgba(15, 23, 42, 0.28);
    max-height: 280px;
    overflow-y: auto;
}

.extended-search__suggestions.is-hidden {
    display: none;
}

.extended-search__suggestions button {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.35;
    padding: 0.65rem 1rem;
    cursor: pointer;
    color: var(--brand-900, #0f172a);
}

.extended-search__suggestions button:hover,
.extended-search__suggestions button:focus-visible {
    background: var(--brand-50, #f8faf8);
    outline: none;
}

.extended-search__submit {
    align-self: center;
    margin: 0.4rem;
    padding: 0.85rem 1.35rem;
    border: none;
    border-radius: 9999px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white);
    background: var(--brand-accent);
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.extended-search__submit:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.extended-search__submit:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}

.extended-search__summary {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    color: var(--brand-800);
    min-height: 1.25rem;
}

.extended-search__summary:empty {
    display: none;
}

body.extended-search-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .extended-search-wrap {
        margin: 0 0 1rem;
        position: relative;
        z-index: 20;
    }

    .extended-search-wrap.is-expanded {
        z-index: 100;
    }

    .extended-search__shell {
        display: block;
        position: relative;
        background: var(--white);
        border: 1px solid var(--brand-200);
        border-radius: 9999px;
        box-shadow: 0 8px 28px -12px rgba(15, 23, 42, 0.18);
        overflow: hidden;
        transition: border-radius 0.2s ease, box-shadow 0.2s ease;
    }

    .extended-search-wrap.is-expanded .extended-search__shell {
        position: relative;
        z-index: 91;
        border-radius: 1.25rem;
        box-shadow: 0 16px 40px -16px rgba(15, 23, 42, 0.28);
    }

    .extended-search__compact {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 0.85rem 1rem;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        font-family: inherit;
        text-align: left;
        cursor: pointer;
    }

    .extended-search-wrap.is-expanded .extended-search__compact {
        display: none;
    }

    .extended-search__compact-icon {
        flex-shrink: 0;
        color: var(--brand-800);
        opacity: 0.75;
    }

    .extended-search__compact-text {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
        min-width: 0;
    }

    .extended-search__compact-main {
        font-size: 0.9375rem;
        font-weight: 700;
        color: var(--brand-900);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .extended-search__compact-sub {
        font-size: 0.8125rem;
        color: var(--brand-800);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .extended-search__backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(15, 23, 42, 0.28);
    }

    .extended-search__backdrop[hidden] {
        display: none;
    }

    .extended-search__panel {
        display: none;
    }

    .extended-search-wrap.is-expanded .extended-search__panel {
        display: block;
    }

    .extended-search__panel-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.85rem 1rem 0.35rem;
    }

    .extended-search__panel-title {
        margin: 0;
        font-size: 0.9375rem;
        font-weight: 800;
        color: var(--brand-900);
    }

    .extended-search__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        border: 1px solid var(--brand-200);
        border-radius: 9999px;
        background: var(--white);
        color: var(--brand-800);
        cursor: pointer;
        flex-shrink: 0;
    }

    .extended-search {
        grid-template-columns: 1fr;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .extended-search__field {
        border-right: none !important;
        border-bottom: 1px solid var(--brand-200);
        padding: 0.85rem 1rem;
    }

    .extended-search__field--location {
        padding-top: 0.35rem;
    }

    .extended-search__field--baths {
        border-bottom: none;
    }

    .extended-search__submit {
        margin: 0.75rem 1rem 1rem;
        width: calc(100% - 2rem);
    }

    .extended-search__suggestions {
        position: static;
        margin-top: 0.35rem;
        max-height: 220px;
    }

    .extended-search__summary {
        margin-top: 0.5rem;
    }
}
