/* Knopf „Digitaler Andreas“ unten rechts + Fenster mit dem Chat (iframe) + Knopf „Konfiguration digital prüfen lassen“
   auf Produktseiten. Vorschlag B (Familie 2026-11-04): Graphit wie „In den Warenkorb“, damit es aussieht wie ein Teil des
   Shops; Logo-Farben nur als feine Linie am Prüf-Knopf. „digital“ statt „KI“, Kopf ohne Namen (User 2026-11-04). */

.ob-chat-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1040; /* unter Bootstrap-Modals und Offcanvas (1045+) */
    display: flex;
    align-items: center;
    gap: 10px;
    height: 68px;
    padding: 0 26px 0 8px;
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    background: #1d1d1b;
    border: 0;
    border-radius: 34px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.ob-chat-toggle:hover {
    background: #30312e;
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

.ob-chat-toggle:focus-visible {
    outline: 3px solid #23c9b5;
    outline-offset: 3px;
}

/* Kopf links in der Pille, ruhig (kein Winken, keine Animation) */
.ob-chat-avatar {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    overflow: hidden;
    background: #b9b5b2;
    border: 2px solid #fff;
    border-radius: 50%;
}

.ob-chat-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ob-chat-label {
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
}

/* Sprechblase über dem Knopf: Sprüche wechseln, solange der Chat zu ist (× blendet sie für den Tab aus) */
.ob-chat-greeting {
    position: fixed;
    right: 24px;
    bottom: 106px;
    z-index: 1040;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: min(300px, calc(100vw - 48px));
    padding: 12px 12px 12px 16px;
    color: #1d1d1b;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    background: #fff;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.3s, transform 0.3s, visibility 0s 0.3s;
}

.ob-chat-greeting.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.3s, transform 0.3s, visibility 0s;
}

.ob-chat-greeting-close {
    flex: 0 0 auto;
    margin: -3px -2px 0 0;
    padding: 0 4px;
    color: #8a8a8a;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.ob-chat.is-open .ob-chat-greeting {
    display: none;
}

/* Einmal je Tab (erste Shop-Seite) und nach F5: gleitet von rechts herein (chat-widget.js setzt is-entering) */
.ob-chat.is-waiting .ob-chat-toggle {
    visibility: hidden;
}

.ob-chat.is-entering .ob-chat-toggle {
    animation: ob-slide-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ob-slide-in {
    from { transform: translateX(calc(100% + 40px)); }
    to { transform: none; }
}

/* Offen: runder Schließen-Knopf */
.ob-chat-icon-close,
.ob-chat.is-open .ob-chat-avatar,
.ob-chat.is-open .ob-chat-label {
    display: none;
}

.ob-chat.is-open .ob-chat-icon-close {
    display: block;
}

.ob-chat.is-open .ob-chat-toggle {
    justify-content: center;
    width: 60px;
    height: 60px;
    padding: 0;
}

.ob-chat-panel {
    position: fixed;
    right: 24px;
    bottom: 96px;
    z-index: 1040;
    display: none;
    /* 460 statt 380 px: Antworten sind seit 2026-10-29 ausführlicher, mit Listen und Tabellen */
    width: 460px;
    max-width: calc(100vw - 48px);
    height: min(720px, calc(100dvh - 120px));
    overflow: hidden;
    background: #0c0d0c;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Bis der Chat geladen ist, sieht man diese Fläche: hell wie der Chat, wenn das Gerät hell eingestellt ist.
   Die eigene Wahl im Chat (Sonne/Mond) liegt im Speicher der Chat-Seite und ist hier nicht lesbar. */
@media (prefers-color-scheme: light) {
    .ob-chat-panel {
        background: #f4f7f7;
        box-shadow: 0 12px 40px rgba(20, 40, 40, 0.22);
    }
}

.ob-chat.is-open .ob-chat-panel {
    display: block;
}

/* Breit (Knopf im Chat-Kopf, nur ab 576 px): mehr Platz für Tabellen und Modellvergleiche */
.ob-chat.is-wide .ob-chat-panel {
    width: min(820px, calc(100vw - 48px));
    height: calc(100dvh - 120px);
}

.ob-chat-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Shopware-Knopf „nach oben“ sitzt auch unten rechts → über den Chat-Knopf schieben */
.scroll-up-container .scroll-up-button {
    bottom: 100px;
}

/* Knopf „Konfiguration digital prüfen lassen“: Form und Farben wie die drei Knöpfe darüber (Theme-Klasse
   ob-configuration-actions__button), volle Breite; unten eine feine Linie im Logo-Verlauf */
.ob-chat-check {
    position: relative;
    grid-column: 1 / -1;
    overflow: hidden;
    font-weight: 600;
}

.ob-chat-check::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #23c9b5, #0075c0, #7d4b98, #e6007e);
    pointer-events: none;
}

.ob-chat-check .ob-chat-check__icon {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    overflow: hidden;
    border-radius: 50%;
}

.ob-chat-check .ob-chat-check__icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ob-chat-check svg {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ob-chat-check[disabled] {
    cursor: progress;
    opacity: 0.7;
}

/* Handy: Fenster über die ganze Fläche, geschlossen wird im Chat-Kopf (×) */
@media (max-width: 575.98px) {
    .ob-chat-toggle {
        right: 16px;
        bottom: 16px;
        height: 60px;
        padding: 0 20px 0 7px;
    }

    .ob-chat-avatar {
        width: 46px;
        height: 46px;
    }

        .ob-chat-label {
        font-size: 16px;
    }

    .ob-chat-greeting {
        right: 16px;
        bottom: 88px;
        max-width: calc(100vw - 32px);
    }

    .ob-chat-panel,
    .ob-chat.is-wide .ob-chat-panel {
        inset: 0;
        width: auto;
        max-width: none;
        height: 100dvh;
        border-radius: 0;
    }

    .ob-chat.is-open .ob-chat-toggle {
        display: none;
    }

    .scroll-up-container .scroll-up-button {
        bottom: 86px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ob-chat.is-entering .ob-chat-toggle {
        animation: none;
    }
}

@media print {
    .ob-chat,
    .ob-chat-check {
        display: none;
    }
}
