/* Mkonnect eCommerce Advisor — Premium Green floating chatbot widget */

.mk-chatbot-root {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: inherit;
}

/* Launcher button */
.mk-chatbot-launcher {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    border: none;
    border-radius: 999px;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.42), transparent 30%),
        linear-gradient(135deg, #14532d 0%, #15803d 45%, #22c55e 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 20px 44px rgba(20, 83, 45, 0.34),
        0 8px 18px rgba(22, 163, 74, 0.24);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.mk-chatbot-launcher:hover,
.mk-chatbot-launcher:focus-visible {
    transform: translateY(-2px) scale(1.035);
    box-shadow:
        0 26px 58px rgba(20, 83, 45, 0.40),
        0 10px 24px rgba(22, 163, 74, 0.30);
    filter: saturate(1.08);
}

.mk-chatbot-launcher:focus-visible {
    outline: 3px solid rgba(34, 197, 94, 0.30);
    outline-offset: 4px;
}

.mk-chatbot-launcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.mk-chatbot-launcher svg {
    width: 26px;
    height: 26px;
    color: #ffffff;
    fill: currentColor;
}

/* Panel */
.mk-chatbot-panel {
    position: fixed;
    right: 24px;
    bottom: 102px;
    width: min(430px, calc(100vw - 32px));
    height: min(680px, 78vh);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border-radius: 26px;
    border: 1px solid rgba(21, 128, 61, 0.18);
    background: #ffffff;
    box-shadow:
        0 34px 78px rgba(15, 23, 42, 0.22),
        0 10px 26px rgba(20, 83, 45, 0.12);
    z-index: 99998;
}

.mk-chatbot-panel.mk-chatbot-panel--open {
    display: flex !important;
    flex-direction: column !important;
}

.mk-chatbot-panel[hidden] {
    display: none !important;
}

/* Header — never shrink/collapse when body grows (long i18n lines / RTL-safe layout) */
.mk-chatbot-panel-header {
    flex-shrink: 0 !important;
    padding: 18px 18px 16px !important;
    background:
        radial-gradient(circle at 20% 0%, rgba(187, 247, 208, 0.18), transparent 34%),
        linear-gradient(135deg, #052e16 0%, #14532d 45%, #166534 100%) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 14px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
}

.mk-chatbot-brand {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.mk-chatbot-brand-copy {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.mk-chatbot-avatar {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.10)) !important;
    border: 1px solid rgba(255, 255, 255, 0.20) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16) !important;
}

.mk-chatbot-avatar img {
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    object-fit: contain !important;
    display: block !important;
}

.mk-chatbot-title {
    margin: 0 !important;
    color: #ffffff !important;
    font-size: 17px !important;
    line-height: 1.2 !important;
    font-weight: 850 !important;
    letter-spacing: -0.015em !important;
    overflow-wrap: anywhere !important;
    word-wrap: break-word !important;
}

.mk-chatbot-subtitle {
    margin: 5px 0 0 !important;
    color: rgba(240, 253, 244, 0.86) !important;
    font-size: 12.5px !important;
    line-height: 1.42 !important;
    overflow-wrap: anywhere !important;
    word-wrap: break-word !important;
}

.mk-chatbot-close {
    flex-shrink: 0 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.13) !important;
    color: #ffffff !important;
    font-size: 24px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition:
        background-color 0.18s ease,
        transform 0.18s ease !important;
}

.mk-chatbot-close:hover,
.mk-chatbot-close:focus-visible {
    background: rgba(255, 255, 255, 0.22) !important;
    transform: scale(1.04) !important;
}

/* Body */
.mk-chatbot-panel-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.10), transparent 30%),
        radial-gradient(circle at bottom right, rgba(187, 247, 208, 0.22), transparent 32%),
        linear-gradient(180deg, #f8fafc 0%, #ecfdf5 100%);
}

/* Messages */
.mk-chatbot-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.mk-chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.mk-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.mk-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(22, 101, 52, 0.26);
    border-radius: 999px;
}

.mk-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(22, 101, 52, 0.38);
}

.mk-chatbot-msg {
    display: flex;
}

.mk-chatbot-msg--bot {
    justify-content: flex-start;
}

.mk-chatbot-msg--user {
    justify-content: flex-end;
}

