
:root {
    --km-chat-green: #03382F;
    --km-chat-green-2: #064f3d;
    --km-chat-deep: #032f27;
    --km-chat-yellow: #FBB900;
    --km-chat-text: #ffffff;
    --km-chat-muted: rgba(255,255,255,.72);
    --km-chat-border: rgba(255,255,255,.11);
}


/* =========================================================
   RESET
   ========================================================= */

.km-chatbot,
.km-chatbot * {
    box-sizing: border-box;
}


/* =========================================================
   CHATBOT
   ========================================================= */

.km-chatbot {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999999;

    font-family: Poppins, Arial, sans-serif;
}


/* =========================================================
   PRZYCISK OTWIERANIA
   ========================================================= */

.km-chatbot-toggle {
    min-width: 124px;
    height: 54px;

    padding: 0 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    border: 0;
    border-radius: 999px;

    background: var(--km-chat-yellow);
    color: #111;

    box-shadow: 0 14px 34px rgba(0,0,0,.28);

    font: inherit;
    font-size: 13px;
    font-weight: 800;

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}


.km-chatbot-toggle:hover {
    transform: translateY(-2px);

    box-shadow: 0 18px 38px rgba(0,0,0,.34);
}


.km-chatbot-toggle-icon {
    width: 27px;
    height: 27px;

    border-radius: 50%;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #111;
    color: var(--km-chat-yellow);

    font-size: 13px;
}


/* =========================================================
   PANEL
   ========================================================= */

.km-chatbot-panel {
    position: absolute;

    right: 0;
    bottom: 68px;

    width: min(390px, calc(100vw - 28px));
    height: min(650px, calc(100vh - 110px));

    display: grid;
    grid-template-rows: auto 1fr auto auto;

    overflow: hidden;

    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;

    background: var(--km-chat-deep);
    color: var(--km-chat-text);

    box-shadow: 0 24px 70px rgba(0,0,0,.42);
}


.km-chatbot-panel[hidden] {
    display: none !important;
}


/* =========================================================
   HEADER
   ========================================================= */

.km-chatbot-header {
    position: relative !important;

    min-height: 76px;

    padding:
        14px
        70px
        14px
        16px;

    display: flex;
    align-items: center;

    gap: 12px;

    background:
        linear-gradient(
            120deg,
            #075a46,
            var(--km-chat-green)
        );

    border-bottom: 1px solid var(--km-chat-border);
}


/* LOGO */

.km-chatbot-brandmark {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: var(--km-chat-yellow);
    color: #111;

    font-family: Oswald, Poppins, sans-serif;
    font-size: 18px;
    font-weight: 800;
}


/* NAGŁÓWEK */

.km-chatbot-heading {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 2px;
}


.km-chatbot-heading strong {
    font-size: 14px;
    line-height: 1.2;
}


.km-chatbot-heading span {
    color: var(--km-chat-muted);

    font-size: 11px;
    line-height: 1.35;
}


/* =========================================================
   PRZYCISK X
   CAŁKOWITY RESET STYLÓW ASTRY / WORDPRESSA
   ========================================================= */

html body #km-chatbot .km-chatbot-close {
    all: unset !important;

    box-sizing: border-box !important;

    position: absolute !important;

    top: 50% !important;
    right: 16px !important;

    transform: translateY(-50%) !important;

    width: 40px !important;
    height: 40px !important;

    min-width: 40px !important;
    max-width: 40px !important;

    min-height: 40px !important;
    max-height: 40px !important;

    inline-size: 40px !important;
    block-size: 40px !important;

    aspect-ratio: 1 / 1 !important;

    padding: 0 !important;
    margin: 0 !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    overflow: hidden !important;

    border: 0 !important;
    outline: 0 !important;

    border-radius: 50% !important;

    background: rgba(255,255,255,.08) !important;

    color: transparent !important;

    font-size: 0 !important;
    line-height: 0 !important;

    cursor: pointer !important;

    transition:
        background .2s ease,
        transform .2s ease !important;
}


/* RYSUJEMY X NIEZALEŻNIE OD TEKSTU BUTTONA */

html body #km-chatbot .km-chatbot-close::before {
    content: "×" !important;

    position: absolute !important;

    left: 50% !important;
    top: 50% !important;

    transform:
        translate(-50%, -52%) !important;

    display: block !important;

    width: auto !important;
    height: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    background: transparent !important;

    color: #ffffff !important;

    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    text-align: center !important;

    pointer-events: none !important;
}


/* HOVER */

html body #km-chatbot .km-chatbot-close:hover {
    background: rgba(255,255,255,.16) !important;
}


/* ACTIVE */

html body #km-chatbot .km-chatbot-close:active {
    transform:
        translateY(-50%)
        scale(.95) !important;
}


/* =========================================================
   WIADOMOŚCI
   ========================================================= */

.km-chatbot-messages {
    min-height: 0;

    overflow-y: auto;

    padding: 17px 14px 10px;

    scrollbar-width: thin;
}


.km-chatbot-message {
    display: flex;

    margin: 0 0 10px;
}


.km-chatbot-message-bot {
    justify-content: flex-start;
}


.km-chatbot-message-user {
    justify-content: flex-end;
}


