/* ==========================================================================
   Beratung - Fenster im Storefront
   Der Ausloeser ist der fuenfte Knopf der Saeule rechts unten; hier liegen
   nur die Sprechblase und das Fenster. Die Saeule liegt auf z-index 700.
   ========================================================================== */
.wb-berater {
    --wb-berater-primaer: #2d5a27;
    --wb-berater-primaer-dunkel: #24491f;
    --wb-berater-grund: #ffffff;
    --wb-berater-schrift: #1f2933;
    --wb-berater-gedaempft: #656b76;
    --wb-berater-rahmen: #d8d4cc;
    --wb-berater-flaeche: #f6f5f2;
    --wb-berater-besucher-flaeche: var(--wb-berater-primaer);
    --wb-berater-besucher-schrift: #ffffff;
    --wb-berater-radius: 16px;
    --wb-berater-schatten: 0 12px 40px rgba(15, 23, 42, .22);
    --wb-berater-schatten-weich: 0 4px 16px rgba(15, 23, 42, .12);
    --wb-berater-saeule: 50px;
    position: fixed;
    right: calc(1.25rem + var(--wb-berater-saeule) + 0.625rem + env(safe-area-inset-right, 0px));
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 710;
    transition: bottom .2s ease;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    color: var(--wb-berater-schrift);
}

/* Steht die Einwilligungsleiste, weicht das Fenster genauso aus wie die Saeule. */
body:has(.cookie-permission-container[style*="display: block"]) .wb-berater {
    bottom: calc(1.25rem + 87px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 991.98px) {
    body:has(.cookie-permission-container[style*="display: block"]) .wb-berater {
        bottom: calc(1.25rem + 137px + env(safe-area-inset-bottom, 0px));
    }
}
@media (max-width: 767.98px) {
    .wb-berater {
        right: calc(0.75rem + var(--wb-berater-saeule) + 0.5rem + env(safe-area-inset-right, 0px));
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }
    body:has(.cookie-permission-container[style*="display: block"]) .wb-berater {
        bottom: calc(0.75rem + 189px + env(safe-area-inset-bottom, 0px));
    }
}

.wb-berater *,
.wb-berater *::before,
.wb-berater *::after { box-sizing: border-box; }

/* Der fuenfte Punkt der Saeule ist ein Knopf und kein Verweis wie seine vier
   Geschwister. Form, Farbe und Verhalten kommen aus dem Stylesheet des Ladens;
   hier steht nur, was ein Knopf zusaetzlich braucht. */
.wb-schnellkontakt-knopf.wb-berater-ausloeser {
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
    cursor: pointer;
}
/* ---- Sprechblase neben der Saeule ---- */
.wb-berater__hinweis {
    position: absolute;
    right: 0;
    bottom: 0;
    width: max-content;
    max-width: 264px;
    background: var(--wb-berater-grund);
    color: var(--wb-berater-schrift);
    border: 1px solid var(--wb-berater-rahmen);
    border-radius: 14px;
    padding: 10px 44px 10px 14px;
    box-shadow: var(--wb-berater-schatten-weich);
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateX(8px) scale(.96);
    transform-origin: bottom right;
    transition: opacity .25s ease, transform .25s ease;
}
.wb-berater__hinweis--sichtbar { opacity: 1; transform: translateX(0) scale(1); }
.wb-berater__hinweis::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: 18px;
    width: 14px;
    height: 14px;
    background: var(--wb-berater-grund);
    border-top: 1px solid var(--wb-berater-rahmen);
    border-right: 1px solid var(--wb-berater-rahmen);
    transform: rotate(45deg);
}
.wb-berater__hinweis-oeffnen {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    min-height: 44px;
}
.wb-berater__hinweis-oeffnen:hover { color: var(--wb-berater-primaer); }
/* Das Tippziel misst 44 mal 44, der sichtbare Kreis bleibt klein: die Flaeche
   liegt im Innenabstand der Blase, damit sie keinen Text ueberdeckt und kein
   Klick aufs Oeffnen beim Schliessen landet. */
