/* Erpa AI Sales Assistant widget */
.nova-assistant {
    --nova-ai-navy: #071733;
    --nova-ai-blue: #0f62fe;
    --nova-ai-cyan: #22d3ee;
    --nova-ai-green: #16a34a;
    --nova-ai-line: #dbe6f3;
    --nova-ai-soft: #f5f8fc;
    --nova-ai-text: #172033;
    --nova-ai-muted: #667085;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 4200;
    color: var(--nova-ai-text);
    font-family: inherit;
}

.nova-assistant * {
    box-sizing: border-box;
}

.nova-assistant-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 118px;
    min-height: 56px;
    padding: 0 18px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--nova-ai-navy), #123d78);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 18px 38px rgba(7, 23, 51, 0.28);
    font-weight: 900;
    letter-spacing: 0;
    cursor: pointer;
}

.nova-assistant-toggle::before {
    content: "";
    position: absolute;
    inset: -7px;
    z-index: -1;
    border: 1px solid rgba(15, 98, 254, 0.18);
    border-radius: inherit;
    animation: novaAssistantPulse 1800ms ease-out infinite;
}

.nova-assistant-toggle i {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--nova-ai-navy);
    background: #ffffff;
    border-radius: 999px;
    font-size: 18px;
}

.nova-assistant-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(410px, calc(100vw - 32px));
    height: min(690px, calc(100dvh - 112px));
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(219, 230, 243, 0.95);
    border-radius: 20px;
    box-shadow: 0 28px 78px rgba(7, 23, 51, 0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.985);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
    pointer-events: none;
}

.nova-assistant.is-open .nova-assistant-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.nova-assistant.is-open .nova-assistant-toggle {
    display: none;
}

.nova-assistant-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    color: #ffffff;
    background:
        radial-gradient(circle at 8% 0%, rgba(34, 211, 238, 0.22), transparent 32%),
        linear-gradient(135deg, var(--nova-ai-navy), #103a72);
}

