/* Wecomatic Live-Suche (Doofinder-Alternative) – Overlay + Kachel-Raster */

/* Einheitliches Box-Modell innerhalb des Overlays (verhindert Breiten-Überlauf) */
.wls-overlay,
.wls-overlay * {
    box-sizing: border-box;
}

.wls-noscroll {
    overflow: hidden;
}

.wls-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20000;
}

.wls-overlay.wls-open {
    display: block;
}

.wls-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(2px);
}

.wls-panel {
    position: relative;
    background: #fff;
    display: flex;
    flex-direction: column;
    /* Mobile: Vollbild */
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.wls-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
}

.wls-input {
    flex: 1 1 auto;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 16px;
    outline: none;
}

.wls-input:focus {
    border-color: #0a58ca;
}

.wls-close {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    padding: 4px 10px;
}

.wls-close:hover {
    color: #000;
}

.wls-results {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 100%;
}

/* ---------- Autocomplete-Vorschläge (Chips) ---------- */
.wls-suggs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 14px 0;
}

.wls-sugg {
    border: 1px solid #dcdfe3;
    background: #f6f8fa;
    color: #333;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.2;
}

.wls-sugg:hover {
    background: #eef1f4;
    border-color: #c8ccd1;
    color: #000;
}

.wls-sugg .wls-hl {
    font-weight: 700;
}

/* ---------- Kachel-Raster ---------- */
.wls-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
}

.wls-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 12px;
    text-decoration: none;
    color: #222;
    transition: box-shadow .15s, border-color .15s;
    background: #fff;
}

.wls-card:hover,
.wls-card:focus,
.wls-card.wls-active {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
    border-color: #d8d8d8;
    text-decoration: none;
    color: #000;
}

.wls-card-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 130px;
    margin-bottom: 10px;
}

.wls-card-img img {
    max-width: 100%;
    max-height: 130px;
    object-fit: contain;
}

.wls-card-name {
    font-size: 13px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wls-card-price {
    margin-top: auto;
    padding-top: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1a7f37;
}

.wls-hl {
    background: transparent;
    color: inherit;
    font-weight: 700;
    padding: 0;
}

.wls-all {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px;
    font: inherit;
    font-weight: 600;
    color: #0a58ca;
    text-decoration: none;
    background: #f6f8fa;
    border: none;
    border-top: 1px solid #eee;
    cursor: pointer;
    position: sticky;
    bottom: 0;
}

.wls-all:hover {
    background: #eef1f4;
    text-decoration: none;
}

.wls-all.wls-active {
    background: #e3e8ee;
}

/* ---------- Ergebnis-Kopfzeile (Anzahl + pro Seite + Reset) ---------- */
.wls-all-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 3;
}

.wls-count {
    font-weight: 600;
}

.wls-head-ctrls {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.wls-cards-all {
    padding-top: 6px;
}

/* ---------- Filter-Leiste (Preis + Kategorien) ---------- */
/* Mobil: standardmäßig ausgeblendet, erscheint erst über den „Filter"-Button. */
.wls-all-toolbar {
    display: none;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px 22px;
    padding: 14px;
    border-bottom: 1px solid #eee;
    background: #fafbfc;
}

.wls-allwrap.wls-filters-open .wls-all-toolbar {
    display: flex;
}

/* „Filter"-Umschalter – nur auf kleinen Bildschirmen sichtbar */
.wls-filter-toggle {
    display: inline-flex;
    align-items: center;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border: 1px solid #dcdfe3;
    border-radius: 8px;
    background: #fff;
    color: #0a58ca;
    cursor: pointer;
}

.wls-filter-toggle.wls-toggle-on {
    background: #0a58ca;
    border-color: #0a58ca;
    color: #fff;
}

.wls-tb-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wls-tb-price {
    flex: 1 1 240px;
    min-width: 200px;
    max-width: 360px;
}

.wls-tb-cats {
    flex: 2 1 280px;
    min-width: 0;
}

.wls-tb-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

/* ----- Doppel-Slider ----- */
.wls-slider {
    position: relative;
    height: 26px;
}

.wls-slider-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    border-radius: 4px;
    background: #dcdfe3;
}

.wls-slider-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 4px;
    background: #0a58ca;
}

.wls-range {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 26px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.wls-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #0a58ca;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    cursor: pointer;
}

.wls-range::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #0a58ca;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    cursor: pointer;
}

.wls-range::-moz-range-track {
    background: none;
}

