.ai-widget {
    position: fixed;
    right: 20px;
    bottom: 50px;
    z-index: 1050;
    font-family: 'Roboto', sans-serif;
    color: var(--header-text-dark, #232323);
}

a.to-top {
    bottom: 120px !important;
    right: 28px;
    z-index: 1060;
    color: #fff;
}

.ai-hint {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 16px;
    width: min(330px, calc(100vw - 2rem));
}

.ai-hint.is-hidden,
.ai-hint.d-none {
    display: none;
}

.ai-hint-card {
    position: relative;
    padding: 18px 16px;
    background: var(--header-white, #fff);
    border: 1px solid var(--header-border-grey, #e0e0e0);
    border-radius: var(--header-border-radius, 12px);
    box-shadow: 0 3px 24px rgba(0, 0, 0, 0.1);
}

.ai-hint-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--header-text-grey, #656565);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.ai-hint-close:hover {
    color: var(--header-text-dark, #232323);
    background: var(--header-bg-grey, #f1f0ed);
}

.ai-hint-body {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-right: 18px;
}

.ai-hint-title {
    margin: 0 0 6px;
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--header-text-dark, #232323);
}

.ai-hint-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--header-text-grey, #656565);
}

.ai-hint .ai-arrow {
    position: absolute;
    bottom: -8px;
    right: 22px;
    width: 14px;
    height: 14px;
    background: var(--header-white, #fff);
    border-right: 1px solid var(--header-border-grey, #e0e0e0);
    border-bottom: 1px solid var(--header-border-grey, #e0e0e0);
    transform: rotate(45deg);
}

.ai-trigger {
    position: relative;
    cursor: pointer;
}

.ai-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: #FFD93B;
    animation: aiPulseRing 2s ease-out infinite;
    pointer-events: none;
}

@keyframes aiPulseRing {
    0% {
        transform: scale(1);
        opacity: 0.45;
    }
    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

.ai-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: #FFD93B;
    box-shadow: 0 3px 24px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.ai-btn:hover {
    background-color: #f0c820;
    box-shadow: 0 6px 20px rgba(255, 217, 59, 0.45);
    transform: translateY(-1px);
}

.ai-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 217, 59, 0.45), 0 3px 24px rgba(0, 0, 0, 0.15);
}

.ai-btn svg {
    width: 26px;
    height: 26px;
    fill: var(--header-text-dark, #232323);
    flex-shrink: 0;
}

.ai-logo {
    width: 60px;
    height: auto;
    flex-shrink: 0;
    object-fit: contain;
}

.ai-hint.fade-in {
    animation: aiHintFadeIn 0.35s ease;
}

@keyframes aiHintFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (min-width: 576px) {
    .ai-hint {
        bottom: auto;
        top: 50%;
        right: 100%;
        margin-right: 16px;
        margin-bottom: 0;
        transform: translateY(-50%);
    }

    .ai-hint.fade-in {
        animation-name: aiHintFadeInSide;
    }

    .ai-hint .ai-arrow {
        bottom: auto;
        right: -8px;
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
        border-right: 1px solid var(--header-border-grey, #e0e0e0);
        border-bottom: none;
        border-top: 1px solid var(--header-border-grey, #e0e0e0);
    }

    @keyframes aiHintFadeInSide {
        from {
            opacity: 0;
            transform: translateY(-50%) translateX(6px);
        }
        to {
            opacity: 1;
            transform: translateY(-50%);
        }
    }
}

@media (max-width: 480px) {
    .ai-widget {
        right: 12px;
        bottom: 60px;
    }

    a.to-top {
        bottom: 144px !important;
        right: 20px;
    }

    .ai-btn {
        width: 52px;
        height: 52px;
    }
}
