.vp-chat {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 999;
}

.vp-chat-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: #1a3a5c;
    background: linear-gradient(135deg, #1a3a5c, #2d5a8a);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(26, 58, 92, 0.45);
    animation: vp-chat-breathe 2.8s ease-in-out infinite;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vp-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(26, 58, 92, 0.55);
}

.vp-chat-toggle-icon {
    width: 26px;
    height: 26px;
    position: absolute;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.vp-chat-toggle-icon--close {
    opacity: 0;
    transform: scale(0.5);
}

.vp-chat.vp-chat-open .vp-chat-toggle-icon:not(.vp-chat-toggle-icon--close) {
    opacity: 0;
    transform: scale(0.5);
}

.vp-chat.vp-chat-open .vp-chat-toggle-icon--close {
    opacity: 1;
    transform: scale(1);
}

.vp-chat.vp-chat-open .vp-chat-toggle {
    animation: none;
}

.vp-chat-toggle-ping {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(232, 119, 34, 0.55);
    animation: vp-chat-ping 2.8s ease-out infinite;
    pointer-events: none;
}

.vp-chat.vp-chat-open .vp-chat-toggle-ping {
    display: none;
}

@keyframes vp-chat-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@keyframes vp-chat-ping {
    0% { transform: scale(0.9); opacity: 0.8; }
    80% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

.vp-chat-panel {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: min(360px, calc(100vw - 48px));
    height: min(520px, calc(100vh - 180px));
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px -12px rgba(15, 25, 32, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

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

.vp-chat-panel[hidden] {
    display: flex;
}

.vp-chat-panel__head {
    padding: 16px 18px;
    background: #1a3a5c;
    color: #ffffff;
    flex-shrink: 0;
}

.vp-chat-panel__title {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
}

.vp-chat-panel__subtitle {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
}

.vp-chat-panel__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
}

.vp-chat-msg {
    max-width: 85%;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.45;
}

.vp-chat-msg--bot {
    align-self: flex-start;
    background: #ffffff;
    color: #222831;
    border: 1px solid #e2e6ea;
    border-bottom-left-radius: 3px;
}

.vp-chat-msg--user {
    align-self: flex-end;
    background: #1a3a5c;
    color: #ffffff;
    border-bottom-right-radius: 3px;
}

.vp-chat-msg--typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 12px 14px;
}

.vp-chat-msg--typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9aa5ad;
    animation: vp-chat-typing 1.1s ease-in-out infinite;
}

.vp-chat-msg--typing span:nth-child(2) { animation-delay: 0.15s; }
.vp-chat-msg--typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes vp-chat-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.vp-chat-product {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e6ea;
    border-radius: 10px;
    padding: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}

.vp-chat-product:hover {
    border-color: #e87722;
}

.vp-chat-product img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.vp-chat-product__info {
    min-width: 0;
}

.vp-chat-product__title {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #222831;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vp-chat-product__meta {
    display: block;
    font-size: 0.75rem;
    color: #6c7680;
}

.vp-chat-product__price {
    font-weight: 700;
    color: #1a3a5c;
}

.vp-chat-panel__form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e6ea;
    background: #ffffff;
    flex-shrink: 0;
}

.vp-chat-panel__input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 0.85rem;
    outline: none;
}

.vp-chat-panel__input:focus {
    border-color: #e87722;
}

.vp-chat-panel__send {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: #e87722;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.vp-chat-panel__send svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 480px) {
    .vp-chat { right: 16px; bottom: 88px; }
    .vp-chat-panel { width: calc(100vw - 32px); }
}
