/* ERS Livesuche – Suchvorschläge als Produkt-Kacheln (Bild oben, Name, Preis unten) */
.ers-ls-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    display: none;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    text-align: left;
}

.ers-ls-dropdown.show {
    display: block;
}

/* Raster mit feinen Trennlinien (1px-Gap auf grauem Hintergrund) */
.ers-ls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1px;
    background: #eee;
}

.ers-ls-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    padding: 0.9rem 0.6rem;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.ers-ls-item:hover,
.ers-ls-item.active {
    background: #f7f7f7;
    color: inherit;
    text-decoration: none;
}

.ers-ls-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.ers-ls-name {
    flex: 1 1 auto;
    font-size: 0.85rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.ers-ls-name mark {
    background: transparent;
    color: inherit;
    font-weight: 700;
    padding: 0;
}

.ers-ls-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    /* Platz für die Grundpreis-Zeile immer reservieren,
       damit der Preis in allen Kacheln auf einer Höhe sitzt */
    min-height: 2.35em;
}

.ers-ls-baseprice {
    font-size: 0.72rem;
    font-weight: 400;
    color: #777;
}

.ers-ls-all {
    display: block;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    text-align: center;
}

.ers-ls-all:hover,
.ers-ls-all.active {
    background: #f5f5f5;
}

.ers-ls-empty {
    padding: 0.75rem;
    color: #777;
    font-size: 0.9rem;
    text-align: center;
}

/* Mobil: zwei Spalten, größere Touch-Flächen, begrenzte Höhe über der Tastatur */
@media (max-width: 767.98px) {
    .ers-ls-dropdown {
        max-height: 60vh;
        border-radius: 0 0 0.25rem 0.25rem;
    }

    .ers-ls-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ers-ls-item {
        padding: 0.75rem 0.5rem;
    }

    .ers-ls-img {
        width: 72px;
        height: 72px;
    }

    .ers-ls-name {
        font-size: 0.9rem;
    }

    .ers-ls-price {
        font-size: 0.95rem;
    }

    .ers-ls-baseprice {
        font-size: 0.78rem;
    }

    .ers-ls-all {
        padding: 0.8rem 0.75rem;
        font-size: 0.95rem;
    }
}
