/* ============================================================
   Zyraluxe AI Jewellery Chatbot
   ============================================================ */

.zy-chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.zy-chatbot__launcher {
    border: 0;
    border-radius: 999px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .18);
    background: #111;
    color: #fff;
}

.zy-chatbot__launcher-icon {
    font-size: 18px;
}

.zy-chatbot__panel {
    width: min(390px, calc(100vw - 28px));
    height: min(650px, calc(100vh - 100px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
    border: 1px solid rgba(0, 0, 0, .08);
}

.zy-chatbot__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
    background: #111;
    color: #fff;
}

.zy-chatbot__brand {
    font-size: 12px;
    opacity: .75;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.zy-chatbot__title {
    margin-top: 3px;
    font-size: 17px;
    font-weight: 700;
}

.zy-chatbot__close {
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

.zy-chatbot__messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: #fafafa;
}

.zy-chatbot__message {
    display: flex;
    margin: 0 0 12px;
}

.zy-chatbot__message--user {
    justify-content: flex-end;
}

.zy-chatbot__bubble {
    max-width: 85%;
    padding: 11px 13px;
    border-radius: 15px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: 14px;
    line-height: 1.55;
}

.zy-chatbot__message--assistant .zy-chatbot__bubble {
    background: #fff;
    border: 1px solid #e9e9e9;
}

.zy-chatbot__message--user .zy-chatbot__bubble {
    background: #111;
    color: #fff;
}

/* ============================================================
   Product cards
   ============================================================ */

.zy-chatbot__products {
    width: 100%;
    display: grid;
    gap: 12px;
    margin: 0 0 14px;
}

.zy-chatbot__product {
    display: flex;
    gap: 11px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
}

.zy-chatbot__product-image {
    width: 96px;
    min-width: 96px;
    height: 118px;
    object-fit: cover;
    background: #f3f3f3;
}

.zy-chatbot__product--no-image {
    min-height: 0;
}

.zy-chatbot__product-content {
    min-width: 0;
    flex: 1;
    padding: 11px 11px 11px 0;
}

.zy-chatbot__product-name {
    color: #171717;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
}

.zy-chatbot__product-price {
    margin-top: 5px;
    color: #111;
    font-size: 15px;
    font-weight: 700;
}

.zy-chatbot__product-meta {
    margin-top: 4px;
    color: #777;
    font-size: 11px;
    line-height: 1.4;
}

.zy-chatbot__product-description {
    margin-top: 6px;
    color: #666;
    font-size: 11px;
    line-height: 1.45;
}

.zy-chatbot__product-stock {
    margin-top: 7px;
    color: #237a3b;
    font-size: 11px;
    font-weight: 600;
}

.zy-chatbot__product-stock--out {
    color: #a33;
}

.zy-chatbot__product-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 9px;
    background: #111;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 600;
}

.zy-chatbot__product-button:hover {
    opacity: .88;
}

/* ============================================================
   Typing indicator
   ============================================================ */

.zy-chatbot__typing {
    display: flex;
    gap: 4px;
    padding: 0 18px 10px;
}

.zy-chatbot__typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #777;
    animation: zy-chatbot-pulse 1s infinite ease-in-out;
}

.zy-chatbot__typing span:nth-child(2) {
    animation-delay: .15s;
}

.zy-chatbot__typing span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes zy-chatbot-pulse {

    0%,
    80%,
    100% {
        opacity: .25;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* ============================================================
   Input
   ============================================================ */

.zy-chatbot__form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 12px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-wrap: wrap;
}

.zy-chatbot__input {
    flex: 1;
    min-width: 0;
    max-height: 120px;
    resize: none;
    border: 1px solid #ddd;
    border-radius: 13px;
    padding: 11px 12px;
    outline: none;
    font: inherit;
    font-size: 14px;
    line-height: 1.45;
}

.zy-chatbot__input:focus {
    border-color: #999;
}

.zy-chatbot__send {
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    cursor: pointer;
    background: #111;
    color: #fff;
    font-weight: 600;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zy-chatbot__send:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.zy-chatbot__footer {
    padding: 7px 12px 10px;
    text-align: center;
    font-size: 10px;
    color: #999;
    background: #fff;
}

@media (max-width: 600px) {
    .zy-chatbot {
        right: 12px;
        bottom: 12px;
    }

    .zy-chatbot__launcher {
        padding: 13px 16px;
    }

    .zy-chatbot__panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 80px);
    }

    .zy-chatbot__messages {
        padding: 14px;
    }

    .zy-chatbot__bubble {
        max-width: 90%;
        padding: 10px 12px;
        font-size: 13px;
    }

    .zy-chatbot__form {
        padding: 10px;
        gap: 6px;
    }

    .zy-chatbot__input {
        padding: 10px 11px;
        font-size: 13px;
        min-height: 44px;
    }

    .zy-chatbot__send {
        padding: 10px 14px;
        min-height: 44px;
    }

    .zy-chatbot__product-image {
        width: 84px;
        min-width: 84px;
        height: 106px;
    }

    .zy-chatbot__product-content {
        padding-right: 9px;
    }
}

@media (max-width: 400px) {
    .zy-chatbot__panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 60px);
    }

    .zy-chatbot__header {
        padding: 14px;
    }

    .zy-chatbot__title {
        font-size: 15px;
    }

    .zy-chatbot__messages {
        padding: 12px;
    }

    .zy-chatbot__bubble {
        max-width: 92%;
        padding: 9px 11px;
        font-size: 12px;
        line-height: 1.4;
    }

    .zy-chatbot__form {
        flex-direction: column;
        padding: 10px 8px;
    }

    .zy-chatbot__input {
        width: 100%;
        padding: 10px 11px;
        font-size: 13px;
        min-height: 44px;
    }

    .zy-chatbot__send {
        width: 100%;
        padding: 10px 14px;
        min-height: 44px;
    }

    .zy-chatbot__product {
        gap: 8px;
    }

    .zy-chatbot__product-image {
        width: 72px;
        min-width: 72px;
        height: 92px;
    }
}