.nh-lisabot {
    --nh-lisabot-primary: #FF8D8B;
    --nh-lisabot-ink: #312528;
    --nh-lisabot-muted: #6f6265;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.nh-lisabot--floating {
    position: fixed;
    bottom: 70px;
    /* Niedriger als WooCommerce-Cart-Overlays (typisch 9999+), damit Warenkorb immer Vorrang hat */
    z-index: 999;
    user-select: none;
}

.nh-lisabot--bottom-right {
    right: 20px;
}

.nh-lisabot--bottom-left {
    left: 20px;
}

.nh-lisabot__bubble {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 60px !important;
    height: 60px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: var(--nh-lisabot-primary) !important;
    background-color: #FF8D8B !important;
    color: #fff !important;
    cursor: pointer !important;
    box-shadow: 0 6px 20px rgba(255, 141, 139, 0.45) !important;
    transition: transform 0.15s, box-shadow 0.15s;
}

.nh-lisabot__bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 16px 36px rgba(49, 37, 40, 0.26);
}

.nh-lisabot__bubble-online {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3);
}

.nh-lisabot__panel {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    width: min(340px, calc(100vw - 32px));
    min-height: 400px;
    max-height: min(560px, calc(100vh - 96px));
    overflow: hidden;
    border: 1px solid rgba(49, 37, 40, 0.12);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(49, 37, 40, 0.18);
}

.nh-lisabot--floating .nh-lisabot__panel {
    position: absolute;
    bottom: 76px;
    min-width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 32px);
    height: min(520px, calc(100vh - 112px));
    min-height: 360px;
    max-height: calc(100vh - 96px);
    resize: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 160ms ease, transform 160ms ease;
}

/* Resize-Handle: Ecke oben links (für bottom-right-Panels) */
.nh-lisabot__resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    cursor: nw-resize;
    z-index: 10;
    border-radius: 17px 0 5px 0;
}

.nh-lisabot__resize-handle::before,
.nh-lisabot__resize-handle::after {
    content: "";
    position: absolute;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    transition: background 0.15s;
}

.nh-lisabot__resize-handle::before {
    top: 10px;
    left: 5px;
    width: 14px;
    height: 2px;
    transform: rotate(-45deg);
    transform-origin: left center;
}

.nh-lisabot__resize-handle::after {
    top: 15px;
    left: 5px;
    width: 8px;
    height: 2px;
    transform: rotate(-45deg);
    transform-origin: left center;
}

.nh-lisabot__resize-handle:hover::before,
.nh-lisabot__resize-handle:hover::after,
.nh-lisabot--resizing .nh-lisabot__resize-handle::before,
.nh-lisabot--resizing .nh-lisabot__resize-handle::after {
    background: rgba(255, 255, 255, 0.9);
}

/* bottom-left: Handle an der Ecke oben rechts */
.nh-lisabot--bottom-left .nh-lisabot__resize-handle {
    left: auto;
    right: 0;
    cursor: ne-resize;
    border-radius: 0 17px 0 5px;
}

.nh-lisabot--bottom-left .nh-lisabot__resize-handle::before,
.nh-lisabot--bottom-left .nh-lisabot__resize-handle::after {
    left: auto;
    right: 5px;
    transform-origin: right center;
    transform: rotate(45deg);
}

.nh-lisabot--resizing {
    cursor: nw-resize !important;
    user-select: none;
}

.nh-lisabot--bottom-left.nh-lisabot--resizing {
    cursor: ne-resize !important;
}

.nh-lisabot--bottom-right .nh-lisabot__panel {
    right: 0;
}

.nh-lisabot--bottom-left .nh-lisabot__panel {
    left: 0;
}

.nh-lisabot__hint {
    position: absolute;
    bottom: 74px;
    display: none;
    align-items: center;
    gap: 8px;
    min-width: 220px;
    max-width: 260px;
    padding: 10px 12px;
    border: 1px solid rgba(49, 37, 40, 0.12);
    border-radius: 16px;
    background: #fff;
    color: var(--nh-lisabot-ink);
    box-shadow: 0 10px 26px rgba(49, 37, 40, 0.14);
}

.nh-lisabot--bottom-right .nh-lisabot__hint {
    right: 0;
}

.nh-lisabot--bottom-left .nh-lisabot__hint {
    left: 0;
}

.nh-lisabot__hint.is-visible {
    display: flex;
}

