/* ==========================================================================
   AI CHATBOT WIDGET & MODAL-LG - DUY TIEN WATERPROOFING
   ========================================================================== */

:root {
    --bot-primary: #2563EB;
    --bot-secondary: #1D4ED8;
    --bot-accent: #f59e0b;
    --bot-success: #22c55e;
    --bot-surface: #ffffff;
    --bot-bg: #f8fafc;
    --bot-text: #0f172a;
    --bot-text-muted: #64748b;
    --bot-border: #e2e8f0;
}

/* Prevent body scrolling when modal is open */
body.bot-modal-open {
    overflow: hidden !important;
    touch-action: none;
}

/* Base resets inside bot components */
#bot-modal-wrapper *,
#bot-overlay *,
#bot-widget-container *,
#bot-modal-wrapper *::before,
#bot-modal-wrapper *::after,
#bot-widget-container *::before,
#bot-widget-container *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   1. BACKDROP OVERLAY WITH BLUR EFFECT
   ========================================================================== */
.bot-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99998;
    animation: botOverlayFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes botOverlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==========================================================================
   2. CENTERED MODAL WRAPPER (MODAL-LG)
   ========================================================================== */
.bot-modal-wrapper {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--bot-text);
    line-height: 1.5;
}

/* Modal-LG Window Container */
.bot-chat-modal {
    width: 100%;
    max-width: 860px;
    height: 84vh;
    max-height: 740px;
    min-height: 520px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: botModalZoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes botModalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.93) translateY(18px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   3. MODAL HEADER
   ========================================================================== */
.bot-header {
    background: linear-gradient(135deg, var(--bot-primary, #2563EB) 0%, var(--bot-secondary, #1D4ED8) 100%);
    color: #ffffff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
}

.bot-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.bot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    /* overflow: hidden; */
    flex-shrink: 0;
    position: relative;
    border: 2.5px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.bot-avatar-pulse {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    background: var(--bot-success, #22c55e);
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.bot-header-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.bot-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-name {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-ai-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.9);
}

.bot-status-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
}

.bot-status-divider {
    opacity: 0.5;
    font-size: 11px;
}

.bot-status-sub {
    opacity: 0.85;
    font-size: 12px;
}

.bot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.bot-header-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
    padding: 0;
}

.bot-header-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
}

.bot-header-action-btn:active {
    transform: scale(0.94);
}

.bot-close-btn:hover {
    background: rgba(239, 68, 68, 0.85);
}

/* ==========================================================================
   4. MESSAGES CONTAINER & TYPOGRAPHY
   ========================================================================== */
.bot-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: #f8fafc;
    scroll-behavior: smooth;
    box-sizing: border-box;
}

.bot-messages::-webkit-scrollbar {
    width: 6px;
}

.bot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.bot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.bot-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Message Rows */
.bot-msg {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    animation: botMsgFadeIn 0.25s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@keyframes botMsgFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-msg.bot-msg--user {
    flex-direction: row-reverse;
}

.bot-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bot-primary, #2563EB);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.bot-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.bot-msg--user .bot-msg-avatar {
    background: #475569;
}

