/* ============================================================
   AI Chatbot — All layout/positioning done via JS inline styles
   This CSS handles only appearance (colors, fonts, animations)
   ============================================================ */

/* ── Panel ── */
#wcpffw-panel {
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 110px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 6px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: wcpffw-pop 0.25s ease both;
}
@keyframes wcpffw-pop {
    from { opacity:0; transform: translateY(12px) scale(0.97); }
    to   { opacity:1; transform: translateY(0)  scale(1); }
}

/* ── Header ── */
#wcpffw-head {
    background: linear-gradient(135deg, var(--wcpffw-color, #2563eb), #1d4ed8);
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.wcpffw-head-left { display:flex; align-items:center; gap:10px; }
.wcpffw-ava {
    width:38px; height:38px; border-radius:50%;
    background:rgba(255,255,255,0.18);
    display:flex; align-items:center; justify-content:center;
    position:relative; flex-shrink:0;
}
.wcpffw-dot {
    position:absolute; bottom:1px; right:1px;
    width:10px; height:10px;
    background:#22c55e; border-radius:50%; border:2px solid white;
}
.wcpffw-hname { color:#fff; font-weight:700; font-size:14.5px; line-height:1.2; }
.wcpffw-hsub  { color:rgba(255,255,255,0.72); font-size:11px; margin-top:1px; }
.wcpffw-head-right { display:flex; gap:4px; }
#wcpffw-head button {
    width:30px; height:30px; border-radius:7px;
    background:rgba(255,255,255,0.15); color:rgba(255,255,255,0.9);
    border:none; cursor:pointer;  align-items:center; justify-content:center; padding: 0;
}
#wcpffw-head button:hover { background:rgba(255,255,255,0.28); }

/* ── Messages ── */
#wcpffw-msgs {
    flex:1; overflow-y:auto; padding:14px;
    display:flex; flex-direction:column; gap:10px;
    background:#f8fafc;
}
#wcpffw-msgs::-webkit-scrollbar { width:3px; }
#wcpffw-msgs::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:2px; }

.am { display:flex; gap:8px; max-width:90%; animation: wcpffw-in 0.25s ease both; }
@keyframes wcpffw-in { from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none} }

.au { align-self:flex-end; flex-direction:row-reverse; }
.ab-wrap { align-self:flex-start; }