.wb-berater__hinweis-schliessen {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--wb-berater-gedaempft);
    cursor: pointer;
    line-height: 0;
    transition: color .15s ease;
}
.wb-berater__hinweis-schliessen::before {
    content: "";
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: transparent;
    transition: background .15s ease;
}
.wb-berater__hinweis-schliessen svg { position: relative; }
.wb-berater__hinweis-schliessen:hover { color: var(--wb-berater-schrift); }
.wb-berater__hinweis-schliessen:hover::before { background: var(--wb-berater-flaeche); }
.wb-berater--offen .wb-berater__hinweis { opacity: 0; pointer-events: none; }

@media (max-width: 480px) {
    .wb-berater__hinweis { max-width: min(264px, calc(100vw - 110px)); }
}

/* Der Ladenkopf des Shops klebt auf z-index 1025 und liegt damit ueber der
   Saeule (700/710): er schneidet dem geoeffneten Fenster die eigene Kopfzeile
   samt Schliessknopf ab. Im geoeffneten Zustand steigt die Saeule darueber,
   aber unter Huellen, Modale und Einwilligung (1040 / 1051 / 1100). */
.wb-berater--offen { z-index: 1030; }

/* ---- Fenster ---- */
.wb-berater__fenster {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: calc(100vw - 5.5rem);
    height: 620px;
    max-height: calc(100vh - 6rem);
    background: var(--wb-berater-grund);
    border: 1px solid var(--wb-berater-rahmen);
    border-radius: var(--wb-berater-radius);
    box-shadow: var(--wb-berater-schatten);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(.98);
    pointer-events: none;
    /* Das geschlossene Fenster ist nur durchsichtig, seine Knoepfe und das
       Eingabefeld blieben damit in der Tabreihenfolge: mit der Tastatur landet
       man in einem Fenster, das niemand sieht. visibility nimmt sie heraus und
       wird beim Schliessen erst nach dem Ausblenden gesetzt, beim Oeffnen
       sofort - sonst fehlt die Blende. */
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.wb-berater--offen .wb-berater__fenster {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear 0s;
}

@media (max-width: 480px) {
    /* Die Sprechblase bleibt neben der Saeule. Das Fenster ist eine Schublade
       vom unteren Rand und nicht der ganze Schirm: der Laden bleibt oben
       sichtbar, und die Kopfzeile des Fensters geraet nicht unter den
       klebenden Ladenkopf. */
    .wb-berater__fenster {
        position: fixed;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        height: min(620px, 86dvh);
        max-height: 86dvh;
        border-radius: var(--wb-berater-radius) var(--wb-berater-radius) 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        transform: translateY(16px);
    }
    .wb-berater--offen .wb-berater__fenster { transform: translateY(0); }
}

/* ---- Kopfzeile ---- */
.wb-berater__kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 6px 14px;
    background: var(--wb-berater-primaer);
    color: #fff;
    flex: 0 0 auto;
}
.wb-berater__kopf-titel { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.wb-berater__kopfbild {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255, 255, 255, .18);
}
.wb-berater__kopf-knoepfe { display: flex; gap: 4px; }
.wb-berater__knopf-zeichen {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: none; border-radius: 8px;
    background: transparent; color: #fff; cursor: pointer; opacity: .85;
    transition: background .15s ease, opacity .15s ease;
}
.wb-berater__knopf-zeichen:hover { background: rgba(255, 255, 255, .18); opacity: 1; }

/* ---- Nachrichten ---- */
.wb-berater__nachrichten {
    flex: 1 1 auto;
    overflow-y: auto;
    /* Am Ende der Liste nicht die Seite dahinter weiterschieben. */
    overscroll-behavior: contain;
    padding: 16px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}