.nh-lisabot__hint.is-visible:hover {
    box-shadow: 0 12px 30px rgba(49, 37, 40, 0.2);
    border-color: rgba(49, 37, 40, 0.2);
}

.nh-lisabot__hint button {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    background: #f6eeee;
    cursor: pointer;
}

.nh-lisabot--floating.is-open .nh-lisabot__panel,
.nh-lisabot--shortcode .nh-lisabot__panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nh-lisabot__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px;
    background: var(--nh-lisabot-primary);
    color: var(--nh-lisabot-ink);
    cursor: grab;
}

.nh-lisabot__header strong {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nh-lisabot--dragging .nh-lisabot__header {
    cursor: grabbing;
}

.nh-lisabot__header button {
    flex: 0 0 auto;
    cursor: pointer;
}

/* Einheitliche Header-Icon-Buttons */
.nh-lisabot__header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.nh-lisabot__header-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.9) !important;
    cursor: pointer !important;
    transition: opacity 0.15s;
    appearance: none;
    -webkit-appearance: none;
    opacity: 0.85;
}

.nh-lisabot__header-btn svg {
    display: block;
    flex-shrink: 0;
    overflow: visible;
}

.nh-lisabot__header-btn:hover {
    background: transparent !important;
    opacity: 1;
}

/* Expand-Button: Compress-Icon versteckt, solange nicht vergrößert */
/* Höhere Spezifität als .nh-lisabot__header-btn svg { display: block } */
.nh-lisabot__header-btn .nh-lisabot__icon-compress {
    display: none !important;
}

.nh-lisabot--panel-expanded .nh-lisabot__header-btn .nh-lisabot__icon-expand {
    display: none !important;
}

.nh-lisabot--panel-expanded .nh-lisabot__header-btn .nh-lisabot__icon-compress {
    display: block !important;
}

/* Expand-Button auf Mobil ausblenden (Panel ist bereits Vollbild) */
@media (max-width: 480px) {
    .nh-lisabot__expand {
        display: none;
    }
}

/* Vergrößerter Panel-Zustand (Desktop) */
.nh-lisabot--floating.nh-lisabot--panel-expanded .nh-lisabot__panel {
    width: min(600px, calc(100vw - 40px)) !important;
    height: min(700px, calc(100vh - 80px)) !important;
}

.nh-lisabot__footer-notes {
    border-top: 1px solid rgba(49, 37, 40, 0.07);
    padding: 5px 14px 7px;
    text-align: center;
}

.nh-lisabot__privacy-section {
    /* kept for compatibility, wrapping handled by footer-notes */
}

.nh-lisabot__privacy-hint {
    margin: 0;
    padding: 0;
    font-size: 10px;
    line-height: 1.5;
    color: var(--nh-lisabot-muted);
    text-align: center;
}

.nh-lisabot__privacy-trigger {
    all: unset;
    display: inline !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--nh-lisabot-muted) !important;
    font: inherit !important;
    font-size: inherit !important;
    font-weight: 400 !important;
    line-height: inherit !important;
    letter-spacing: 0 !important;
    text-align: inherit !important;
    text-decoration: underline !important;
    text-transform: none !important;
    vertical-align: baseline !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.nh-lisabot__privacy-trigger:hover {
    color: var(--nh-lisabot-ink) !important;
}

.nh-lisabot__privacy-expanded {
    padding: 10px 14px 12px;
    background: #f9f5f5;
    border-top: 1px solid rgba(49, 37, 40, 0.07);
    font-size: 11px;
    line-height: 1.55;
    color: var(--nh-lisabot-muted);
}

.nh-lisabot__privacy-expanded p {
    margin: 0 0 8px;
}

.nh-lisabot__privacy-expanded a {
    color: var(--nh-lisabot-ink);
    font-size: 11px;
    font-weight: 600;
}

.nh-lisabot__beta-notice {
    margin: 0;
    padding: 0;
    color: var(--nh-lisabot-muted);
    font-size: 10px;
    line-height: 1.5;
    text-align: center;
}

.nh-lisabot__messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    background: #fffafa;
}

.nh-lisabot__bot-group {
    display: grid;
    gap: 8px;
}

.nh-lisabot__product-block {
    display: grid;
    gap: 8px;
}

.nh-lisabot__product-card[hidden] {
    display: none !important;
}

