/* --------------------------------------------------------- */
/* CHATBOT WINDOW (Main Interface)
/* --------------------------------------------------------- */
.beerloyuz-ai-chatbot-popup * {
    font-family: "Montserrat", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.beerloyuz-ai-chatbot-popup {
    position: fixed;
    right: 15px;
    bottom: 70px;
    opacity: 0;
    pointer-events: none;
    width: 340px;
    height: 420px;
    transform: scale(0.2);
    transform-origin: bottom right;
    border-radius: 5px;
    box-shadow: 0 0 128px rgba(0, 0, 0, 0.1), 0 32px 64px -48px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    z-index: 2147483648;
}

body.show-beerloyuz-ai-chatbot .beerloyuz-ai-chatbot-popup {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.beerloyuz-ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--beerloyuz-ai-color);
    padding: 5px 17px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.beerloyuz-ai-header-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.beerloyuz-ai-header-info h2 {
    user-select: none;
    margin: 0px !important;
}

.beerloyuz-ai-header-info .chatbot-logo {
    height: 18px;
    width: 18px;
    padding: 2px;
    fill: var(--beerloyuz-ai-color);
    flex-shrink: 0;
    background: #fff;
    border-radius: 50%;
}

.beerloyuz-ai-header-info .beerloyuz-ai-logo-text {
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
}

.beerloyuz-ai-chat-header #beerloyuz-ai-close-chatbot {
    border: none;
    color: #fff;
    height: 40px;
    width: 40px;
    font-size: 1.9rem;
    margin-right: -10px;
    cursor: pointer;
    border-radius: 50%;
    background: none;
    transition: 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#beerloyuz-ai-close-chatbot:hover {
    background: var(--beerloyuz-ai-hover-color);
}

.beerloyuz-ai-chat-header #beerloyuz-ai-delete-chat-history {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: #fff;
    height: 40px;
    width: 40px;
    font-size: 1.9rem;
    cursor: pointer;
    border-radius: 50%;
    background: none;
    transition: 0.2s ease;
}

.beerloyuz-ai-chat-header .beerloyuz-ai-header-controls {
    display: flex;
}

#beerloyuz-ai-delete-chat-history:hover {
    background: var(--beerloyuz-ai-hover-color);
}