.wls-slider-vals {
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

/* ----- Kategorien (Mehrfachauswahl) ----- */
.wls-cats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.wls-cat-parent {
    color: #777;
    font-weight: 400;
}

.wls-cats-more {
    border: 0;
    background: none;
    padding: 5px 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-decoration: underline;
    cursor: pointer;
}

.wls-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid #dcdfe3;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    line-height: 1.2;
}

.wls-cat:hover {
    border-color: #c8ccd1;
}

.wls-cat-on {
    border-color: #0a58ca;
    background: #eaf1fc;
    color: #0a3d8f;
}

.wls-cat input {
    margin: 0;
}

.wls-cat-cnt {
    color: #888;
    font-size: 12px;
}

.wls-cat-on .wls-cat-cnt {
    color: #0a58ca;
}

/* ----- Treffer pro Seite (Buttons) + Reset ----- */
.wls-perpage {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.wls-size {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    min-width: 38px;
    padding: 6px 10px;
    border: 1px solid #dcdfe3;
    border-radius: 8px;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.wls-size:hover {
    border-color: #c8ccd1;
}

.wls-size-active {
    background: #0a58ca;
    border-color: #0a58ca;
    color: #fff;
}

.wls-reset {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid #dcdfe3;
    color: #555;
    background: #f6f8fa;
}

.wls-reset:hover {
    background: #eef1f4;
    border-color: #c8ccd1;
}

.wls-more {
    display: block;
    margin: 4px auto 22px;
    padding: 11px 26px;
    font: inherit;
    font-weight: 600;
    color: #0a58ca;
    background: #f6f8fa;
    border: 1px solid #dcdfe3;
    border-radius: 999px;
    cursor: pointer;
}

.wls-more:hover {
    background: #eef1f4;
    border-color: #c8ccd1;
}

.wls-more:disabled {
    opacity: .6;
    cursor: default;
}

@media (min-width: 768px) {
    .wls-all-head {
        padding: 16px 18px;
        font-size: 15px;
    }

    /* Desktop: Filter immer sichtbar, „Filter"-Umschalter ausgeblendet */
    .wls-all-toolbar {
        display: flex;
    }

    .wls-filter-toggle {
        display: none;
    }
}

.wls-note {
    padding: 8px 18px;
    background: #fff8e1;
    border-bottom: 1px solid #f1e3b3;
    color: #5a5f67;
    font-size: 14px;
}

.wls-note b {
    color: #1c1d20;
}

.wls-info {
    padding: 28px 18px;
    color: #777;
    font-size: 15px;
    text-align: center;
}

/* ---------- Tablet ---------- */
@media (min-width: 480px) {
    .wls-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---------- Desktop: breites Fenster, 4 Spalten ---------- */
@media (min-width: 768px) {
    .wls-panel {
        width: 1040px;
        max-width: 95vw;
        height: auto;
        max-height: 86vh;
        margin: 6vh auto 0;
        border-radius: 14px;
        overflow: hidden;
    }

    .wls-search {
        padding: 16px 18px;
    }

    .wls-input {
        font-size: 18px;
        padding: 14px 16px;
    }

    .wls-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
        padding: 18px;
    }

    .wls-card-img {
        height: 160px;
    }

    .wls-card-img img {
        max-height: 160px;
    }

    .wls-card-name {
        font-size: 14px;
    }

    .wls-card-price {
        font-size: 16px;
    }
}

/* ---------- Startansicht vor dem Tippen ---------- */
.wls-start {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: 18px 14px 22px;
}

.wls-start-col:empty {
    display: none;
}

.wls-start-sec + .wls-start-sec {
    margin-top: 20px;
}

.wls-start-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6b4f00;
}

.wls-recent-clear {
    border: 0;
    background: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
}

.wls-start-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wls-start .wls-sugg {
    font-size: 14px;
    padding: 7px 14px;
}

.wls-start-cats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.wls-start-cat {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    color: #222;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.wls-start-cat:hover,
.wls-start-cat.wls-active {
    background: #f6f8fa;
    color: #000;
    text-decoration: none;
}

.wls-start-links {
    display: grid;
    gap: 8px;
}

.wls-start-link {
    display: block;
    padding: 12px 14px;
    border: 1px solid #ececec;
    border-radius: 12px;
    color: #222;
    text-decoration: none;
}

.wls-start-link:hover,
.wls-start-link.wls-active {
    border-color: #999;
    color: #000;
    text-decoration: none;
}

.wls-start-link b {
    display: block;
    font-size: 15px;
}

.wls-start-link span {
    display: block;
    font-size: 13px;
    color: #666;
}

@media (min-width: 768px) {
    .wls-start {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .9fr);
        gap: 32px;
        padding: 22px 22px 26px;
    }
}