.nh-lisabot__product-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid rgba(49, 37, 40, 0.1);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.nh-lisabot__product-card:hover,
.nh-lisabot__product-card:focus {
    border-color: rgba(49, 37, 40, 0.2);
    box-shadow: 0 8px 18px rgba(49, 37, 40, 0.08);
    outline: none;
    transform: translateY(-1px);
}

.nh-lisabot__product-card:focus-visible {
    outline: 2px solid var(--nh-lisabot-primary);
    outline-offset: 2px;
}

.nh-lisabot__product-card img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
}

.nh-lisabot__product-card strong,
.nh-lisabot__price {
    display: block;
}

.nh-lisabot__product-card p {
    margin: 5px 0;
    color: var(--nh-lisabot-muted);
    font-size: 12px;
    line-height: 1.35;
}

.nh-lisabot__product-card a {
    display: inline-block;
    margin-top: 6px;
    color: var(--nh-lisabot-primary);
    font-weight: 700;
    text-decoration: none;
}

.nh-lisabot__product-card a:hover {
    text-decoration: underline;
}

.nh-lisabot__more-btn {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid rgba(49, 37, 40, 0.18);
    border-radius: 999px;
    background: transparent;
    color: var(--nh-lisabot-ink);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.nh-lisabot__more-btn:hover {
    background: rgba(254, 186, 186, 0.25);
}

.nh-lisabot__message {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--nh-lisabot-ink);
    line-height: 1.45;
}

.nh-lisabot__message--bot {
    margin-right: auto;
    background: #fff;
    border: 1px solid rgba(49, 37, 40, 0.1);
}

.nh-lisabot__message--user {
    margin-left: auto;
    background: var(--nh-lisabot-primary);
}

.nh-lisabot__typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid rgba(49, 37, 40, 0.1);
    border-radius: 14px;
    background: #fff;
    margin-right: auto;
    width: fit-content;
}

.nh-lisabot__typing span {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--nh-lisabot-muted);
    animation: nh-lisabot-bounce 1.2s ease-in-out infinite;
}

.nh-lisabot__typing span:nth-child(1) { animation-delay: 0s; }
.nh-lisabot__typing span:nth-child(2) { animation-delay: 0.2s; }
.nh-lisabot__typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes nh-lisabot-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.nh-lisabot__form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(49, 37, 40, 0.1);
}

.nh-lisabot__support-form {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(49, 37, 40, 0.1);
    background: #fff;
}

.nh-lisabot__support-form[hidden] {
    display: none;
}

.nh-lisabot__support-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nh-lisabot__support-close {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border: 0;
    border-radius: 999px;
    background: #f6eeee;
    color: var(--nh-lisabot-ink);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.nh-lisabot__support-form input,
.nh-lisabot__support-form textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(49, 37, 40, 0.18);
    border-radius: 10px;
    padding: 9px 10px;
    resize: none;
}

.nh-lisabot__support-form p {
    margin: 0;
    color: var(--nh-lisabot-muted);
    font-size: 12px;
    line-height: 1.4;
}

.nh-lisabot__privacy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--nh-lisabot-muted);
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
}

.nh-lisabot__privacy input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 1px;
    cursor: pointer;
}

.nh-lisabot__support-form button[type="submit"] {
    border: 0;
    border-radius: 999px;
    background: var(--nh-lisabot-primary);
    color: var(--nh-lisabot-ink);
    cursor: pointer;
    font-weight: 700;
    padding: 11px 14px;
}

.nh-lisabot__form input {
    min-width: 0;
    border: 1px solid rgba(49, 37, 40, 0.18);
    border-radius: 999px;
    padding: 11px 13px;
    resize: none;
}

.nh-lisabot__form button {
    border: 0;
    border-radius: 999px;
    background: var(--nh-lisabot-primary);
    color: var(--nh-lisabot-ink);
    cursor: pointer;
    font-weight: 700;
    padding: 0 16px;
}

