:root{
    --bitesbot-color: #b98b5c;
    --bitesbot-bubble-text: "Bot de ayuda";
}

#bitesbot-bubble {
    position: fixed;
    right: 18px;
    top: 58%;
    transform: translateY(-50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 8px 22px rgba(0,0,0,0.18);
    transition: transform .2s ease, box-shadow .2s ease;
    overflow: visible;
    border: 2px solid var(--bitesbot-color);
}

#bitesbot-bubble:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}

#bitesbot-bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 🔥 clave */
    border-radius: 50%;
}

#bitesbot-bubble::before {
    content: var(--bitesbot-bubble-text);
    position: absolute;
    right: 68px;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #654321;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    border: 1px solid #eadfce;
    white-space: nowrap;
    opacity: 1;
    visibility: visible;
}
#bitesbot-bubble:hover::before {
    opacity: 1;
    visibility: visible;
}

#bitesbot-window {
    position: fixed;
    right: 90px;
    top: 50%;
    transform: translateY(-50%);
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 620px;
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 9999;
    box-shadow: 0 18px 50px rgba(0,0,0,0.25);
    border: 1px solid #eee;
    font-family: Arial, Helvetica, sans-serif;
}

.bitesbot-header {
    background: var(--bitesbot-color);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}

.bitesbot-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bitesbot-header strong {
    font-size: 16px;
}

.bitesbot-header small {
    font-size: 12px;
    opacity: .9;
}

#bitesbot-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
}

#bitesbot-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    background: #faf8f5;
}

#bitesbot-messages {
    padding: 15px;
    overflow-y: auto;
    flex: 0 0 auto;
    max-height: 42%;
}

#bitesbot-options {
    padding: 12px;
    border-top: 1px solid #ece7e0;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 18px;
}

.bitesbot-message {
    background: #fff;
    padding: 12px 14px;
    border-radius: 14px 14px 14px 4px;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    color: #333;
    font-size: 14px;
    line-height: 1.45;
}

.bitesbot-option {
    border: 1px solid #e1d6c8;
    background: #fffaf3;
    color: #654321;
    padding: 12px 14px;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: background .2s ease, transform .15s ease;
}

.bitesbot-option:hover {
    background: #f7ecd8;
    transform: translateY(-1px);
}

.bitesbot-back {
    background: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
}

.bitesbot-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 12px;
}

.bitesbot-form label {
    font-size: 13px;
    color: #444;
    margin-bottom: 4px;
    display: block;
    font-weight: bold;
}

.bitesbot-form input,
.bitesbot-form textarea,
.bitesbot-form select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d8d8d8;
    border-radius: 14px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    background: #fff;
}

.bitesbot-form textarea {
    min-height: 100px;
    resize: vertical;
}

.bitesbot-submit {
    border: none;
    background: var(--bitesbot-color);
    color: #fff;
    padding: 14px;
    border-radius: 14px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 700;
    margin-top: 6px;
    position: sticky;
    bottom: 0;
}

.bitesbot-submit:hover {
    opacity: .95;
}

.bitesbot-loading {
    font-size: 13px;
    color: #777;
    padding: 8px 0;
}

/* Cuando se carga un formulario, damos m谩s espacio abajo */
#bitesbot-window.form-mode #bitesbot-messages {
    max-height: 34%;
}

#bitesbot-window.form-mode #bitesbot-options {
    flex: 1 1 auto;
    overflow-y: auto;
}

/* M贸vil */
@media (max-width: 768px) {
    #bitesbot-bubble {
        right: 14px;
        top: auto;
        bottom: 98px;
        transform: none;
        width: 54px;
        height: 54px;
    }

    #bitesbot-bubble:hover {
        transform: scale(1.04);
    }

    #bitesbot-bubble::before {
        content: "Ayuda";
        right: 62px;
        font-size: 11px;
        padding: 6px 9px;
    }

    #bitesbot-window {
        right: 10px;
        left: 10px;
        top: 12px;
        bottom: 12px;
        transform: none;
        width: auto;
        max-width: none;
        height: auto;
        max-height: none;
        border-radius: 20px;
    }

    #bitesbot-body {
        min-height: 0;
    }

    #bitesbot-messages {
        max-height: 34%;
        padding: 12px;
    }

    #bitesbot-options {
        padding: 12px;
        flex: 1 1 auto;
        overflow-y: auto;
        min-height: 0;
        padding-bottom: 22px;
    }

    #bitesbot-window.form-mode #bitesbot-messages {
        max-height: 28%;
    }

    .bitesbot-form input,
    .bitesbot-form textarea,
    .bitesbot-form select {
        font-size: 16px;
    }

    .bitesbot-submit {
        padding: 14px;
        font-size: 15px;
        margin-bottom: 4px;
    }
}