.bot-msg-content {
    max-width: 82%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.bot-msg--user .bot-msg-content {
    align-items: flex-end;
}

.bot-msg--bot .bot-msg-content {
    align-items: flex-start;
}

/* Bubbles */
.bot-msg-bubble {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    padding: 16px 20px;
    border-radius: 4px 20px 20px 20px;
    font-size: 14.5px;
    line-height: 1.65;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-sizing: border-box;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
}

.bot-msg--bot .bot-msg-bubble {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

.bot-msg--bot .bot-msg-bubble strong,
.bot-msg--bot .bot-msg-bubble b {
    color: #0f172a;
    font-weight: 700;
}

.bot-msg--user .bot-msg-bubble {
    background: linear-gradient(135deg, var(--bot-primary, #2563EB) 0%, var(--bot-secondary, #1D4ED8) 100%);
    color: #ffffff;
    border: none;
    border-radius: 20px 20px 4px 20px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
    padding: 12px 18px;
}

.bot-msg-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 5px;
    padding: 0 4px;
}

.bot-msg--user .bot-msg-time {
    text-align: right;
}

.bot-msg--bot .bot-msg-time {
    text-align: left;
}

/* Bullet Line Styling */
.bot-bullet-line {
    margin: 6px 0;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid var(--bot-primary, #2563EB);
    line-height: 1.55;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.bot-bullet-dot {
    color: var(--bot-primary, #2563eb);
    font-weight: 700;
    flex-shrink: 0;
}

.bot-bullet-text {
    flex: 1;
    min-width: 0;
}

/* Emoji SVG styling */
.bot-svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: -0.15em;
    width: 1.18em;
    height: 1.18em;
    margin: 0 2px;
    line-height: 1;
}

.bot-svg-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bot-svg-icon--phone {
    color: #16a34a;
}

.bot-svg-icon--chat {
    color: #0284c7;
}

.bot-svg-icon--location {
    color: #ea580c;
}

.bot-svg-icon--email {
    color: #2563eb;
}

.bot-svg-icon--smile {
    color: #f59e0b;
}

.bot-svg-icon--thumbs-up {
    color: #10b981;
}

.bot-svg-icon--thumbs-down {
    color: #ef4444;
}

.bot-svg-icon--star {
    color: #f59e0b;
}

.bot-svg-icon--party {
    color: #ec4899;
}

.bot-svg-icon--shield {
    color: #059669;
}

.bot-svg-icon--warning {
    color: #eab308;
}

.bot-svg-icon--house {
    color: #3b82f6;
}

.bot-svg-icon--money {
    color: #16a34a;
}

/* ==========================================================================
   5. RESULT CARDS (PRODUCT / SERVICE / POST IN MODAL-LG)
   ========================================================================== */
.bot-result-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 14px;
    width: 100%;
    box-sizing: border-box;
}

.bot-result-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.bot-result-card:hover {
    transform: translateY(-3px);
    border-color: var(--bot-primary, #2563EB);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.14);
    text-decoration: none;
    color: inherit;
}

.bot-result-card-img {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #f1f5f9;
}

.bot-result-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    display: block;
}

.bot-result-card:hover .bot-result-card-img img {
    transform: scale(1.06);
}

.bot-result-card-body {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bot-result-card-title {
    font-weight: 600;
    font-size: 13.5px;
    color: #0f172a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bot-result-card-price {
    font-size: 13px;
    font-weight: 700;
    color: #e11d48;
}

.bot-result-card-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bot-result-card-btn {
    padding: 8px 12px;
    background: #eff6ff;
    color: var(--bot-primary, #2563EB);
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    transition: background 0.2s, color 0.2s;
}

.bot-result-card:hover .bot-result-card-btn {
    background: var(--bot-primary, #2563EB);
    color: #ffffff;
}

/* Typing indicator */
.bot-typing {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
    background: #ffffff;
    border-radius: 4px 18px 18px 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    width: fit-content;
}

.bot-typing.active {
    display: flex;
}

.bot-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: botTypingDot 1.4s infinite;
}

.bot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.bot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes botTypingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* ==========================================================================
   6. SUGGESTED QUESTIONS (PROMPT CHIPS)
   ========================================================================== */
.bot-suggested {
    padding: 10px 28px 12px 28px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 95px;
    overflow-y: auto;
    flex-shrink: 0;
}

.bot-suggested::-webkit-scrollbar {
    width: 4px;
}

.bot-suggested::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.bot-suggestion-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
    outline: none;
    font-family: inherit;
}

.bot-suggestion-btn:hover {
    background: #eff6ff;
    border-color: var(--bot-primary, #2563EB);
    color: var(--bot-primary, #2563EB);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   7. INPUT AREA
   ========================================================================== */
.bot-input-area {
    padding: 14px 28px 16px 28px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.bot-input-wrapper {
    display: flex;
    align-items: flex-end;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 26px;
    padding: 4px 6px 4px 18px;
    gap: 8px;
    transition: all 0.2s ease;
}

.bot-input-wrapper:focus-within {
    border-color: var(--bot-primary, #2563EB);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

#bot-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14.5px;
    line-height: 1.5;
    color: #0f172a;
    resize: none;
    max-height: 120px;
    min-height: 38px;
    padding: 8px 4px 8px 0;
    font-family: inherit;
    box-sizing: border-box;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* Custom scrollbar nhỏ gọn, tinh tế cho #bot-input */
#bot-input::-webkit-scrollbar {
    width: 4px;
}

#bot-input::-webkit-scrollbar-track {
    background: transparent;
}

#bot-input::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#bot-input::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#bot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bot-primary, #2563EB) 0%, var(--bot-secondary, #1D4ED8) 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    outline: none;
    padding: 0;
}

color: #ffffff;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: transform 0.15s ease,
box-shadow 0.2s ease;
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
outline: none;
padding: 0;
}

#bot-send-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

#bot-send-btn:active {
    transform: scale(0.95);
}

.bot-input-disclaimer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #94a3b8;
    padding: 0 4px;
}

.bot-input-disclaimer svg {
    flex-shrink: 0;
}

/* ==========================================================================
   8. FLOATING TRIGGER BUTTON & TEASER POPUP
   ========================================================================== */
#bot-widget-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99990;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#bot-widget-container.bot-pos-right {
    left: auto;
    right: 24px;
}

#bot-widget-container.bot-pos-left {
    left: 24px;
    right: auto;
}

/* Smoothly hide floating button when modal is active */
body.bot-modal-open #bot-widget-container {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}

/* Floating toggle button */
#bot-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bot-primary, #2563EB);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    position: relative;
    padding: 0;
    outline: none;
    overflow: visible;
}

#bot-toggle-btn.has-avatar {
    background: #ffffff;
    border: 2.5px solid #d97706;
    /* Golden ring border */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}

#bot-toggle-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.55);
}

