/* Chatbot Smarty – veřejný widget */

.site-front .scroll-to-top {
    bottom: calc(5.5rem + var(--safe-bottom));
}

.chatbot-root {
    position: fixed;
    right: calc(1rem + var(--safe-right));
    bottom: calc(1rem + var(--safe-bottom));
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    pointer-events: none;
}

.chatbot-hint,
.chatbot-fab,
.chatbot-panel {
    pointer-events: auto;
}

.chatbot-hint {
    background: #fff;
    color: var(--karvina-text);
    border: 1px solid var(--karvina-border);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.875rem;
    box-shadow: 0 4px 16px rgba(43, 41, 41, 0.12);
    max-width: 16rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.chatbot-fab {
    width: 3.5rem;
    height: 3.5rem;
    border: none;
    border-radius: 50%;
    padding: 0;
    background: #111;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    overflow: hidden;
    animation: chatbot-bounce 2.4s ease-in-out infinite;
}

.chatbot-fab img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chatbot-fab.is-open,
.chatbot-fab[aria-expanded="true"] {
    animation: none;
}

@keyframes chatbot-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
    .chatbot-fab {
        animation: none;
    }
}

.chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 4.25rem;
    width: min(24rem, calc(100vw - 2rem));
    height: min(36rem, calc(100dvh - 6rem));
    background: #f3f5fb;
    border-radius: 1rem;
    box-shadow: 0 12px 40px rgba(43, 41, 41, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: var(--karvina-primary);
    color: #fff;
}

.chatbot-title {
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chatbot-terms {
    color: #fff;
    font-size: 0.75rem;
    text-decoration: underline;
    white-space: nowrap;
}

.chatbot-icon-btn,
.chatbot-send {
    border: none;
    background: transparent;
    color: inherit;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chatbot-icon-btn:hover,
.chatbot-send:hover {
    background: rgba(255, 255, 255, 0.15);
}

.chatbot-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.chatbot-bubble {
    max-width: 85%;
    padding: 0.65rem 0.85rem;
    border-radius: 0.9rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.chatbot-bubble--bot {
    align-self: flex-start;
    background: #fff;
    color: var(--karvina-text);
    border: 1px solid var(--karvina-border);
    border-bottom-left-radius: 0.25rem;
}

.chatbot-bubble--user {
    align-self: flex-end;
    background: var(--karvina-primary);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.chatbot-thinking {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #555;
    font-size: 0.875rem;
}

.chatbot-form {
    display: flex;
    gap: 0.4rem;
    padding: 0.7rem;
    background: #fff;
    border-top: 1px solid var(--karvina-border);
}

.chatbot-form textarea {
    flex: 1 1 auto;
    resize: none;
    border: 1px solid var(--karvina-border);
    border-radius: 0.75rem;
    padding: 0.55rem 0.75rem;
    min-height: 2.6rem;
    max-height: 6rem;
    font-size: 1rem;
}

.chatbot-send {
    background: var(--karvina-primary);
    color: #fff;
    border-radius: 0.75rem;
    align-self: flex-end;
}

.chatbot-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 575.98px) {
    .chatbot-panel {
        position: fixed;
        inset: auto 0 0 0;
        width: 100%;
        height: min(85dvh, 40rem);
        bottom: 0;
        right: 0;
        border-radius: 1rem 1rem 0 0;
    }
}