.nova-assistant-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nova-assistant-title {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.nova-assistant-avatar {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    color: var(--nova-ai-navy);
    background: #ffffff;
    border-radius: 14px;
    font-size: 20px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.nova-assistant-title strong,
.nova-assistant-title span {
    display: block;
}

.nova-assistant-title strong {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.15;
}

.nova-assistant-title span {
    position: relative;
    margin-top: 3px;
    padding-left: 12px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 800;
}

.nova-assistant-title span::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 999px;
    transform: translateY(-50%);
}

.nova-assistant-close,
.nova-assistant-sound {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
}

.nova-assistant-sound.is-on {
    color: var(--nova-ai-navy);
    background: #ffffff;
    border-color: #ffffff;
}

.nova-assistant-sound[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
}

.nova-assistant-body {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.nova-assistant-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px 10px;
    overflow-x: hidden;
    border-bottom: 1px solid var(--nova-ai-line);
}

.nova-assistant-chip {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    max-width: 100%;
    min-height: 34px;
    padding: 8px 12px;
    color: var(--nova-ai-navy);
    background: #ffffff;
    border: 1px solid var(--nova-ai-line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.nova-assistant-chip:hover,
.nova-assistant-chip:focus-visible {
    color: #ffffff;
    background: var(--nova-ai-navy);
    border-color: var(--nova-ai-navy);
}

.nova-assistant-messages {
    min-height: 0;
    padding: 14px;
    overflow-x: hidden;
    overflow-y: auto;
}

.nova-assistant-debug {
    margin: 0 14px 10px;
    overflow: hidden;
    color: #0f172a;
    background: #eef4fb;
    border: 1px dashed var(--nova-ai-line);
    border-radius: 12px;
}

.nova-assistant-debug[hidden] {
    display: none;
}

.nova-assistant-debug-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 9px;
    border-bottom: 1px solid var(--nova-ai-line);
    font-size: 11px;
}

.nova-assistant-debug-head button {
    min-height: 24px;
    padding: 0 8px;
    color: #ffffff;
    background: var(--nova-ai-navy);
    border: 0;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.nova-assistant-debug pre {
    max-height: 104px;
    margin: 0;
    padding: 8px 9px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 10px;
    line-height: 1.45;
}

.nova-message {
    display: flex;
    margin-bottom: 12px;
}

.nova-message.is-user {
    justify-content: flex-end;
}

.nova-message.is-draft .nova-bubble {
    opacity: 0.78;
    border: 1px dashed rgba(15, 98, 254, 0.38);
    box-shadow: none;
}

.nova-bubble {
    max-width: 86%;
    padding: 11px 13px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.nova-message.is-bot .nova-bubble {
    color: var(--nova-ai-text);
    background: #ffffff;
    border: 1px solid var(--nova-ai-line);
    border-bottom-left-radius: 6px;
}

.nova-message.is-user .nova-bubble {
    color: #ffffff;
    background: linear-gradient(135deg, var(--nova-ai-blue), #174ea6);
    border-bottom-right-radius: 6px;
}

.nova-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 50px;
}

.nova-typing span {
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 999px;
    animation: novaAssistantTyping 900ms ease-in-out infinite;
}

.nova-typing span:nth-child(2) {
    animation-delay: 120ms;
}

.nova-typing span:nth-child(3) {
    animation-delay: 240ms;
}

.nova-products {
    display: grid;
    gap: 10px;
    margin: 2px 0 14px;
}

.nova-product-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--nova-ai-line);
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.nova-product-media {
    display: grid;
    height: 118px;
    place-items: center;
    overflow: hidden;
    color: var(--nova-ai-navy);
    background: #eef4fb;
}

.nova-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nova-product-media i {
    font-size: 30px;
}

.nova-product-content {
    padding: 12px;
}

.nova-product-kicker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
    color: var(--nova-ai-muted);
    font-size: 11px;
    font-weight: 850;
}

.nova-stock {
    color: var(--nova-ai-green);
}

.nova-stock.is-out {
    color: #dc2626;
}

.nova-product-content h3 {
    margin: 0 0 6px;
    color: var(--nova-ai-navy);
    font-size: 15px;
    line-height: 1.22;
}

.nova-product-content p {
    margin: 0 0 10px;
    color: #475467;
    font-size: 12px;
    line-height: 1.45;
}

.nova-product-price {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 11px;
}

.nova-product-price strong {
    color: var(--nova-ai-navy);
    font-size: 17px;
}

.nova-product-price span {
    color: var(--nova-ai-muted);
    font-size: 11px;
    font-weight: 800;
}

.nova-product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.nova-product-actions a,
.nova-product-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 9px;
    border: 1px solid var(--nova-ai-line);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.nova-product-actions button {
    color: #ffffff;
    background: var(--nova-ai-blue);
    border-color: var(--nova-ai-blue);
}

.nova-product-actions button[data-nova-buy-now] {
    background: var(--nova-ai-navy);
    border-color: var(--nova-ai-navy);
}

.nova-product-actions a {
    color: var(--nova-ai-navy);
    background: #ffffff;
}

.nova-product-actions a[data-nova-whatsapp] {
    color: #ffffff;
    background: var(--nova-ai-green);
    border-color: var(--nova-ai-green);
}

.nova-product-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.nova-product-actions .nova-full {
    grid-column: 1 / -1;
}

.nova-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 3px 0 13px;
    max-width: 100%;
    overflow: hidden;
}

.nova-action-row a,
.nova-action-row button {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    min-height: 34px;
    padding: 8px 12px;
    color: var(--nova-ai-navy);
    background: #ffffff;
    border: 1px solid var(--nova-ai-line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
}

.nova-assistant-form {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid var(--nova-ai-line);
}

.nova-assistant-input {
    width: 100%;
    min-height: 42px;
    padding: 0 13px;
    color: var(--nova-ai-text);
    background: #f8fafc;
    border: 1px solid var(--nova-ai-line);
    border-radius: 13px;
    font-size: 13px;
    outline: none;
}

.nova-assistant-input:focus {
    border-color: var(--nova-ai-blue);
    box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.12);
}

.nova-assistant-send,
.nova-assistant-mic {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #ffffff;
    background: var(--nova-ai-blue);
    border: 0;
    border-radius: 13px;
    cursor: pointer;
}

.nova-assistant-mic {
    color: var(--nova-ai-navy);
    background: #eef4fb;
    border: 1px solid var(--nova-ai-line);
}

.nova-assistant-mic.is-listening {
    color: #ffffff;
    background: #dc2626;
}

.nova-assistant-mic[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
}

@keyframes novaAssistantPulse {
    0% {
        opacity: 0.7;
        transform: scale(0.94);
    }
    100% {
        opacity: 0;
        transform: scale(1.18);
    }
}

@keyframes novaAssistantTyping {
    0%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

@media (max-width: 575.98px) {
    .nova-assistant {
        right: 12px;
        bottom: 12px;
        left: 12px;
    }

    .nova-assistant-toggle {
        margin-left: auto;
        min-width: 108px;
        min-height: 52px;
    }

    .nova-assistant-panel {
        right: 0;
        bottom: 0;
        width: 100%;
        height: min(720px, calc(100dvh - 24px));
        border-radius: 20px;
    }

    .nova-assistant-chip,
    .nova-action-row a,
    .nova-action-row button {
        flex-basis: 100%;
    }

    .nova-product-actions {
        grid-template-columns: 1fr;
    }

    .nova-product-actions .nova-full {
        grid-column: auto;
    }
}