.mk-chatbot-bubble {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.mk-chatbot-msg--bot .mk-chatbot-bubble {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(21, 128, 61, 0.12);
    color: #0f172a;
    box-shadow:
        0 6px 16px rgba(15, 23, 42, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.70) inset;
    border-bottom-left-radius: 8px;
}

.mk-chatbot-msg--user .mk-chatbot-bubble {
    background:
        radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.20), transparent 24%),
        linear-gradient(135deg, #15803d 0%, #16a34a 55%, #22c55e 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 22px rgba(22, 163, 74, 0.22);
    border-bottom-right-radius: 8px;
}

/* Suggestions */
.mk-chatbot-suggestions {
    flex-shrink: 0;
    padding: 0 16px 14px;
}

.mk-chatbot-suggestions-label {
    margin-bottom: 10px;
    color: #166534;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.mk-chatbot-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mk-chatbot-chip {
    border: 1px solid rgba(22, 163, 74, 0.38);
    background: rgba(255, 255, 255, 0.92);
    color: #166534;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(20, 83, 45, 0.05);
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.mk-chatbot-chip:hover,
.mk-chatbot-chip:focus-visible {
    background: #166534;
    color: #ffffff;
    border-color: #166534;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(20, 83, 45, 0.18);
}

/* Form */
.mk-chatbot-form {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(21, 128, 61, 0.14);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.04);
}

.mk-chatbot-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 0 14px;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
    outline: none;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.mk-chatbot-input::placeholder {
    color: #94a3b8;
}

.mk-chatbot-input:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.mk-chatbot-send {
    flex: 0 0 auto;
    height: 46px;
    border: 0;
    border-radius: 14px;
    padding: 0 18px;
    background:
        radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.22), transparent 25%),
        linear-gradient(135deg, #14532d 0%, #15803d 45%, #22c55e 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(22, 101, 52, 0.24);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
}

.mk-chatbot-send:hover,
.mk-chatbot-send:focus-visible {
    transform: translateY(-1px);
    filter: saturate(1.08);
    box-shadow: 0 16px 32px rgba(22, 101, 52, 0.30);
}

/* CTA buttons inside bot replies */
.mk-chatbot-cta-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(22, 163, 74, 0.18);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mk-chatbot-cta-primary,
.mk-chatbot-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    line-height: 1.15;
    font-weight: 800;
    text-decoration: none;
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.mk-chatbot-cta-primary {
    background: #166534;
    color: #ffffff;
    border: 1px solid #166534;
}

.mk-chatbot-cta-primary:hover,
.mk-chatbot-cta-primary:focus-visible {
    background: #14532d;
    color: #ffffff;
    border-color: #14532d;
    transform: translateY(-1px);
}

.mk-chatbot-cta-secondary {
    background: #ffffff;
    color: #166534;
    border: 1px solid rgba(22, 163, 74, 0.40);
}

.mk-chatbot-cta-secondary:hover,
.mk-chatbot-cta-secondary:focus-visible {
    background: rgba(34, 197, 94, 0.10);
    color: #14532d;
    border-color: rgba(22, 163, 74, 0.70);
    transform: translateY(-1px);
}

/* Compatibility cleanup for older Bootstrap classes if still present somewhere */
.mk-chatbot-panel.card,
.mk-chatbot-panel .card-header,
.mk-chatbot-panel .card-body {
    border: 0;
}

.mk-chatbot-panel .btn {
    border-radius: 999px;
}

/* Mobile */
@media (max-width: 575.98px) {
    .mk-chatbot-root {
        right: 14px;
        bottom: 14px;
    }

    .mk-chatbot-launcher {
        width: 58px;
        height: 58px;
        min-width: 58px;
        min-height: 58px;
    }

    .mk-chatbot-panel {
        right: 14px;
        bottom: 86px;
        width: calc(100vw - 28px);
        height: min(74vh, 620px);
        border-radius: 22px;
    }

    .mk-chatbot-panel-header {
        padding: 16px 16px 14px !important;
    }

    .mk-chatbot-avatar {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
    }

    .mk-chatbot-title {
        font-size: 15.5px !important;
    }

    .mk-chatbot-subtitle {
        font-size: 12px !important;
    }

    .mk-chatbot-messages {
        padding: 14px;
    }

    .mk-chatbot-bubble {
        max-width: 92%;
        font-size: 13.5px;
    }

    .mk-chatbot-suggestions {
        padding: 0 14px 12px;
    }

    .mk-chatbot-form {
        padding: 12px 14px 14px;
        gap: 8px;
    }

    .mk-chatbot-input {
        height: 44px;
        border-radius: 13px;
    }

    .mk-chatbot-send {
        height: 44px;
        padding: 0 14px;
        border-radius: 13px;
    }
}