/* Chatbot flotante Arc */
.arc-chatbot-widget {
    position: fixed;
    bottom: 1rem;
    z-index: 100;
    --arc-chatbot-primary: #0EA5E9;
}

@media (min-width: 640px) {
    .arc-chatbot-widget {
        bottom: 1.5rem;
    }
}

.arc-chatbot-widget.arc-chatbot-right {
    right: 1rem;
}

.arc-chatbot-widget.arc-chatbot-left {
    left: 1rem;
}

@media (min-width: 640px) {
    .arc-chatbot-widget.arc-chatbot-right {
        right: 1.5rem;
    }

    .arc-chatbot-widget.arc-chatbot-left {
        left: 1.5rem;
    }
}

.arc-chatbot-toggle {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    border: none;
    background: var(--arc-chatbot-primary);
    color: #fff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.arc-chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.arc-chatbot-toggle svg {
    width: 1.5rem;
    height: 1.5rem;
}

.arc-chatbot-icon-close,
.arc-chatbot-window-open .arc-chatbot-icon-open {
    display: none;
}

.arc-chatbot-window-open .arc-chatbot-icon-close {
    display: block;
}

.arc-chatbot-window {
    position: absolute;
    bottom: 4.5rem;
    width: 22rem;
    max-width: calc(100vw - 2rem);
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.arc-chatbot-widget.arc-chatbot-right .arc-chatbot-window {
    right: 0;
}

.arc-chatbot-widget.arc-chatbot-left .arc-chatbot-window {
    left: 0;
}

.arc-chatbot-window-open .arc-chatbot-window {
    display: flex;
}

.arc-chatbot-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--arc-chatbot-primary);
    color: #fff;
}

.arc-chatbot-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.arc-chatbot-avatar svg {
    width: 1.25rem;
    height: 1.25rem;
}

.arc-chatbot-title {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.arc-chatbot-close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
}

.arc-chatbot-close svg {
    width: 1.25rem;
    height: 1.25rem;
}

.arc-chatbot-messages {
    flex: 1;
    min-height: 18rem;
    max-height: 24rem;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8fafc;
}

.arc-chatbot-message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    word-wrap: break-word;
    animation: arc-chatbot-fade-in 0.25s ease;
}

@keyframes arc-chatbot-fade-in {
    from { opacity: 0; transform: translateY(0.25rem); }
    to { opacity: 1; transform: translateY(0); }
}

.arc-chatbot-message-user {
    align-self: flex-end;
    background: var(--arc-chatbot-primary);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.arc-chatbot-message-bot {
    align-self: flex-start;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 0.25rem;
}

.arc-chatbot-typing {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
}

.arc-chatbot-typing span {
    width: 0.5rem;
    height: 0.5rem;
    background: #cbd5e1;
    border-radius: 9999px;
    animation: arc-chatbot-typing 1s infinite ease-in-out;
}

.arc-chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.arc-chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes arc-chatbot-typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-0.25rem); }
}

.arc-chatbot-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.arc-chatbot-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.arc-chatbot-input:focus {
    border-color: var(--arc-chatbot-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.arc-chatbot-send {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    border: none;
    background: var(--arc-chatbot-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: filter 0.2s ease;
}

.arc-chatbot-send:hover {
    filter: brightness(1.1);
}

.arc-chatbot-send svg {
    width: 1rem;
    height: 1rem;
}

@media (max-width: 480px) {
    .arc-chatbot-window {
        width: calc(100vw - 1.5rem);
        bottom: 4rem;
    }

    .arc-chatbot-messages {
        min-height: 14rem;
        max-height: 20rem;
    }

    .arc-chatbot-message {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }

    .arc-chatbot-input {
        padding: 0.5rem 0.875rem;
    }

    .arc-chatbot-widget.arc-chatbot-right .arc-chatbot-window,
    .arc-chatbot-widget.arc-chatbot-left .arc-chatbot-window {
        left: 0;
        right: auto;
    }
}
