/**
 * FSC Store Assistant — Estilos v2.0
 * Sem dependência de tema. Zero conflito com FSCFilterVitrine.
 */

:root {
    --fsc-ast-primary:   #6d28d9;
    --fsc-ast-dark:      #5b21b6;
    --fsc-ast-light:     #ede9fe;
    --fsc-ast-text:      #1f2937;
    --fsc-ast-muted:     #6b7280;
    --fsc-ast-border:    #e5e7eb;
    --fsc-ast-bg:        #ffffff;
    --fsc-ast-panel-w:   340px;
    --fsc-ast-panel-h:   440px;
    --fsc-ast-btn:       52px;
    --fsc-ast-gap:       18px;
    --fsc-ast-z:         9990;
    --fsc-ast-radius:    12px;
    --fsc-ast-shadow:    0 8px 30px rgba(0,0,0,.18);
}

/* ── Wrap ── */
#fsc-ast-wrap {
    position: fixed;
    bottom: var(--fsc-ast-gap);
    right:  var(--fsc-ast-gap);
    z-index: var(--fsc-ast-z);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
#fsc-ast-wrap *, #fsc-ast-wrap *::before, #fsc-ast-wrap *::after {
    box-sizing: border-box;
}

/* ── Botão flutuante ── */
#fsc-ast-toggle {
    display:         flex;
    align-items:     center;
    justify-content: center;
    width:           var(--fsc-ast-btn);
    height:          var(--fsc-ast-btn);
    background:      var(--fsc-ast-primary);
    color:           #fff;
    border:          none;
    border-radius:   50%;
    cursor:          pointer;
    box-shadow:      var(--fsc-ast-shadow);
    transition:      background .2s, transform .2s;
}
#fsc-ast-toggle:hover  { background: var(--fsc-ast-dark); transform: scale(1.06); }
#fsc-ast-toggle:active { transform: scale(.97); }
#fsc-ast-toggle:focus-visible { outline: 3px solid var(--fsc-ast-primary); outline-offset: 3px; }

/* ── Painel ── */
#fsc-ast-panel {
    position:       absolute;
    bottom:         calc(var(--fsc-ast-btn) + 10px);
    right:          0;
    width:          var(--fsc-ast-panel-w);
    height:         var(--fsc-ast-panel-h);
    background:     var(--fsc-ast-bg);
    border:         1px solid var(--fsc-ast-border);
    border-radius:  var(--fsc-ast-radius);
    box-shadow:     var(--fsc-ast-shadow);
    display:        flex;
    flex-direction: column;
    overflow:       hidden;
    animation:      fscAstSlideIn .22s ease;
}
#fsc-ast-panel[hidden] { display: none; }

@keyframes fscAstSlideIn {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ── */
#fsc-ast-header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         11px 14px;
    background:      var(--fsc-ast-primary);
    color:           #fff;
    font-weight:     600;
    font-size:       13.5px;
    flex-shrink:     0;
}
#fsc-ast-close {
    background: transparent;
    border:     none;
    color:      #fff;
    font-size:  20px;
    line-height: 1;
    cursor:     pointer;
    padding:    0 3px;
    border-radius: 4px;
    transition: background .15s;
}
#fsc-ast-close:hover { background: rgba(255,255,255,.2); }

/* ── Mensagens ── */
#fsc-ast-messages {
    flex:       1;
    overflow-y: auto;
    padding:    12px 12px 6px;
    display:    flex;
    flex-direction: column;
    gap:        8px;
    scroll-behavior: smooth;
}
#fsc-ast-messages::-webkit-scrollbar       { width: 3px; }
#fsc-ast-messages::-webkit-scrollbar-thumb { background: var(--fsc-ast-border); border-radius: 2px; }

.fsc-ast-msg {
    max-width:     86%;
    padding:       8px 12px;
    border-radius: var(--fsc-ast-radius);
    font-size:     13px;
    line-height:   1.55;
    word-break:    break-word;
}
.fsc-ast-msg--user {
    align-self: flex-end;
    background: var(--fsc-ast-primary);
    color:      #fff;
    border-bottom-right-radius: 3px;
}
.fsc-ast-msg--bot {
    align-self: flex-start;
    background: var(--fsc-ast-light);
    color:      var(--fsc-ast-text);
    border-bottom-left-radius: 3px;
}

/* Digitando */
.fsc-ast-typing {
    display:     flex;
    align-items: center;
    gap:         5px;
    padding:     10px 14px;
}
.fsc-ast-typing span {
    width:         7px;
    height:        7px;
    background:    var(--fsc-ast-primary);
    border-radius: 50%;
    animation:     fscAstBounce 1s infinite ease-in-out;
    opacity:       .5;
}
.fsc-ast-typing span:nth-child(2) { animation-delay: .15s; }
.fsc-ast-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes fscAstBounce {
    0%,80%,100% { transform: translateY(0);    opacity: .4; }
    40%          { transform: translateY(-6px); opacity: 1;  }
}

/* ── Footer ── */
#fsc-ast-footer {
    display:     flex;
    align-items: flex-end;
    gap:         7px;
    padding:     9px 10px;
    border-top:  1px solid var(--fsc-ast-border);
    flex-shrink: 0;
}
#fsc-ast-input {
    flex:          1;
    resize:        none;
    border:        1px solid var(--fsc-ast-border);
    border-radius: 8px;
    padding:       7px 9px;
    font-size:     13px;
    font-family:   inherit;
    line-height:   1.5;
    color:         var(--fsc-ast-text);
    background:    var(--fsc-ast-bg);
    outline:       none;
    max-height:    80px;
    overflow-y:    auto;
    transition:    border-color .15s;
}
#fsc-ast-input:focus { border-color: var(--fsc-ast-primary); box-shadow: 0 0 0 3px rgba(109,40,217,.1); }
#fsc-ast-input::placeholder { color: var(--fsc-ast-muted); font-style: italic; }

#fsc-ast-send {
    display:     flex;
    align-items: center;
    gap:         5px;
    padding:     8px 12px;
    background:  var(--fsc-ast-primary);
    color:       #fff;
    border:      none;
    border-radius: 8px;
    font-size:   13px;
    font-weight: 600;
    cursor:      pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition:  background .15s;
}
#fsc-ast-send:hover:not(:disabled) { background: var(--fsc-ast-dark); }
#fsc-ast-send:disabled,
#fsc-ast-input:disabled { opacity: .55; cursor: not-allowed; }
#fsc-ast-send:focus-visible { outline: 3px solid var(--fsc-ast-primary); outline-offset: 2px; }

/* ── Mobile ── */
@media (max-width: 480px) {
    :root {
        --fsc-ast-panel-w: calc(100vw - 20px);
        --fsc-ast-gap:     10px;
    }
}
