/**
 * FULL Ask AI - Frontend Styles v1.1
 */

.full-ask-ai {
    background: #F8F9FA;
    border: 1px solid #E9ECEF;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: relative;
}

.full-ask-ai__header {
    margin-bottom: 16px;
}

.full-ask-ai__title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.full-ask-ai__subtitle {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
}

.full-ask-ai__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Defaults das CSS variables ficam no WRAPPER (.full-ask-ai), não no botão.
   Crucial para o Elementor conseguir sobrescrever: o painel Style escreve em
   {{WRAPPER}} .full-ask-ai (mesmo seletor, especificidade maior) e a variável
   se propaga via herança para .full-ask-ai__btn que só USA a variável.
   Se as defaults ficassem no botão, ele ignoraria a herança do wrapper. */
.full-ask-ai {
    --faa-btn-bg: #FFFFFF;
    --faa-btn-color: #1a1a1a;
    --faa-btn-border: #DEE2E6;
    --faa-btn-hover-bg: #FFD910;
    --faa-btn-hover-color: #1a1a1a;
    --faa-btn-hover-border: #FFD910;
    --faa-btn-hover-shadow: 255, 217, 16;
}

.full-ask-ai__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: var(--faa-btn-bg);
    border: 1px solid var(--faa-btn-border);
    border-radius: 8px;
    color: var(--faa-btn-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1;
}

.full-ask-ai__btn:hover {
    background-color: var(--faa-btn-hover-bg);
    border-color: var(--faa-btn-hover-border);
    color: var(--faa-btn-hover-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--faa-btn-hover-shadow), 0.25);
    text-decoration: none;
}

.full-ask-ai__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.full-ask-ai__icon svg {
    /* !important + max-width/max-height protegem contra resets agressivos do
       tema do site ou do editor Elementor que sobrescrevem width/height de SVG. */
    width: 18px !important;
    height: 18px !important;
    max-width: 18px;
    max-height: 18px;
    display: block;
}

/* Regra catch-all de segurança: SVGs do plugin nunca explodem além do container,
   mesmo quando o tema do cliente tem regras como `svg { width: auto }`. */
.full-ask-ai svg,
.faa-floating svg {
    max-width: 100%;
    max-height: 100%;
}

.full-ask-ai__label {
    line-height: 1;
}

/* ==================== MICROCOPY (aviso Claude) ==================== */
.full-ask-ai__microcopy {
    font-size: 11px;
    color: #6c757d;
    font-weight: 400;
    margin-left: 4px;
    line-height: 1;
    opacity: 0.85;
}

.full-ask-ai__btn:hover .full-ask-ai__microcopy {
    color: var(--faa-btn-hover-color);
    opacity: 1;
}

/* Microcopy some em inline/minimal pra não poluir */
.full-ask-ai-inline .full-ask-ai__microcopy,
.full-ask-ai-minimal .full-ask-ai__microcopy {
    display: none;
}

/* ==================== STYLE: INLINE ==================== */
.full-ask-ai-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 20px;
}

.full-ask-ai-inline .full-ask-ai__header {
    margin-bottom: 0;
    flex-shrink: 0;
}

.full-ask-ai-inline .full-ask-ai__title {
    font-size: 15px;
    margin: 0;
}

.full-ask-ai-inline .full-ask-ai__buttons {
    flex: 1;
    min-width: 0;
}

/* ==================== STYLE: MINIMAL ==================== */
.full-ask-ai-minimal {
    background: transparent;
    border: none;
    padding: 12px 0;
}

.full-ask-ai-minimal .full-ask-ai__btn {
    padding: 8px 12px;
    font-size: 13px;
}

/* ==================== MODO STICKY ==================== */
.full-ask-ai--sticky {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    max-width: 260px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    background: #FFFFFF;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.full-ask-ai--sticky.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.full-ask-ai--sticky.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.full-ask-ai--sticky-right {
    right: 20px;
}

.full-ask-ai--sticky-left {
    left: 20px;
}

.full-ask-ai--sticky .full-ask-ai__buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.full-ask-ai--sticky .full-ask-ai__btn {
    justify-content: flex-start;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
}

.full-ask-ai--sticky .full-ask-ai__title {
    font-size: 14px;
    font-weight: 600;
}

.full-ask-ai--sticky .full-ask-ai__subtitle {
    display: none;
}

.full-ask-ai--sticky .full-ask-ai__microcopy {
    display: none;
}

.full-ask-ai__close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #adb5bd;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.full-ask-ai__close:hover {
    color: #1a1a1a;
    background: #F8F9FA;
}

/* Close button só aparece no modo sticky */
.full-ask-ai:not(.full-ask-ai--sticky) .full-ask-ai__close {
    display: none;
}

/* ==================== ÍCONES COLORIDOS ==================== */
/* Em modo colorido os SVGs já carregam fill próprio. 
   Em modo mono, o SVG herda currentColor do botão. */
.full-ask-ai--icons-colored .full-ask-ai__icon svg {
    /* Preserva as cores da marca */
}