#bot-toggle-btn.has-avatar:hover {
    box-shadow: 0 8px 26px rgba(217, 119, 6, 0.4);
}

#bot-toggle-btn:active {
    transform: scale(0.95);
}

#bot-toggle-btn .bot-icon-chat,
#bot-toggle-btn .bot-icon-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform 0.2s, opacity 0.2s;
    width: 100%;
    height: 100%;
}

#bot-toggle-btn.has-avatar .bot-icon-chat {
    border-radius: 50%;
    overflow: hidden;
}

.bot-toggle-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* Online green dot on toggle button */
.bot-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    z-index: 5;
}

#bot-toggle-btn .bot-icon-close {
    display: none;
}

#bot-toggle-btn.bot-is-open {
    background: #475569 !important;
    border: none !important;
}

#bot-toggle-btn.bot-is-open .bot-icon-chat,
#bot-toggle-btn.bot-is-open .bot-online-dot {
    display: none !important;
}

#bot-toggle-btn.bot-is-open .bot-icon-close {
    display: inline-flex;
}

#bot-toggle-btn .bot-unread-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid #ffffff;
}

/* ==========================================================================
   9. TEASER POPUP
   ========================================================================== */
.bot-teaser-popup {
    position: absolute;
    left: 72px;
    bottom: 4px;
    z-index: 99991;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.95);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    animation: botTeaserIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.bot-teaser-popup:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.2), 0 4px 12px rgba(15, 23, 42, 0.08);
}

@keyframes botTeaserIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bot-teaser-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 34px 12px 14px;
    min-width: 250px;
    max-width: 320px;
}

.bot-teaser-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bot-primary, #2563EB);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.bot-teaser-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.bot-teaser-avatar svg {
    width: 24px;
    height: 24px;
}

.bot-teaser-body {
    flex: 1;
    font-size: 13px;
    line-height: 1.45;
    color: #1e293b;
    word-break: break-word;
}