.aa {
    width:26px; height:26px; border-radius:50%;
    background:var(--wcpffw-color,#2563eb);
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0; margin-top:2px;
}
.ab-inner { display:flex; flex-direction:column; gap:6px; }

.ab {
    padding:9px 13px; border-radius:16px;
    font-size:13.5px; line-height:1.55; word-break:break-word;
    font-family:inherit;
}
.ab-wrap .ab, .ab-inner .ab {
    background:#fff; color:#1e293b;
    border-bottom-left-radius:5px;
    border:1px solid #e2e8f0;
    box-shadow:0 1px 3px rgba(0,0,0,0.06);
}
.au .ab {
    background:var(--wcpffw-color,#2563eb); color:#fff;
    border-bottom-right-radius:5px;
}

/* Typing dots */
.atd { display:flex; gap:4px; align-items:center; height:14px; padding:2px 0; }
.atd span {
    width:6px; height:6px; border-radius:50%;
    background:#94a3b8; animation:wcpffw-dot 1.1s infinite ease-in-out;
}
.atd span:nth-child(2){animation-delay:.18s}
.atd span:nth-child(3){animation-delay:.36s}
@keyframes wcpffw-dot {
    0%,60%,100%{transform:translateY(0);opacity:.4}
    30%{transform:translateY(-4px);opacity:1}
}

/* ── Product grid ── */
.apg { display:grid; grid-template-columns:1fr 1fr; gap:7px; max-width:320px; }
.apc {
    background:#fff; border:1px solid #e2e8f0; border-radius:11px;
    overflow:hidden; text-decoration:none !important; color:inherit;
    display:flex; flex-direction:column;
    transition:transform .18s,box-shadow .18s;
}
.apc:hover { transform:translateY(-2px); box-shadow:0 6px 18px rgba(0,0,0,0.1); }
.apc.aoo { opacity:.6; }
.api { position:relative; aspect-ratio:1; background:#f1f5f9; overflow:hidden; }
.api img { width:100%; height:100%; object-fit:cover; }
.asl {
    position:absolute; top:5px; left:5px;
    background:#ef4444; color:#fff;
    font-size:9px; font-weight:700; padding:2px 5px; border-radius:3px;
    text-transform:uppercase; letter-spacing:.4px;
}
.apb { padding:7px; flex:1; display:flex; flex-direction:column; gap:3px; }
.apn {
    font-size:12px; font-weight:600; color:#1e293b; line-height:1.3;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.aps { color:#f59e0b; font-size:10px; }
.app { font-size:12.5px; font-weight:700; color:var(--wcpffw-color,#2563eb); margin-top:auto; }
.apf { padding:5px 7px; border-top:1px solid #e2e8f0; display:flex; gap:4px; }
.apv, .apc2 {
    flex:1; padding:4px 3px; border-radius:5px;
    font-size:10.5px; font-weight:600; text-align:center;
    text-decoration:none !important; border:none; cursor:pointer;
    display:block; line-height:1.4; font-family:inherit;
}
.apv { background:#f1f5f9; color:#334155; border:1px solid #e2e8f0 !important; }
.apv:hover { background:#e2e8f0; }
.apc2 { background:var(--wcpffw-color,#2563eb); color:#fff; }
.apc2:hover { opacity:.88; }
.afu {
    padding:7px 11px; background:#dbeafe; border-radius:9px;
    border-left:3px solid var(--wcpffw-color,#2563eb);
    font-size:12.5px; color:#1e40af; line-height:1.4;
}

/* ── Chips ── */
#wcpffw-chips {
    padding:7px 11px 4px;
    display:flex; flex-wrap:wrap; gap:5px;
    border-top:1px solid #e2e8f0; background:#fff; flex-shrink:0;
}
.wcpffw-chip {
    padding:4px 11px; background:#f8fafc;
    border:1px solid #e2e8f0; border-radius:20px;
    font-size:11.5px; color:#64748b; cursor:pointer;
    white-space:nowrap; font-family:inherit;
    transition:all .15s;
}
.wcpffw-chip:hover { background:#dbeafe; color:#1d4ed8; border-color:var(--wcpffw-color,#2563eb); }

/* ── Input ── */
#wcpffw-foot {
    padding:10px 11px 8px;
    border-top:1px solid #e2e8f0;
    background:#fff; flex-shrink:0;
}
#wcpffw-input-row {
    display:flex; align-items:flex-end; gap:7px;
    background:#f8fafc; border:1.5px solid #e2e8f0;
    border-radius:13px; padding:7px 7px 7px 13px;
    transition:border-color .2s,box-shadow .2s;
}
#wcpffw-input-row:focus-within {
    border-color:var(--wcpffw-color,#2563eb);
    box-shadow:0 0 0 3px rgba(37,99,235,.1);
}
#wcpffw-txt {
    flex:1; border:none; background:transparent;
    font-size:13.5px; line-height:1.5; color:#1e293b;
    resize:none; font-family:inherit;
    max-height:90px; overflow-y:auto; outline:none;
}
#wcpffw-txt::placeholder { color:#94a3b8; }
#wcpffw-send {
    width:34px; height:34px; border-radius:9px;
    background:var(--wcpffw-color,#2563eb); color:#fff;
    border:none; cursor:pointer; flex-shrink:0;
    align-items:center; justify-content:center;
    transition:opacity .15s;padding: 0;
}
#wcpffw-send:disabled { opacity:.35; cursor:not-allowed; }
#wcpffw-send:not(:disabled):hover { opacity:.85; }
#wcpffw-powered { font-size:10px; color:#94a3b8; text-align:center; margin:5px 0 0; }

/* ── Badge on toggle ── */
#wcpffw-badge {
    position:absolute; top:-3px; right:-3px;
    width:18px; height:18px; border-radius:50%;
    background:#ef4444; color:#fff;
    font-size:10px; font-weight:700;
    display:none; align-items:center; justify-content:center;
    border:2px solid #fff; font-family:inherit;
    pointer-events:none;
}

/* ── Mobile ── */
@media(max-width:480px){
    #wcpffw-panel{
        width:calc(100vw - 20px);
        height:68vh;
        border-radius:14px 14px 4px 4px;
    }
}