/* --- Vollbild-Chat auf Mobilgeräten --- */
@media (max-width: 480px) {
    /* Bubble hoch genug über sticky WooCommerce "In den Warenkorb"-Button (~70px hoch) */
    .nh-lisabot--floating {
        bottom: 86px;
    }

    .nh-lisabot--bottom-right {
        right: 16px;
    }

    .nh-lisabot--bottom-left {
        left: 16px;
    }

    /* Panel als vollflächiges Overlay */
    .nh-lisabot--floating .nh-lisabot__panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        max-width: 100% !important;
        /* 100dvh passt sich der sichtbaren Fläche an (Tastatur etc.) */
        height: 100vh;
        height: 100dvh;
        max-height: none !important;
        min-height: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-top: 0;
        /* Einfahren von unten statt Fade */
        opacity: 1;
        transform: translateY(100%);
        transition: transform 260ms ease;
    }

    .nh-lisabot--floating.is-open .nh-lisabot__panel {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* Wenn Chat offen: Widget-Container über alles (inkl. WP-Adminbar z-index: 99999) */
    .nh-lisabot--floating.is-open {
        z-index: 1000000 !important;
    }

    /* WP-Adminbar auf Mobilgeräten: 46px Höhe — Panel darunter beginnen */
    .admin-bar .nh-lisabot--floating .nh-lisabot__panel {
        top: 46px;
        height: calc(100vh - 46px);
        height: calc(100dvh - 46px);
    }

    /* iOS-Notch: Safe-Area oben berücksichtigen */
    .nh-lisabot--floating .nh-lisabot__panel {
        padding-top: env(safe-area-inset-top, 0px);
    }

    /* Kein Resize-Handle auf Mobilgeräten */
    .nh-lisabot__resize-handle {
        display: none;
    }

    /* Shortcode-Variante (eingebettet, kein Floating) */
    .nh-lisabot--shortcode .nh-lisabot__panel {
        width: calc(100vw - 24px);
        min-height: 340px;
    }
}

/* Verhindert Seitenscrollen wenn Chat auf Mobil offen ist */
.nh-lisabot-body-lock {
    overflow: hidden !important;
    touch-action: none;
}

/* --- Collection Cards --- */
.nh-lisabot__collection-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.nh-lisabot__collection-card {
    display: grid;
    grid-template-columns: 1fr;
    background: #fff;
    border: 1px solid rgba(49, 37, 40, 0.12);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.82rem;
}

.nh-lisabot__collection-card img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.nh-lisabot__collection-card > div {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nh-lisabot__collection-card strong {
    display: block;
    font-size: 0.84rem;
    color: var(--nh-lisabot-ink);
}

.nh-lisabot__collection-card p {
    margin: 0;
    font-size: 0.77rem;
    color: var(--nh-lisabot-muted);
    line-height: 1.4;
}

.nh-lisabot__collection-card a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-top: 8px;
    padding: 9px 14px;
    border: 1px solid rgba(255, 141, 139, 0.35);
    border-radius: 999px;
    background: var(--nh-lisabot-primary);
    color: var(--nh-lisabot-ink);
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(255, 141, 139, 0.24);
    transition: box-shadow 0.15s, transform 0.15s;
}

.nh-lisabot__collection-card a:hover {
    box-shadow: 0 8px 18px rgba(255, 141, 139, 0.32);
    text-decoration: none;
    transform: translateY(-1px);
}

/* Category CTA Buttons */
.nh-lisabot__cta-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0 4px;
}

.nh-lisabot__cta-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--nh-lisabot-primary);
    color: var(--nh-lisabot-ink);
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 141, 139, 0.28);
    transition: box-shadow 0.15s, transform 0.12s;
}

.nh-lisabot__cta-btn::after {
    content: '→';
    margin-left: 10px;
    flex-shrink: 0;
    font-size: 0.95em;
    opacity: 0.8;
}

.nh-lisabot__cta-btn:hover {
    box-shadow: 0 6px 16px rgba(255, 141, 139, 0.38);
    text-decoration: none;
    color: var(--nh-lisabot-ink);
    transform: translateY(-1px);
}

.nh-lisabot__cta-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(255, 141, 139, 0.22);
}

/* Product context line */
.nh-lisabot__product-context {
    font-size: 0.75rem;
    color: #888;
    padding: 6px 12px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Quick question chips */
.nh-lisabot__quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 6px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.nh-lisabot__quick-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    background: rgba(255,141,139,0.12);
    border: 1px solid rgba(255,141,139,0.3);
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #333 !important;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    line-height: 1.3;
    white-space: nowrap;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.nh-lisabot__quick-chip:hover {
    background: rgba(255,141,139,0.22);
    border-color: rgba(255,141,139,0.55);
}