.full-ask-ai--icons-mono .full-ask-ai__icon {
    color: currentColor;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .full-ask-ai {
        padding: 20px 16px;
    }

    .full-ask-ai__title {
        font-size: 16px;
    }

    .full-ask-ai__buttons {
        gap: 8px;
    }

    .full-ask-ai__btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .full-ask-ai__microcopy {
        display: none; /* microcopy some no mobile pra economizar espaço */
    }

    .full-ask-ai-inline {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Sticky vira barra inferior no mobile */
    .full-ask-ai--sticky {
        top: auto;
        bottom: 0;
        left: 0 !important;
        right: 0 !important;
        transform: none;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        padding: 12px 16px;
    }

    .full-ask-ai--sticky .full-ask-ai__buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .full-ask-ai--sticky .full-ask-ai__header {
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .full-ask-ai__buttons {
        width: 100%;
    }

    .full-ask-ai:not(.full-ask-ai--sticky) .full-ask-ai__btn {
        flex: 1;
        justify-content: center;
        min-width: calc(50% - 4px);
    }
}

/* ============================================================
   FLOATING MODE — FAB no canto da tela + painel deslizante
   ============================================================ */

.faa-floating {
    position: fixed;
    bottom: 24px;
    z-index: 99998;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
    line-height: 1.4;
}

.faa-floating--bottom-right { right: 24px; }
.faa-floating--bottom-left  { left: 24px; }

/* === Trigger (FAB) === */
.faa-floating__trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px 14px 16px;
    background: linear-gradient(135deg, #FF8A4C 0%, #F25E2D 100%);
    color: #fff;
    border: 0;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.08),
        0 8px 24px rgba(242, 94, 45, 0.35);
    transition: transform 180ms cubic-bezier(.16, 1, .3, 1),
                box-shadow 180ms cubic-bezier(.16, 1, .3, 1),
                opacity 180ms ease;
}

.faa-floating__trigger:hover {
    transform: translateY(-2px);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.08),
        0 12px 32px rgba(242, 94, 45, 0.45);
}

.faa-floating__trigger:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
    box-shadow:
        0 0 0 4px rgba(242, 94, 45, 0.4),
        0 8px 24px rgba(242, 94, 45, 0.35);
}

.faa-floating__trigger:active {
    transform: translateY(0);
}

.faa-floating__trigger-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
}

.faa-floating__trigger-icon svg {
    width: 100%;
    height: 100%;
}

/* Trigger fica escondido quando o painel está aberto */
.faa-floating.is-open .faa-floating__trigger {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
}

/* === Panel === */
.faa-floating__panel {
    position: absolute;
    bottom: 0;
    width: 320px;
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 12px 40px rgba(15, 23, 42, 0.16),
        0 24px 60px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    transform-origin: bottom right;
    opacity: 0;
    transform: scale(0.92) translateY(8px);
    transition: opacity 200ms cubic-bezier(.16, 1, .3, 1),
                transform 200ms cubic-bezier(.16, 1, .3, 1);
    pointer-events: none;
}

.faa-floating--bottom-left .faa-floating__panel {
    transform-origin: bottom left;
    left: 0;
}

.faa-floating--bottom-right .faa-floating__panel {
    right: 0;
}

.faa-floating.is-open .faa-floating__panel {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.faa-floating__panel[hidden] {
    display: none;
}

/* === Panel Header === */
.faa-floating__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.faa-floating__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #0F172A;
    line-height: 1.3;
}

.faa-floating__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    color: #64748B;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}

.faa-floating__close:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.faa-floating__close:focus-visible {
    outline: 2px solid #F25E2D;
    outline-offset: 2px;
}

.faa-floating__close svg {
    width: 16px;
    height: 16px;
}

/* === List === */
.faa-floating__list {
    list-style: none;
    margin: 0;
    padding: 6px;
}

.faa-floating__item {
    margin: 0;
}

.faa-floating__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #0F172A;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 120ms ease, transform 120ms ease;
}

.faa-floating__link:hover {
    background: #F8FAFC;
    transform: translateX(2px);
}

.faa-floating__link:focus-visible {
    outline: 2px solid #F25E2D;
    outline-offset: -1px;
}

.faa-floating__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #F8FAFC;
    overflow: hidden;
}

.faa-floating__icon svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px;
    max-height: 20px;
}

.faa-floating__label {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.faa-floating__microcopy {
    font-size: 11px;
    font-weight: 400;
    color: #94A3B8;
    line-height: 1.2;
}

.faa-floating__arrow {
    flex-shrink: 0;
    color: #CBD5E1;
    font-size: 16px;
    transition: transform 120ms ease, color 120ms ease;
}

.faa-floating__link:hover .faa-floating__arrow {
    color: #F25E2D;
    transform: translateX(2px);
}

/* === Mobile === */
@media (max-width: 480px) {
    .faa-floating {
        bottom: 16px;
    }

    .faa-floating--bottom-right { right: 16px; }
    .faa-floating--bottom-left  { left: 16px; }

    .faa-floating__trigger {
        padding: 12px 18px 12px 14px;
        font-size: 14px;
    }

    .faa-floating__panel {
        width: calc(100vw - 32px);
        max-width: 360px;
    }
}

/* === Reduce motion === */
@media (prefers-reduced-motion: reduce) {
    .faa-floating__trigger,
    .faa-floating__panel,
    .faa-floating__link,
    .faa-floating__arrow {
        transition: none !important;
    }
}