.beerloyuz-ai-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.beerloyuz-ai-chat-body {
    padding: 15px 22px;
    display: flex;
    gap: 20px;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
    height: 310px;
    background: #fff;
    margin-bottom: 92px;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #ccccf5 transparent;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message {
    display: flex;
    gap: 11px;
    align-items: center;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message img[src$=".png"],
.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message img[src$=".jpg"],
.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message img[src$=".jpeg"] {
    filter: grayscale(1) brightness(.1);
}

.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message img[src$=".svg"] {
    fill: #000000;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-user-message {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-message .beerloyuz-ai-message-text {
    padding: 6px 10px;
    max-width: 75%;
    font-size: 0.7rem;
    background: #F2F2FF;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message.beerloyuz-ai-thinking .beerloyuz-ai-message-text {
    padding: 2px 16px;
    border-radius: 13px 13px 13px 3px;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message .beerloyuz-ai-message-text {
    background: #F2F2FF;
    border-radius: 13px 13px 13px 3px;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-user-message .beerloyuz-ai-message-text {
    color: #fff;
    background: var(--beerloyuz-ai-color);
    border-radius: 13px 13px 3px 13px;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message .beerloyuz-ai-thinking-indicator {
    display: flex;
    gap: 2px;
    padding-block: 8px;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-user-message .attachment {
    width: 50%;
    margin-top: 7px;
    border-radius: 13px 3px 13px 13px;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message .beerloyuz-ai-thinking-indicator .beerloyuz-ai-dot {
    height: 5px;
    width: 5px;
    opacity: 0.7;
    border-radius: 50%;
    background: #6F6BC2;
    animation: dotPulse 1.8s ease-in-out infinite;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message .beerloyuz-ai-thinking-indicator .beerloyuz-ai-dot:nth-child(1) {
    animation-delay: 0.2s;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message .beerloyuz-ai-thinking-indicator .beerloyuz-ai-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.beerloyuz-ai-chat-body .beerloyuz-ai-bot-message .beerloyuz-ai-thinking-indicator .beerloyuz-ai-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    44% {
        transform: translateY(0);
    }

    28% {
        opacity: 0.4;
        transform: translateY(-4px);
    }

    44% {
        opacity: 0.2;
    }
}

.beerloyuz-ai-chat-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #fff;
    padding: 5px 10px 5px 10px;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

.beerloyuz-ai-chat-footer .beerloyuz-ai-chat-form {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 32px;
    outline: 1px solid #CCCCE5;
}

.beerloyuz-ai-chat-footer .beerloyuz-ai-chat-form:focus-within {
    outline: 2px solid var(--beerloyuz-ai-color);
}

.beerloyuz-ai-chat-form .beerloyuz-ai-message-input {
    border: none !important;
    outline: none !important;
    height: 24px;
    width: 100%;
    resize: none;
    font-size: 0.7rem;
    padding: 4px 0 4px 14px;
    border-radius: inherit;
}

.beerloyuz-ai-chat-form .beerloyuz-ai-chat-controls {
    display: flex;
    height: 32px;
    gap: 3px;
    align-items: center;
    align-self: flex-end;
    padding-right: 6px;
}

.beerloyuz-ai-chat-form .beerloyuz-ai-chat-controls button {
    height: 24px;
    width: 24px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #706DB0;
    background: none;
    border-radius: 50%;
    transition: 0.2s ease;
}

.beerloyuz-ai-chat-form .beerloyuz-ai-chat-controls #beerloyuz-ai-send-message {
    background: var(--beerloyuz-ai-color);
    color: #fff;
    display: none;
}

.beerloyuz-ai-chat-form .beerloyuz-ai-message-input:valid~.beerloyuz-ai-chat-controls #beerloyuz-ai-send-message {
    display: block;
    background: var(--beerloyuz-ai-color);
    color: #fff;

}

.beerloyuz-ai-chat-form .beerloyuz-ai-message-input:valid~.beerloyuz-ai-chat-controls #beerloyuz-ai-send-message:hover {
    background: var(--beerloyuz-ai-hover-color);
}

.beerloyuz-ai-chat-form .beerloyuz-ai-chat-controls button:hover {
    background: #f1f1ff;
}

/* Warnings & Suggestions */
.beerloyuz-ai-warning {
    font-size: 0.6rem !important;
    font-weight: 300 !important;
    text-align: center !important;
    padding-top: 5px !important;
}

.beerloyuz-ai-message-suggestion-body {
    display: flex;
    gap: 10px;
    flex-direction: column;
    opacity: 0;
    animation-fill-mode: forwards;
}

.beerloyuz-ai-message-suggestion-body .beerloyuz-ai-message-suggestions-text {
    font-size: 0.6rem;
}

.beerloyuz-ai-message-suggestion-body .beerloyuz-ai-message-suggestions {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.beerloyuz-ai-message-suggestion-body button {
    color: black;
    background: transparent;
    border: 0.5px solid #00000017;
    border-radius: 10px;
    text-align: left;
    padding: 5px 13px;
    cursor: pointer;
    font-size: 0.6rem;
    font-weight: 300;
    transition: 0.2s border ease;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.beerloyuz-ai-message-suggestion-body button:hover {
    border: 0.5px solid var(--beerloyuz-ai-hover-color);
    background: transparent;
    color: black;
}

/* Delete confirmation dialog */
.beerloyuz-ai-confirm-popup {
    display: flex;
    opacity: 0;
    pointer-events: none;
    justify-content: center;
    font-weight: 300;
    font-size: 0.82rem;
    align-items: center;
    position: absolute;
    border-radius: 5px;
    width: 100%;
    height: 100%;
    background: #00000064;
    z-index: 9999;
    transition: opacity 0.2s ease;
}

.beerloyuz-ai-confirm-content {
    width: 90%;
    height: 150px;
    padding: 10px;
    background-color: white;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.beerloyuz-ai-confirm-content h4 {
    font-size: 1.52rem !important;
    font-weight: 700 !important;
}

.beerloyuz-ai-confirm-content p {
    font-size: 0.82rem !important;
    font-weight: 300 !important;
}

.beerloyuz-ai-confirm-btn {
    margin: 8px 4px 0 4px !important;
    border: none !important;
    border-radius: 4px;
    background: var(--beerloyuz-ai-color, #2B6CB0);
    color: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.beerloyuz-ai-confirm-btn:hover {
    background: var(--beerloyuz-ai-hover-color, #28619e);
}

#beerloyuz-ai-confirm-no {
    background: transparent !important;
    color: var(--beerloyuz-ai-color, #2B6CB0);
    transition: box-shadow 0.2s ease;
    padding: 6px 18px !important;
}

#beerloyuz-ai-confirm-yes {
    padding: 6px 18px !important;
}

#beerloyuz-ai-confirm-no:hover {
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}

.beerloyuz-ai-confirm-buttons {
    display: flex;
    margin-top: 15px;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
}

/* Reminders & Errors */
body.beerloyuz-ai-active.beerloyuz-ai-loaded .beerloyuz-ai-chatbot-reminder-active {
    display: flex;
}

.beerloyuz-ai-chatbot-reminder {
    position: fixed;
    right: 15px;
    bottom: 70px;
    gap: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
}

.beerloyuz-ai-chatbot-reminder .beerloyuz-ai-chatbot-reminder-close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
}

.beerloyuz-ai-chatbot-reminder .beerloyuz-ai-chatbot-reminder-close:hover {
    background: rgb(178, 178, 178);
}

.beerloyuz-ai-chatbot-reminder p {
    user-select: none;
    border-radius: 25px;
    font-size: .72rem;
    padding: 10px;
    background-color: white;
    color: black;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
    margin: 0px !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.beerloyuz-ai-chatbot-reminder p:hover {
    background-color: #f1f1ff;
}

body.beerloyuz-ai-active.beerloyuz-ai-loaded .beerloyuz-ai-chatbot-error-active {
    display: flex;
}

.beerloyuz-ai-chatbot-error {
    position: absolute;
    top: -80px;
    gap: 20px;
    display: none;
    align-items: center;
    justify-content: center;
}

.beerloyuz-ai-chatbot-error .beerloyuz-ai-chatbot-error-close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 40px;
    height: 40px;
    background: rgb(152, 16, 16);
    border-radius: 50%;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
}

.beerloyuz-ai-chatbot-error .beerloyuz-ai-chatbot-error-close:hover {
    background: rgb(133, 14, 14);
}

.beerloyuz-ai-chatbot-error p {
    user-select: none;
    border-radius: 25px;
    font-size: .67rem;
    padding: 10px;
    background-color: rgb(255, 255, 255);
    color: black;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
}

/* Tooltips */
[data-beerloyuz-tooltip] {
    position: relative;
}

[data-beerloyuz-tooltip]::after {
    content: attr(data-beerloyuz-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    font-weight: 500;
    margin-bottom: 5px;
    text-transform: none !important;
}

[data-beerloyuz-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
    text-transform: none !important;
}

.beerloyuz-ai-chat-footer [data-beerloyuz-tooltip]::after {
    bottom: 115%;
}

/* Smart Handoff Card */
.beerloyuz-ai-bot-message .beerloyuz-ai-message-text.handoff-mode {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    max-width: 100% !important;
}

.beerloyuz-ai-handoff-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.beerloyuz-ai-handoff-text {
    font-size: 0.8rem;
    color: #333;
    line-height: 1.4;
    margin: 0;
}

.beerloyuz-ai-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #25D366;
    color: white !important;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s, transform 0.1s;
}

.beerloyuz-ai-whatsapp-btn:hover {
    background-color: #1ebc57;
    transform: translateY(-1px);
}

.beerloyuz-ai-social-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.beerloyuz-ai-social-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #555 !important;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.beerloyuz-ai-social-icon-btn:hover {
    background: #fff;
    border-color: #ddd;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.beerloyuz-ai-social-icon-btn.phone:hover {
    color: #3498db !important;
}

.beerloyuz-ai-social-icon-btn.instagram:hover {
    color: #E1306C !important;
}

.beerloyuz-ai-social-icon-btn.facebook:hover {
    color: #1877F2 !important;
}

.beerloyuz-ai-social-icon-btn.linkedin:hover {
    color: #0077b5 !important;
}

.beerloyuz-ai-social-icon-btn.youtube:hover {
    color: #FF0000 !important;
}

.beerloyuz-ai-social-icon-btn.twitter:hover {
    color: #1DA1F2 !important;
}

/* Animations */
@keyframes beerloyuzSlideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.show-beerloyuz-ai-chatbot .beerloyuz-ai-message-suggestion-body {
    animation: beerloyuzSlideUpFade 0.5s ease-out 1.5s forwards;
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
    body.show-beerloyuz-ai-chatbot {
        overflow: hidden;
        position: fixed;
        width: 100vw;
        height: 100vh;
        touch-action: none;
    }

    .beerloyuz-ai-chatbot-popup {
        width: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
        height: 70%;
    }

    .beerloyuz-ai-chat-header {
        border-radius: 0;
    }

    .beerloyuz-ai-chat-body {
        height: calc(90% - 55px);
        padding: 25px 15px;
    }

    .beerloyuz-ai-chat-footer {
        padding: 10px;
    }

    .beerloyuz-ai-chat-form .beerloyuz-ai-message-input {
        font-size: 14px;
        height: 40px;
        padding: 8px 12px;
    }

    .beerloyuz-ai-chat-form .beerloyuz-ai-chat-controls {
        height: 40px;
        gap: 6px;
        padding-right: 4px;
    }

    .beerloyuz-ai-chat-form .beerloyuz-ai-chat-controls button {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }

    body.show-beerloyuz-ai-chatbot::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.218);
        z-index: 2147483648;
        pointer-events: none;
        transition: background 0.3s;
    }

    .beerloyuz-ai-chatbot-reminder p {
        font-size: .62rem;
    }

    .beerloyuz-ai-chatbot-error p {
        font-size: .57rem;
    }
}