/* OSM location autocomplete — nowoczesny dropdown z grupami i licznikami ofert */

.osm-loc-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 10050;
    max-height: min(420px, 70vh);
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 20px 40px -12px rgba(15, 23, 42, 0.18);
    padding: 6px 0;
    -webkit-overflow-scrolling: touch;
}

/* Pływający dropdown (portal do body) — nad hero i kartą wyszukiwania */
.osm-loc-dropdown.osm-loc-dropdown--floating {
    position: fixed !important;
    left: 0;
    top: 0;
    right: auto !important;
    width: auto;
    z-index: 10100 !important;
    max-height: min(420px, 70vh);
}

.osm-loc-dropdown[hidden] {
    display: none !important;
}

.osm-loc-dropdown__status {
    padding: 14px 16px;
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
}

.osm-loc-dropdown__status--error {
    color: #b91c1c;
}

.osm-loc-section + .osm-loc-section {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    margin-top: 4px;
    padding-top: 4px;
}

.osm-loc-section__title {
    padding: 8px 16px 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.osm-loc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.osm-loc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: #0f172a;
    transition: background-color 0.12s ease;
}

.osm-loc-item:hover,
.osm-loc-item.is-active {
    background: #f1f5f9;
}

.osm-loc-item--selected {
    background: #fffbeb;
    box-shadow: inset 3px 0 0 #f59e0b;
}

.osm-loc-item--selected:hover,
.osm-loc-item--selected.is-active {
    background: #fef3c7;
}

.osm-loc-item:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.osm-loc-item__main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.osm-loc-item__label {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3;
    word-break: break-word;
}

.osm-loc-item__label mark {
    background: #fef08a;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.osm-loc-item__breadcrumb {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.osm-loc-item__badge {
    flex: 0 0 auto;
    min-width: 2rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
}

.osm-loc-item:hover .osm-loc-item__badge,
.osm-loc-item.is-active .osm-loc-item__badge {
    background: #cbd5e1;
}

/* Chip typu lokalizacji — pozycjonowanie w style.css (.location-clearable-wrapper) */

.location-clearable-wrapper .osm-loc-dropdown:not(.osm-loc-dropdown--floating),
#home-search-form .osm-loc-dropdown:not(.osm-loc-dropdown--floating),
#offer-list-search-form .osm-loc-dropdown:not(.osm-loc-dropdown--floating),
.input-group.position-relative .osm-loc-dropdown:not(.osm-loc-dropdown--floating) {
    width: 100%;
    z-index: 10050 !important;
}

body.osm-loc-dropdown-open .hero-search-container {
    z-index: 10100;
}

body.osm-loc-dropdown-open .search-box {
    overflow: visible;
}

@media (max-width: 575.98px) {
    .osm-loc-dropdown {
        border-radius: 10px;
        max-height: min(360px, 55vh);
    }

    .osm-loc-item {
        padding: 12px 14px;
    }
}
