/* ── Pedir Chat Widget ────────────────────────────────────── */
.pf-chat {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,.15);
    overflow: hidden;
    background: #fff;
}

/* ── Header ──────────────────────────────────────────────── */
.pf-chat__header {
    background: #1a1a2e;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.pf-chat__header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg,var(--pf-accent, #6366f1),#8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.2);
}
.pf-chat__header-info {}
.pf-chat__header-name {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}
.pf-chat__header-status {
    font-size: 12px;
    color: #6ee7b7;
    margin-top: 2px;
}

/* ── Body / messages ─────────────────────────────────────── */
.pf-chat__body {
    background: #f4f5f7;
    padding: 20px 16px;
    height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.pf-chat__body::-webkit-scrollbar { width: 4px; }
.pf-chat__body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* ── Message row ─────────────────────────────────────────── */
.pf-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: pfMsgIn .22s ease;
}
@keyframes pfMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pf-msg--bot  { align-self: flex-start; max-width: 85%; }
.pf-msg--user { align-self: flex-end; flex-direction: row-reverse; max-width: 80%; }

/* Bot avatar */
.pf-msg__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg,var(--pf-accent, #6366f1),#8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
}

/* Bubble */
.pf-msg__bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
}
.pf-msg--bot .pf-msg__bubble {
    background: #fff;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.pf-msg--user .pf-msg__bubble {
    background: var(--pf-accent, #6366f1);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* ── Typing dots ─────────────────────────────────────────── */
.pf-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 2px 0;
}
.pf-typing-dots span {
    width: 7px;
    height: 7px;
    background: #9ca3af;
    border-radius: 50%;
    animation: pfDot 1.2s infinite;
}
.pf-typing-dots span:nth-child(2) { animation-delay: .2s; }
.pf-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes pfDot {
    0%,60%,100% { transform: translateY(0);   opacity: .4; }
    30%          { transform: translateY(-5px); opacity: 1; }
}

/* ── Chips ───────────────────────────────────────────────── */
.pf-chat__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px 0;
    animation: pfMsgIn .28s ease;
}
.pf-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--pf-accent, #6366f1);
    background: #fff;
    color: var(--pf-accent, #6366f1);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    font-family: inherit;
}
.pf-chip:hover              { background: var(--pf-accent, #6366f1); color: #fff; transform: translateY(-1px); }
.pf-chip--yes               { background: var(--pf-accent, #6366f1); color: #fff; }
.pf-chip--yes:hover         { background: var(--pf-accent, #4f46e5); border-color: var(--pf-accent, #4f46e5); }
.pf-chip--no                { border-color: #d1d5db; color: #6b7280; }
.pf-chip--no:hover          { border-color: #9ca3af; background: #f9fafb; color: #374151; transform: none; }

/* ── Footer / input ──────────────────────────────────────── */
.pf-chat__footer {
    background: #fff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #e5e7eb;
}
.pf-chat__skip {
    padding: 7px 12px;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    color: #6b7280;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.pf-chat__skip:hover { border-color: #9ca3af; color: #374151; background: #f9fafb; }
.pf-chat__input {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 9px 16px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
    min-width: 0;
}
.pf-chat__input:focus    { border-color: var(--pf-accent, #6366f1); }
.pf-chat__input:disabled { background: #f9fafb; color: #9ca3af; }
.pf-chat__send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--pf-accent, #6366f1);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .1s;
    flex-shrink: 0;
}
.pf-chat__send:hover    { background: var(--pf-accent, #4f46e5); transform: scale(1.05); }
.pf-chat__send:disabled { background: #d1d5db; cursor: not-allowed; transform: none; }

/* ── Brand footer ────────────────────────────────────────── */
.pf-chat__brand {
    background: #fff;
    text-align: center;
    padding: 6px 14px;
    font-size: 11px;
    color: #c0c4cc;
    border-top: 1px solid #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    letter-spacing: .2px;
}
.pf-chat__brand svg { opacity: .5; flex-shrink: 0; }
.pf-chat__brand a { color: #a0a8b8; text-decoration: none; }
.pf-chat__brand a:hover { color: var(--pf-accent, #6366f1); }

/* ── Floating wrapper ─────────────────────────────────────── */
.pf-chat-float-wrap {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    left: auto !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 14px !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pf-chat--float {
    width: 360px !important;
    max-width: calc(100vw - 48px) !important;
    margin: 0 !important;
    border-radius: 20px !important;
    display: none;
    box-shadow: 0 12px 48px rgba(0,0,0,.2) !important;
    overflow: hidden !important;
}

.pf-chat--float.pf-chat--open {
    display: flex !important;
    flex-direction: column !important;
    animation: pfFloatIn .28s ease forwards;
}

@keyframes pfFloatIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pf-chat--float .pf-chat__body { height: 360px !important; }

/* ── Float close button ───────────────────────────────────── */
.pf-chat--float .pf-chat__header {
    position: relative !important;
    padding-right: 48px !important;
}
.pf-chat__close {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    background: rgba(255,255,255,.18) !important;
    border: none !important;
    color: #fff !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 15px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background .15s;
    line-height: 1 !important;
    font-family: inherit !important;
    z-index: 1 !important;
}
.pf-chat__close:hover { background: rgba(255,255,255,.35) !important; }

/* ── Bubble button ────────────────────────────────────────── */
.pf-chat-bubble {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--pf-accent, #6366f1);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(99,102,241,.55);
    transition: transform .2s, box-shadow .2s, background .15s;
    flex-shrink: 0;
    position: relative;
}
.pf-chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(99,102,241,.65);
}
.pf-chat-bubble--active { background: var(--pf-accent, #4f46e5); }

/* Pulsing ring when chat is closed (attention grabber) */
.pf-chat-bubble:not(.pf-chat-bubble--active)::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(99,102,241,.35);
    animation: pfPulse 2.2s ease-out infinite;
    pointer-events: none;
}
@keyframes pfPulse {
    0%   { transform: scale(1);   opacity: .8; }
    100% { transform: scale(1.7); opacity: 0;  }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 520px) {
    .pf-chat { border-radius: 12px; }
    .pf-chat__body { height: 360px; }
    .pf-chat-float-wrap { bottom: 16px !important; right: 16px !important; }
    .pf-chat--float { width: calc(100vw - 32px) !important; }
}
