/* =========================================================
   PrimePro AI Chat Widget — scoped under #pp-chat-widget
   Dark, brand-gradient popup (cyan → violet → pink) styled
   after the "Ask Husky" reference pattern, adapted to
   PrimePro's own colors. Sits above the existing
   floating-contact-bar (WhatsApp / Call round buttons).
   ========================================================= */

#pp-chat-widget,
#pp-chat-widget *,
#pp-chat-widget *::before,
#pp-chat-widget *::after {
    box-sizing: border-box;
}

#pp-chat-widget {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 2400;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Launcher pill ---------- */
#pp-chat-launcher {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1b1030 0%, #120b22 100%);
    border: 1px solid rgba(122, 92, 255, 0.45);
    color: #fff;
    padding: 8px 16px 8px 8px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(20, 8, 45, 0.45), 0 0 0 4px rgba(122, 92, 255, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#pp-chat-launcher:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 44px rgba(20, 8, 45, 0.55), 0 0 0 5px rgba(122, 92, 255, 0.14);
}

#pp-chat-launcher .pp-launcher-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00e5ff, #7a5cff 55%, #ff4d8d);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 2.5px;
}

#pp-chat-launcher .pp-launcher-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    padding: 4px;
}

#pp-chat-launcher .pp-status-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22d67a;
    border: 2px solid #120b22;
}

#pp-chat-launcher .pp-launcher-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    text-align: left;
}

#pp-chat-launcher .pp-launcher-text strong {
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

#pp-chat-launcher .pp-launcher-text small {
    font-size: 11px;
    color: #b9aef0;
    font-weight: 600;
}

@keyframes pp-pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(122, 92, 255, 0.5);
    }

    100% {
        box-shadow: 0 0 0 12px rgba(122, 92, 255, 0);
    }
}

#pp-chat-launcher .pp-launcher-avatar::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    animation: pp-pulse-ring 2.4s ease-out infinite;
    pointer-events: none;
}

#pp-chat-widget.pp-open #pp-chat-launcher {
    display: none;
}

/* ---------- Panel ---------- */
#pp-chat-panel {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 360px;
    max-width: calc(100vw - 28px);
    max-height: min(600px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    background: radial-gradient(140% 100% at 0% 0%, #241540 0%, #150c28 45%, #0c0817 100%);
    border: 1px solid rgba(148, 121, 255, 0.35);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(8, 4, 20, 0.55);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

#pp-chat-widget.pp-open #pp-chat-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.pp-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 18px 16px;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.14), rgba(122, 92, 255, 0.14), rgba(255, 77, 141, 0.14));
    border-bottom: 1px solid rgba(148, 121, 255, 0.25);
}

.pp-header-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pp-avatar {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex-shrink: 0;
    padding: 2.5px;
    background: linear-gradient(135deg, #00e5ff, #7a5cff 55%, #ff4d8d);
}

.pp-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    padding: 4px;
}

.pp-msg-avatar {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    padding: 2px;
    background: linear-gradient(135deg, #00e5ff, #7a5cff 55%, #ff4d8d);
}

.pp-msg-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    padding: 3px;
}

.pp-status-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22d67a;
    border: 2px solid #1b1030;
}

.pp-header-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.pp-badge {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #e7defe;
    background: rgba(148, 121, 255, 0.22);
    border: 1px solid rgba(148, 121, 255, 0.5);
    padding: 2px 8px;
    border-radius: 20px;
}

.pp-header-sub {
    font-size: 12.5px;
    color: #b9aef0;
    margin-top: 3px;
}

#pp-chat-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

#pp-chat-close:hover {
    background: rgba(255, 255, 255, 0.14);
}

.pp-panel-body {
    padding: 16px 18px 18px;
    overflow-y: auto;
}

.pp-hidden {
    display: none !important;
}

.pp-greeting-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.pp-greeting-sub {
    font-size: 12.5px;
    color: #a79cd6;
    line-height: 1.55;
    margin-bottom: 16px;
}

