/* ── PriA Chatbot v1.1.0 — Nuevos colores corporativos ── */
:root {
    --pria-red:      #AE4966;
    --pria-blue:     #1F71B3;
    --pria-light:    #96BCDB;
    --pria-gradient: linear-gradient(135deg, #AE4966 0%, #1F71B3 100%);
    --pria-bg:       #ffffff;
    --pria-border:   #e0d0da;
    --pria-text:     #1e1e1e;
    --pria-bot-bg:   #f5f0f5;
    --pria-shadow:   0 12px 40px rgba(174,73,102,.18);
    --pria-radius:   16px;
    --pria-font:     -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Burbuja ── */
#pria-root.pria-bubble { position: fixed; bottom: 28px; right: 28px; z-index: 99999; font-family: var(--pria-font); }
#pria-toggle { width: 64px; height: 64px; border-radius: 50%; background: var(--pria-gradient); border: 3px solid #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--pria-shadow); transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s; padding: 0; overflow: hidden; position: relative; }
#pria-toggle:hover { transform: scale(1.1); box-shadow: 0 16px 48px rgba(174,73,102,.3); }
#pria-toggle img   { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#pria-toggle::after { content: ''; position: absolute; bottom: 3px; right: 3px; width: 13px; height: 13px; background: #22c55e; border-radius: 50%; border: 2px solid #fff; }

/* ── Panel ── */
#pria-panel { width: 460px; height: 700px; background: var(--pria-bg); border-radius: var(--pria-radius); box-shadow: var(--pria-shadow); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--pria-border); margin-bottom: 16px; animation: pria-slideup .3s cubic-bezier(.34,1.56,.64,1); }
#pria-panel[hidden] { display: none; }
@keyframes pria-slideup { from { opacity: 0; transform: translateY(20px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
#pria-root.pria-inline #pria-panel { position: static; width: 100%; height: 680px; margin-bottom: 0; animation: none; }

/* ── Header ── */
#pria-header { background: var(--pria-gradient); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#pria-header-avatar { width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); object-fit: cover; flex-shrink: 0; }
#pria-header-info   { flex: 1; }
#pria-header-name   { font-weight: 700; font-size: 15px; line-height: 1.2; }
#pria-header-status { font-size: 11px; opacity: .85; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
#pria-header-status::before { content: ''; width: 7px; height: 7px; background: #86efac; border-radius: 50%; display: inline-block; }
#pria-close { background: rgba(255,255,255,.2); border: none; color: #fff; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: background .2s; flex-shrink: 0; }
#pria-close:hover { background: rgba(255,255,255,.35); }

/* ── Categorías ── */
#pria-categories { padding: 10px 12px 8px; border-bottom: 1px solid var(--pria-border); background: #f8f5f8; flex-shrink: 0; }
#pria-categories-label { font-size: 10.5px; color: #8a6070; margin-bottom: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; justify-content: space-between; }
#pria-categories-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.pria-cat-btn { background: #fff; border: 1.5px solid var(--pria-border); border-radius: 20px; padding: 5px 11px; font-size: 12px; font-family: var(--pria-font); color: #6a3050; cursor: pointer; transition: all .2s; white-space: nowrap; }
.pria-cat-btn:hover  { border-color: #AE4966; color: #AE4966; background: #f5f0f2; }
.pria-cat-btn.active { background: var(--pria-gradient); border-color: transparent; color: #fff; font-weight: 600; }
#pria-cat-reset { background: none; border: none; font-size: 11px; color: #b899a8; cursor: pointer; padding: 2px 6px; border-radius: 10px; transition: color .2s; }
#pria-cat-reset:hover { color: #AE4966; }
#pria-cat-reset[hidden] { display: none; }

/* ── Mensajes ── */
#pria-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
#pria-messages::-webkit-scrollbar { width: 4px; }
#pria-messages::-webkit-scrollbar-thumb { background: #d4b0be; border-radius: 4px; }
.pria-msg-wrapper       { display: flex; gap: 8px; align-items: flex-end; }
.pria-msg-wrapper.user  { flex-direction: row-reverse; }
.pria-msg-avatar        { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--pria-border); }
.pria-msg               { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; }
.pria-msg-wrapper.bot .pria-msg  { background: var(--pria-bot-bg); color: var(--pria-text); border-bottom-left-radius: 4px; border: 1px solid var(--pria-border); }
.pria-msg-wrapper.user .pria-msg { background: var(--pria-gradient); color: #fff; border-bottom-right-radius: 4px; }
.pria-msg.error { background: #fce8ed; color: #8a1540; font-size: 12px; border: 1px solid #f9c0ce; max-width: 92%; }
.pria-typing { display: flex; gap: 5px; padding: 12px 14px; align-items: center; }
.pria-typing span { width: 7px; height: 7px; background: #AE4966; border-radius: 50%; animation: pria-bounce .9s infinite; opacity: .45; }
.pria-typing span:nth-child(2) { animation-delay: .15s; }
.pria-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes pria-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-6px); opacity: 1; } }
.pria-welcome      { background: linear-gradient(135deg,#f5f0f2,#f0f5fa); border: 1px solid #e0d0da; border-radius: 14px; padding: 14px 16px; font-size: 13.5px; line-height: 1.65; color: var(--pria-text); }
.pria-welcome-name { color: #AE4966; font-size: 16px; font-weight: 700; display: block; margin-bottom: 6px; }

/* ── Footer ── */
#pria-footer  { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--pria-border); background: #f8f5f8; align-items: flex-end; flex-shrink: 0; }
#pria-input   { flex: 1; resize: none; border: 1.5px solid #d4b0be; border-radius: 10px; padding: 9px 12px; font-size: 13px; font-family: var(--pria-font); color: var(--pria-text); outline: none; background: #fff; transition: border-color .2s; }
#pria-input:focus        { border-color: #AE4966; }
#pria-input::placeholder { color: #b899a8; }
#pria-send { background: var(--pria-gradient); color: #fff; border: none; border-radius: 10px; width: 42px; height: 42px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: opacity .2s, transform .15s; flex-shrink: 0; }
#pria-send svg      { width: 18px; height: 18px; fill: white; }
#pria-send:hover    { opacity: .88; transform: scale(1.05); }
#pria-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }
#pria-usage { text-align: center; font-size: 10.5px; color: #b899a8; padding: 4px 12px 8px; background: #f8f5f8; flex-shrink: 0; }

/* ── Botones nivel 1 ── */
.pria-nivel1-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pria-n1-btn { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--pria-border); border-radius: 12px; padding: 10px 14px; font-family: var(--pria-font); cursor: pointer; text-align: left; transition: all .2s; width: 100%; }
.pria-n1-btn:hover { border-color: #AE4966; background: #f5f0f2; }
.pria-n1-icon { font-size: 20px; flex-shrink: 0; }
.pria-n1-txt  { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: #2a1030; line-height: 1.3; }
.pria-n1-txt small { font-weight: 400; font-size: 11px; color: #8a6070; margin-top: 2px; }
.pria-subcats-inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pria-back-btn { background: none; border: none; font-size: 11px; color: #8a6070; cursor: pointer; padding: 6px 0 0; display: block; margin-top: 8px; font-family: var(--pria-font); transition: color .2s; }
.pria-back-btn:hover { color: #AE4966; }

/* ── Nueva conversación ── */
#pria-nueva-conv { display: block; width: calc(100% - 24px); margin: 0 12px 8px; background: none; border: 1.5px solid var(--pria-border); border-radius: 8px; padding: 6px 12px; font-size: 11.5px; font-family: var(--pria-font); color: #8a6070; cursor: pointer; text-align: center; transition: all .2s; }
#pria-nueva-conv:hover { border-color: #AE4966; color: #AE4966; background: #f5f0f2; }

/* ── Botón externo para abrir PriA (shortcode [pria_boton]) ── */
.pria-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #AE4966 0%, #1F71B3 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(174,73,102,.3);
    transition: transform .2s, box-shadow .2s, opacity .2s;
    text-decoration: none;
}
.pria-open-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(174,73,102,.4); opacity: .92; color: #fff; }
.pria-open-btn:active { transform: translateY(0); }

/* ── Responsive ── */
@media (max-width: 480px) {
    #pria-panel { width: calc(100vw - 24px); height: 85vh; }
    #pria-root.pria-bubble { right: 12px; bottom: 12px; }
}