.wb-berater-nachricht { display: flex; flex-direction: column; max-width: 100%; }
.wb-berater-nachricht__blase {
    padding: 10px 13px;
    border-radius: 14px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.wb-berater-nachricht--besucher { align-items: flex-end; }
.wb-berater-nachricht--besucher .wb-berater-nachricht__blase {
    background: var(--wb-berater-besucher-flaeche);
    color: var(--wb-berater-besucher-schrift);
    border-bottom-right-radius: 4px;
    max-width: 85%;
}
.wb-berater-nachricht--berater .wb-berater-nachricht__blase {
    background: var(--wb-berater-flaeche);
    color: var(--wb-berater-schrift);
    border-bottom-left-radius: 4px;
    max-width: 92%;
}
.wb-berater-nachricht--system .wb-berater-nachricht__blase {
    background: transparent;
    color: var(--wb-berater-gedaempft);
    font-size: 13.5px;
    text-align: center;
    align-self: center;
    border: 1px dashed var(--wb-berater-rahmen);
    border-radius: 10px;
}
.wb-berater-nachricht--system { align-items: center; }

.wb-berater-nachricht__inhalt > *:first-child { margin-top: 0; }
.wb-berater-nachricht__inhalt > *:last-child { margin-bottom: 0; }
.wb-berater-nachricht__inhalt p { margin: 0 0 8px; }
.wb-berater-nachricht__inhalt ul, .wb-berater-nachricht__inhalt ol { margin: 4px 0 8px; padding-left: 20px; }
.wb-berater-nachricht__inhalt li { margin: 2px 0; }
.wb-berater-nachricht__inhalt a { color: var(--wb-berater-primaer); text-decoration: underline; }
.wb-berater-nachricht__inhalt strong { font-weight: 700; }
.wb-berater-nachricht__inhalt code {
    background: rgba(127, 127, 127, .16);
    padding: 1px 5px; border-radius: 5px; font-size: .9em;
}
.wb-berater-nachricht__inhalt del { opacity: .55; }
/* Bloecke aus der Auszeichnung */
.wb-berater-text-ueberschrift { margin: 12px 0 6px; font-size: 15px; font-weight: 700; line-height: 1.3; }
.wb-berater-text-ueberschrift:first-child { margin-top: 0; }
.wb-berater-text-linie { border: none; border-top: 1px solid var(--wb-berater-rahmen); margin: 12px 0; }
.wb-berater-text-zitat {
    margin: 8px 0; padding: 7px 12px; border-left: 3px solid var(--wb-berater-primaer);
    background: var(--wb-berater-flaeche); border-radius: 0 8px 8px 0;
}
.wb-berater-text-zitat > *:last-child { margin-bottom: 0; }
.wb-berater-text-tabellenhuelle { overflow-x: auto; margin: 9px 0; -webkit-overflow-scrolling: touch; }
.wb-berater-text-tabelle { border-collapse: collapse; width: 100%; font-size: 13px; }
.wb-berater-text-tabelle th, .wb-berater-text-tabelle td {
    border: 1px solid var(--wb-berater-rahmen); padding: 5px 9px; text-align: left; white-space: nowrap;
}
.wb-berater-text-tabelle th { background: var(--wb-berater-flaeche); font-weight: 600; }
.wb-berater-text-tabelle tr:nth-child(even) td { background: color-mix(in srgb, var(--wb-berater-schrift) 3%, var(--wb-berater-grund)); }

/* ---- Marken fuer die Arbeitsschritte ---- */
.wb-berater-nachricht__schritte { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.wb-berater-schritt {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    background: var(--wb-berater-flaeche); border: 1px solid var(--wb-berater-rahmen);
    font-size: 12px; color: var(--wb-berater-gedaempft);
}
.wb-berater-schritt--laeuft::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    background: var(--wb-berater-primaer); animation: wb-berater-pulsieren 1s infinite;
}
@keyframes wb-berater-pulsieren { 0%,100% { opacity: .3; } 50% { opacity: 1; } }

/* ---- Zeichen fuer das Tippen ---- */
.wb-berater-tippt { display: inline-flex; gap: 4px; padding: 4px 2px; }
.wb-berater-tippt span {
    width: 7px; height: 7px; border-radius: 50%; background: var(--wb-berater-gedaempft);
    animation: wb-berater-huepfen 1.2s infinite ease-in-out;
}
.wb-berater-tippt span:nth-child(2) { animation-delay: .15s; }
.wb-berater-tippt span:nth-child(3) { animation-delay: .3s; }
@keyframes wb-berater-huepfen { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ---- Artikelkarten ---- */
.wb-berater-karten { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.wb-berater-karte {
    display: flex; gap: 10px; padding: 8px;
    border: 1px solid var(--wb-berater-rahmen); border-radius: 12px;
    background: var(--wb-berater-grund); text-decoration: none; color: inherit;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.wb-berater-karte,
.wb-berater-karte:hover,
.wb-berater-karte:focus { text-decoration: none; }
.wb-berater-karte:hover { border-color: var(--wb-berater-primaer); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15,23,42,.1); }
.wb-berater-karte:hover .wb-berater-karte__name { text-decoration: none; }
.wb-berater-karte__bild {
    flex: 0 0 68px; width: 68px; height: 68px; border-radius: 8px;
    object-fit: contain; background: #ffffff; padding: 4px;
    border: 1px solid var(--wb-berater-rahmen);
}
.wb-berater-karte__bild--platzhalter { display: flex; align-items: center; justify-content: center; color: var(--wb-berater-gedaempft); }
.wb-berater-karte__rumpf { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wb-berater-karte__name { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wb-berater-karte__grund { font-size: 12.5px; color: var(--wb-berater-gedaempft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wb-berater-karte__zusatz { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.wb-berater-karte__preis { font-weight: 700; color: var(--wb-berater-schrift); }
.wb-berater-karte__listenpreis { text-decoration: line-through; color: var(--wb-berater-gedaempft); font-size: 12.5px; }
.wb-berater-karte__nachlass { font-size: 11px; font-weight: 700; color: #fff; background: #d64545; padding: 1px 5px; border-radius: 5px; }
.wb-berater-karte__lage { font-size: 12px; color: var(--wb-berater-gedaempft); }
.wb-berater-karte__grundpreis { font-size: 11.5px; color: var(--wb-berater-gedaempft); margin-top: 1px; }
.wb-berater-karte__bewertung { font-size: 12px; color: #e8a33d; }

/* ---- Bewertung ---- */
.wb-berater-nachricht__bewertung { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.wb-berater-bewertung__wort { font-size: 12px; color: var(--wb-berater-gedaempft); margin-right: 2px; }
.wb-berater-bewertung {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 26px; flex: 0 0 auto; padding: 0;
    border: none; background: transparent; cursor: pointer; color: var(--wb-berater-gedaempft);
    border-radius: 6px; line-height: 1; opacity: .75;
    transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.wb-berater-bewertung svg { overflow: visible; display: block; }
.wb-berater-bewertung:hover { opacity: 1; background: var(--wb-berater-flaeche); }
.wb-berater-bewertung--aktiv { color: var(--wb-berater-primaer); opacity: 1; }
.wb-berater-bewertung--runter svg { transform: rotate(180deg); transform-origin: center; }
.wb-berater-bewertung__dank {
    font-size: 12px; color: var(--wb-berater-primaer); margin-left: 2px;
    opacity: 0; transform: translateX(-4px); pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.wb-berater-bewertung__dank--sichtbar { opacity: 1; transform: translateX(0); }

/* Ausrichtung der Zeichen */
.wb-berater-schritt svg { flex: 0 0 auto; }
.wb-berater-schritt--fertig svg { color: #2f9e44; }
.wb-berater-schritt--fehler { color: #d64545; }
.wb-berater-karte__bewertung svg { vertical-align: -1px; }
.wb-berater-karte__bild--platzhalter svg { color: var(--wb-berater-gedaempft); }

/* ---- Schritt mit Bestaetigung und Kontaktformular ---- */
.wb-berater-formular {
    margin-top: 10px; padding: 12px; border: 1px solid var(--wb-berater-rahmen);
    border-radius: 12px; background: var(--wb-berater-flaeche);
    display: flex; flex-direction: column; gap: 8px;
}
.wb-berater-formular__titel { font-weight: 600; font-size: 14px; }
.wb-berater-formular__feld { display: flex; flex-direction: column; gap: 3px; }
.wb-berater-formular__feld label { font-size: 12px; color: var(--wb-berater-gedaempft); }
.wb-berater-formular input, .wb-berater-formular textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--wb-berater-rahmen);
    border-radius: 8px; background: var(--wb-berater-grund); color: var(--wb-berater-schrift); font-size: 14px; font-family: inherit;
}
.wb-berater-formular input:focus, .wb-berater-formular textarea:focus { outline: 2px solid var(--wb-berater-primaer); outline-offset: -1px; border-color: var(--wb-berater-primaer); }
.wb-berater-formular__einwilligung { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--wb-berater-gedaempft); }
.wb-berater-formular__einwilligung input { width: auto; margin-top: 2px; flex: 0 0 auto; }
.wb-berater-formular__knoepfe { display: flex; gap: 8px; margin-top: 2px; }
.wb-berater-formular__fehler { color: #d64545; font-size: 12.5px; }

/* ---- Einwilligung vor dem ersten Wort ---- */
.wb-berater__einwilligung {
    padding: 16px 16px 18px; border-top: 1px solid var(--wb-berater-rahmen);
    background: var(--wb-berater-flaeche); flex: 0 0 auto;
}
.wb-berater__einwilligung-text { margin: 0 0 12px; font-size: 13px; color: var(--wb-berater-gedaempft); }

/* ---- Knoepfe ---- */
.wb-berater__knopf {
    padding: 9px 16px; border: none; border-radius: 9px;
    background: var(--wb-berater-primaer); color: #fff; font-weight: 600; font-size: 14px;
    cursor: pointer; transition: background .15s ease;
    overflow-wrap: normal; word-break: normal;
}
.wb-berater__knopf:hover { background: var(--wb-berater-primaer-dunkel); }
.wb-berater__knopf--leise { background: transparent; color: var(--wb-berater-gedaempft); border: 1px solid var(--wb-berater-rahmen); }
.wb-berater__knopf:disabled { opacity: .55; cursor: default; }

/* ---- Eingabe ---- */
.wb-berater__verfassen {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 10px 12px; border-top: 1px solid var(--wb-berater-rahmen); flex: 0 0 auto;
}
.wb-berater__fang { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wb-berater__feld {
    flex: 1 1 auto; resize: none; max-height: 120px;
    padding: 10px 12px; border: 1px solid var(--wb-berater-rahmen); border-radius: 12px;
    background: var(--wb-berater-grund); color: var(--wb-berater-schrift); font-size: 15px; font-family: inherit; line-height: 1.4;
}
.wb-berater__feld:focus { outline: 2px solid var(--wb-berater-primaer); outline-offset: -1px; border-color: var(--wb-berater-primaer); }
.wb-berater__senden {
    flex: 0 0 auto; width: 42px; height: 42px; border: none; border-radius: 12px;
    background: var(--wb-berater-primaer); color: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: filter .15s ease, opacity .15s ease;
}
.wb-berater__senden:hover:not(:disabled) { background: var(--wb-berater-primaer-dunkel); }
.wb-berater__senden:disabled { opacity: .45; cursor: default; }
/* Nachricht aus dem Haus */

.wb-berater-nachricht--mitarbeiter { align-items: flex-start; }
.wb-berater-nachricht--mitarbeiter .wb-berater-nachricht__blase {
    background: color-mix(in srgb, var(--wb-berater-primaer) 12%, var(--wb-berater-grund));
    border: 1px solid color-mix(in srgb, var(--wb-berater-primaer) 30%, var(--wb-berater-grund));
    border-bottom-left-radius: 4px; max-width: 92%;
}
.wb-berater-nachricht__wer { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--wb-berater-primaer); font-weight: 600; margin-bottom: 3px; }
.wb-berater-warenkorb-bestaetigen .wb-berater-karten { margin-top: 8px; }
.wb-berater__fussnote { text-align: center; font-size: 11px; color: var(--wb-berater-gedaempft); padding: 0 12px 8px; flex: 0 0 auto; }
.wb-berater__fussnote > span { display: block; }
/* Leise, aber ein volles Tippziel: 44 px hoch, Breite aus dem Text. */
.wb-berater__widerruf {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; margin-top: 2px;
    border: none; background: transparent; color: var(--wb-berater-gedaempft);
    font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.wb-berater__widerruf[hidden] { display: none; }
.wb-berater__widerruf:hover { color: var(--wb-berater-schrift); }
.wb-berater__widerruf:focus-visible { outline: 2px solid var(--wb-berater-primaer); outline-offset: 2px; border-radius: 6px; }
.wb-berater__widerruf:disabled { opacity: .55; cursor: default; }

.wb-berater__fehler { color: #d64545; }

/* Rollbalken */
.wb-berater__nachrichten::-webkit-scrollbar { width: 8px; }
.wb-berater__nachrichten::-webkit-scrollbar-thumb { background: var(--wb-berater-rahmen); border-radius: 8px; }