.bot-teaser-body p {
    margin: 0 0 4px 0;
    line-height: 1.45;
}

.bot-teaser-body p:last-child {
    margin-bottom: 0;
}

.bot-teaser-body a {
    color: var(--bot-primary, #2563EB);
    text-decoration: underline;
    font-weight: 600;
}

.bot-teaser-body strong,
.bot-teaser-body b {
    color: #d97706;
    font-weight: 700;
}

.bot-teaser-body [style*="color"] strong,
.bot-teaser-body [style*="color"] b,
.bot-teaser-body strong[style*="color"],
.bot-teaser-body b[style*="color"] {
    color: inherit;
}

.bot-teaser-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.bot-teaser-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Positioning based on widget position */
.bot-pos-left .bot-teaser-popup {
    left: 72px;
    bottom: 4px;
}

.bot-pos-left .bot-teaser-popup::after {
    content: '';
    position: absolute;
    left: -7px;
    bottom: 22px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-left: 1px solid rgba(226, 232, 240, 0.95);
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    transform: rotate(45deg);
    border-radius: 0 0 0 3px;
}

.bot-pos-right .bot-teaser-popup {
    right: 72px;
    left: auto;
    bottom: 4px;
}

.bot-pos-right .bot-teaser-popup::after {
    content: '';
    position: absolute;
    right: -7px;
    bottom: 22px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-right: 1px solid rgba(226, 232, 240, 0.95);
    border-top: 1px solid rgba(226, 232, 240, 0.95);
    transform: rotate(45deg);
    border-radius: 0 3px 0 0;
}

/* ==========================================================================
   10. RESPONSIVE DESIGN ACROSS ALL DEVICES
   ========================================================================== */

/* Tablets & Small Laptops (max-width: 860px) */
@media (max-width: 860px) {
    .bot-modal-wrapper {
        padding: 16px;
    }

    .bot-chat-modal {
        width: 100%;
        max-width: 100%;
        height: 90vh;
        max-height: 90vh;
        border-radius: 20px;
    }

    .bot-header {
        padding: 14px 20px;
    }

    .bot-messages {
        padding: 18px 20px;
        gap: 14px;
    }

    .bot-msg-content {
        max-width: 88%;
    }

    .bot-suggested {
        padding: 8px 20px 10px 20px;
    }

    .bot-input-area {
        padding: 10px 20px 14px 20px;
    }

    .bot-result-cards {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Mobile Phones (max-width: 600px) */
@media (max-width: 600px) {
    .bot-modal-wrapper {
        padding: 0;
    }

    .bot-chat-modal {
        width: 100%;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .bot-header {
        padding: 12px 16px;
    }

    .bot-avatar {
        width: 42px;
        height: 42px;
    }

    .bot-name {
        font-size: 15.5px;
    }

    .bot-ai-badge {
        display: none;
    }

    .bot-status-sub {
        display: none;
    }

    .bot-status-divider {
        display: none;
    }

    .bot-messages {
        padding: 14px 14px;
        gap: 12px;
    }

    .bot-msg-content {
        max-width: 90%;
    }

    .bot-msg-bubble {
        padding: 12px 16px;
        font-size: 14px;
    }

    .bot-suggested {
        padding: 6px 14px 8px 14px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bot-input-area {
        padding: 8px 14px 12px 14px;
    }

    .bot-input-disclaimer {
        display: none;
    }

    .bot-result-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .bot-result-card {
        flex-direction: row;
        align-items: center;
        padding: 8px;
        gap: 10px;
    }

    .bot-result-card-img {
        width: 70px;
        height: 70px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .bot-result-card-btn {
        display: none;
    }

    .bot-pos-left .bot-teaser-popup,
    .bot-pos-right .bot-teaser-popup {
        left: 0;
        right: auto;
        bottom: 74px;
        max-width: calc(100vw - 48px);
    }

    .bot-pos-left .bot-teaser-popup::after,
    .bot-pos-right .bot-teaser-popup::after {
        display: none;
    }
}