/* ---------- Option rows ---------- */
.pp-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    padding: 12px 12px;
    margin-bottom: 10px;
    text-decoration: none;
    cursor: pointer;
    color: #fff;
    font-family: inherit;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.pp-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 121, 255, 0.5);
    transform: translateY(-1px);
}

.pp-option-primary {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.16), rgba(122, 92, 255, 0.16));
    border-color: rgba(148, 121, 255, 0.4);
}

.pp-option-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.pp-icon-sparkle {
    background: linear-gradient(135deg, #7a5cff, #4f46e5);
}

.pp-icon-live {
    background: linear-gradient(135deg, #22d3ee, #0284c7);
}

.pp-icon-demo {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
}

.pp-icon-phone {
    background: linear-gradient(135deg, #34d399, #059669);
}

.pp-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.pp-option-text strong {
    font-size: 13.5px;
    font-weight: 700;
}

.pp-option-text small {
    font-size: 11.5px;
    color: #a79cd6;
}

.pp-option-arrow {
    font-size: 18px;
    color: #a79cd6;
    flex-shrink: 0;
}

.pp-option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.pp-option-sm {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 0;
}

.pp-option-sm strong {
    font-size: 13px;
    font-weight: 700;
}

.pp-option-sm small {
    font-size: 11px;
    color: #a79cd6;
}

.pp-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 12px 0 14px;
}

.pp-whatsapp-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 13.5px;
    box-shadow: 0 10px 26px rgba(37, 211, 102, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pp-whatsapp-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(37, 211, 102, 0.36);
}

.pp-whatsapp-cta svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* ---------- Ask PrimePro chat sub-view ---------- */
.pp-msg-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.pp-msg-bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.55;
    color: #ece7fb;
}

.pp-quick-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.pp-chip {
    display: block;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 11px 14px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.pp-chip:hover {
    background: rgba(148, 121, 255, 0.16);
    border-color: rgba(148, 121, 255, 0.5);
    transform: translateX(3px);
}

.pp-ask-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    padding: 6px 6px 6px 16px;
    margin-bottom: 14px;
}

.pp-ask-input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
}

.pp-ask-input::placeholder {
    color: #8b7fc0;
}

.pp-ask-send {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7a5cff, #4f46e5);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.pp-ask-send svg {
    width: 15px;
    height: 15px;
    fill: #fff;
}

.pp-quicklinks {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11.5px;
    color: #a79cd6;
    margin-bottom: 4px;
}

.pp-quicklinks a {
    color: #d8d0ff;
    text-decoration: none;
    font-weight: 600;
}

.pp-quicklinks a:hover {
    color: #fff;
}

.pp-quicklinks .pp-ql-sep {
    color: #4c4470;
}

/* ---------- Call sub-view ---------- */
.pp-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #b9aef0;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0 12px;
    font-family: inherit;
}

.pp-back:hover {
    color: #fff;
}

.pp-call-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pp-call-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    text-decoration: none;
    color: #fff;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.pp-call-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 121, 255, 0.5);
    transform: translateY(-1px);
}

.pp-flag {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.pp-call-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.pp-call-text strong {
    font-size: 13px;
    font-weight: 700;
}

.pp-call-text small {
    font-size: 12.5px;
    color: #a79cd6;
    font-weight: 600;
}

.pp-call-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.pp-call-icon svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.pp-call-row.pp-us .pp-call-icon {
    background: linear-gradient(135deg, #22d3ee, #0284c7);
}

.pp-call-row.pp-in .pp-call-icon {
    background: linear-gradient(135deg, #fb923c, #ea580c);
}

.pp-call-row.pp-wa .pp-call-icon {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    #pp-chat-widget {
        left: 12px;
        bottom: 12px;
    }

    #pp-chat-panel {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 160px);
    }

    #pp-chat-launcher .pp-launcher-text {
        display: none;
    }

    #pp-chat-launcher {
        padding: 6px;
    }
}