/* ── Woo AI Widget ─────────────────────────────────────── */
#boosaias-branding {
    text-align: center;
    padding-bottom: 5px;
}

#boosaias-branding a {
	font-size: 9px;
    text-decoration: none;
    text-align: center;
}

#boosaias-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
}

/* ── Toggle button ─────────────────────────────────────── */

#boosaias-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--boosaias-color, #2271b1), #0f172a);
    border: none;
    cursor: pointer;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .22), 0 6px 16px rgba(15, 23, 42, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

#boosaias-toggle::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: .55;
    animation: wooAiPulse 2.8s ease-out infinite;
}

@keyframes wooAiPulse {
    0% {
        transform: scale(.95);
        opacity: .55;
    }

    70% {
        transform: scale(1.28);
        opacity: 0;
    }

    100% {
        transform: scale(1.28);
        opacity: 0;
    }
}

#boosaias-toggle:hover {
    transform: scale(1.07);
    filter: saturate(1.05);
    box-shadow: 0 18px 44px rgba(15, 23, 42, .28), 0 8px 20px rgba(15, 23, 42, .16);
}

#boosaias-toggle svg {
    fill: #fff;
    width: 28px;
    height: 28px;
    position: relative;
}

/* ── Window ────────────────────────────────────────────── */

#boosaias-window {
    display: none;
    flex-direction: column;
    width: 360px;
    height: 520px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .18), 0 8px 24px rgba(15, 23, 42, .10);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .98)),
        #fff;
    backdrop-filter: blur(12px);
    overflow: hidden;
    margin-bottom: 12px;
    animation: wooAiSlideUp .2s ease;
}

#boosaias-window.open {
    display: flex;
}

@keyframes wooAiSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Header ────────────────────────────────────────────── */

#boosaias-header {
    background: linear-gradient(135deg, var(--boosaias-color, #2271b1), #111827);
    padding: 16px 16px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

#boosaias-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 45%);
    pointer-events: none;
}

#boosaias-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

#boosaias-avatar svg {
    fill: #fff;
    width: 22px;
    height: 22px;
}

#boosaias-header-text {
    flex: 1;
}

#boosaias-header-name {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    letter-spacing: -.01em;
}

#boosaias-header-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 2px;
    min-width: 0;
}

#boosaias-header-status-main {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

#boosaias-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
}

#boosaias-header-status span {
    color: rgba(255, 255, 255, .92);
    font-size: 12px;
    font-weight: 500;
}

#boosaias-header-timer {
    color: rgba(255, 255, 255, .82);
    font-size: 11px;
    line-height: 1.2;
    min-height: 1.2em;
    white-space: nowrap;
    padding-left: 2px;
}

#boosaias-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, .82);
    font-size: 20px;
    line-height: 1;
    padding: 0 0 0 8px;
    transition: color .15s, transform .15s;
    position: relative;
    z-index: 1;
}

#boosaias-close:hover {
    color: #fff;
    transform: scale(1.04);
}

/* ── Messages ──────────────────────────────────────────── */

#boosaias-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background:
        radial-gradient(circle at top, rgba(34, 113, 177, .06), rgba(34, 113, 177, 0) 35%),
        linear-gradient(180deg, #f8fafc, #f4f7fb);
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

#boosaias-messages::-webkit-scrollbar {
    width: 4px;
}

#boosaias-messages::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.boosaias-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: wooAiFadeIn .16s ease;
}

.boosaias-row.bot {
    align-self: flex-start;
    max-width: 88%;
}

.boosaias-row.user {
    align-self: flex-end;
    max-width: 88%;
    flex-direction: row-reverse;
}

.boosaias-bot-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--boosaias-color, #2271b1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.boosaias-bot-icon svg {
    fill: #fff;
    width: 14px;
    height: 14px;
}

.boosaias-msg {
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.55;
    word-break: break-word;
    font-size: 14px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset;
}

.boosaias-row.bot .boosaias-msg {
    background: #fff;
    color: #0f172a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06), 0 1px 0 rgba(255, 255, 255, .65) inset;
}

.boosaias-row.user .boosaias-msg {
    background: linear-gradient(135deg, var(--boosaias-color, #2271b1), #0f172a);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 24px rgba(34, 113, 177, .18), 0 1px 0 rgba(255, 255, 255, .12) inset;
}

/* Formatting inside bot messages */
.boosaias-msg p {
    margin: 0 0 8px;
}

.boosaias-msg p:last-child {
    margin-bottom: 0;
}

.boosaias-msg ol,
.boosaias-msg ul {
    margin: 6px 0;
    padding-left: 18px;
}

.boosaias-msg li {
    margin-bottom: 4px;
}

.boosaias-msg strong {
    font-weight: 600;
}

/* Product link buttons */
.boosaias-products {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.boosaias-btn-product {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--boosaias-color, #2271b1), #0f172a);
    color: #fff !important;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
    box-shadow: 0 6px 16px rgba(34, 113, 177, .16);
}

.boosaias-btn-product:hover {
    opacity: .92;
    transform: translateY(-1px);
}

/* Typing indicator */
.boosaias-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    width: fit-content;
}

.boosaias-typing span {
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: wooAiDot 1.2s infinite;
}

.boosaias-typing span:nth-child(2) {
    animation-delay: .2s;
}

.boosaias-typing span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes wooAiDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .4;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

@keyframes wooAiFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#boosaias-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(248, 250, 252, .98));
    border-top: 1px solid rgba(148, 163, 184, .14);
}

#boosaias-input {
    flex: 1;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 999px;
    padding: 13px 15px;
    font-size: 14px;
    background: #fff;
    color: #0f172a;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .03);
    transition: border-color .15s ease, box-shadow .15s ease;
}

#boosaias-input:focus {
    outline: none;
    border-color: var(--boosaias-color, #2271b1);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, .15);
}

#boosaias-send,
#boosaias-lead-submit,
#boosaias-lead-skip {
    border: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

#boosaias-send {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--boosaias-color, #2271b1), #0f172a);
    box-shadow: 0 10px 22px rgba(34, 113, 177, .18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#boosaias-send:hover,
#boosaias-lead-submit:hover,
#boosaias-lead-skip:hover {
    transform: translateY(-1px);
}

#boosaias-send svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

#boosaias-lead-form {
    padding: 0 14px 10px;
    display: none;
    gap: 8px;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(248, 250, 252, .85), rgba(255, 255, 255, .95));
    border-top: 1px solid rgba(148, 163, 184, .12);
}

#boosaias-lead-form.visible {
    display: flex;
}

#boosaias-lead-form input {
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 14px;
    padding: 11px 13px;
    font-size: 14px;
    background: #fff;
    color: #0f172a;
}

#boosaias-lead-form input:focus {
    outline: none;
    border-color: var(--boosaias-color, #2271b1);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, .12);
}

#boosaias-lead-actions {
    display: flex;
    gap: 8px;
}

#boosaias-lead-submit {
    flex: 1;
    border-radius: 12px;
    padding: 11px 14px;
    background: linear-gradient(135deg, var(--boosaias-color, #2271b1), #0f172a);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 22px rgba(34, 113, 177, .16);
}

#boosaias-lead-skip {
    border-radius: 12px;
    padding: 11px 14px;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 600;
}

#boosaias-lead-submit:hover {
    opacity: .95;
}

#boosaias-lead-skip:hover {
    background: #cbd5e1;
}

@media (max-width: 480px) {
    #boosaias-widget {
        left: 12px;
        right: 12px;
        bottom: 12px;
        font-size: 14px;
    }

    #boosaias-window {
        width: calc(100vw - 24px);
        height: min(72vh, 560px);
    }
}