.km-chatbot-bubble {
    max-width: 86%;

    padding: 11px 13px;

    border-radius: 14px;

    font-size: 12.5px;
    line-height: 1.55;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


.km-chatbot-message-bot .km-chatbot-bubble {
    background: rgba(255,255,255,.075);
    color: #fff;

    border-top-left-radius: 5px;
}


.km-chatbot-message-user .km-chatbot-bubble {
    background: var(--km-chat-yellow);
    color: #111;

    border-top-right-radius: 5px;

    font-weight: 600;
}


/* =========================================================
   LINKI
   ========================================================= */

.km-chatbot-links {
    display: grid;

    gap: 8px;

    margin: 0 0 13px;
}


.km-chatbot-link {
    min-height: 44px;

    padding: 0 13px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    border: 1px solid rgba(251,185,0,.32);
    border-radius: 10px;

    background: rgba(251,185,0,.06);

    color: #fff !important;

    text-decoration: none !important;

    font-size: 12px;
    font-weight: 700;

    transition: .2s ease;
}


.km-chatbot-link:hover {
    border-color: var(--km-chat-yellow);

    color: var(--km-chat-yellow) !important;
}


/* =========================================================
   PRODUKTY
   ========================================================= */

.km-chatbot-products {
    display: grid;

    gap: 9px;

    margin: 0 0 13px;
}


.km-chatbot-product {
    display: grid;

    grid-template-columns: 74px 1fr;

    gap: 11px;

    padding: 9px;

    border: 1px solid var(--km-chat-border);
    border-radius: 11px;

    background: rgba(255,255,255,.035);

    color: #fff !important;

    text-decoration: none !important;

    transition: .2s ease;
}


.km-chatbot-product:hover {
    transform: translateY(-1px);

    border-color: rgba(251,185,0,.55);
}


.km-chatbot-product-image {
    width: 74px;
    height: 74px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 8px;

    background: #fff;
}


.km-chatbot-product-image img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


.km-chatbot-product-body {
    min-width: 0;

    display: flex;
    flex-direction: column;

    justify-content: center;

    gap: 4px;
}


.km-chatbot-product-body strong {
    font-size: 12px;
    line-height: 1.35;
}


.km-chatbot-product-price {
    color: var(--km-chat-yellow);

    font-size: 12px;
    font-weight: 800;
}


.km-chatbot-product-cta {
    color: var(--km-chat-muted);

    font-size: 10.5px;
}


/* =========================================================
   SZYBKIE PRZYCISKI
   ========================================================= */

.km-chatbot-quick {
    padding: 6px 12px 9px;

    display: flex;

    gap: 7px;

    overflow-x: auto;

    scrollbar-width: none;
}


.km-chatbot-quick::-webkit-scrollbar {
    display: none;
}


.km-chatbot-chip {
    flex: 0 0 auto;

    min-height: 34px;

    padding: 0 11px;

    border: 1px solid rgba(255,255,255,.13);
    border-radius: 999px;

    background: rgba(255,255,255,.04);

    color: #fff;

    font: inherit;
    font-size: 10.5px;
    font-weight: 600;

    cursor: pointer;
}


.km-chatbot-chip:hover {
    border-color: var(--km-chat-yellow);

    color: var(--km-chat-yellow);
}


/* =========================================================
   FORMULARZ
   ========================================================= */

.km-chatbot-form {
    padding: 10px;

    display: grid;

    grid-template-columns:
        1fr
        44px;

    gap: 8px;

    border-top: 1px solid var(--km-chat-border);

    background: rgba(0,0,0,.12);
}


.km-chatbot-input {
    width: 100%;
    min-width: 0;
    height: 44px;

    padding: 0 13px;

    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;

    outline: none;

    background: rgba(255,255,255,.055);

    color: #fff;

    font: inherit;
    font-size: 12px;
}


.km-chatbot-input::placeholder {
    color: rgba(255,255,255,.48);
}


.km-chatbot-input:focus {
    border-color: rgba(251,185,0,.66);
}


/* =========================================================
   WYŚLIJ
   ========================================================= */

.km-chatbot-send {
    width: 44px;
    height: 44px;

    border: 0;
    border-radius: 10px;

    background: var(--km-chat-yellow);
    color: #111;

    font: inherit;

    font-size: 20px;
    font-weight: 900;

    cursor: pointer;
}


.km-chatbot-send:disabled {
    opacity: .55;

    cursor: wait;
}


/* =========================================================
   TYPING
   ========================================================= */

.km-chatbot-typing {
    display: inline-flex;

    align-items: center;

    gap: 4px;
}


.km-chatbot-typing i {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: rgba(255,255,255,.72);

    animation:
        km-chat-bounce
        1.1s
        infinite
        ease-in-out;
}


.km-chatbot-typing i:nth-child(2) {
    animation-delay: .14s;
}


.km-chatbot-typing i:nth-child(3) {
    animation-delay: .28s;
}


@keyframes km-chat-bounce {

    0%,
    70%,
    100% {
        transform: translateY(0);

        opacity: .45;
    }

    35% {
        transform: translateY(-4px);

        opacity: 1;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {

    .km-chatbot {
        right: 12px;
        bottom: 12px;
    }


    .km-chatbot-panel {
        position: fixed;

        left: 10px;
        right: 10px;
        bottom: 78px;

        width: auto;

        height: min(72vh, 610px);

        border-radius: 15px;
    }


    .km-chatbot-toggle {
        min-width: 112px;

        height: 50px;

        padding: 0 15px;
    }


    .km-chatbot-header {
        padding-right: 68px;
    }


    html body #km-chatbot .km-chatbot-close {
        right: 14px !important;
    }

}


/* =========================================================
   MAŁE TELEFONY
   ========================================================= */

@media (max-width: 390px) {

    .km-chatbot-panel {
        left: 6px;
        right: 6px;

        bottom: 70px;

        height: min(76vh, 610px);
    }

}