/* ==========================================================================
   LẨU NHÀ - SALES CHATBOT WIDGET STYLES
   ========================================================================== */

#lauNhaChatWidget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Tooltip Bubble */
.chat-tooltip-bubble {
    position: absolute;
    bottom: 74px;
    right: 0;
    background: #3A2118;
    color: #FFF7EC;
    padding: 9px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(58, 33, 24, 0.25);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #D85A2A;
    animation: chatTooltipBounce 2.5s infinite ease-in-out;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s;
}

.chat-tooltip-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 24px;
    width: 12px;
    height: 12px;
    background: #3A2118;
    border-right: 1px solid #D85A2A;
    border-bottom: 1px solid #D85A2A;
    transform: rotate(45deg);
}

.chat-tooltip-close {
    font-size: 14px;
    opacity: 0.7;
    margin-left: 4px;
    cursor: pointer;
    line-height: 1;
}
.chat-tooltip-close:hover {
    opacity: 1;
    color: #F5B041;
}

@keyframes chatTooltipBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Floating Trigger Button */
.chat-trigger-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D85A2A 0%, #E9A23B 100%);
    color: #FFF;
    border: 2px solid #FFF7EC;
    box-shadow: 0 8px 25px rgba(216, 90, 42, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chat-trigger-btn:hover {
    transform: scale(1.08) rotate(-4deg);
    box-shadow: 0 12px 30px rgba(216, 90, 42, 0.6);
}

.chat-trigger-btn .chat-unread-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #FF3B30;
    color: #FFF;
    font-size: 11px;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFF;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Chat Window Box */
.chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 570px;
    max-height: calc(100vh - 130px);
    background: #FFFDF9;
    border-radius: 20px;
    box-shadow: 0 16px 50px rgba(58, 33, 24, 0.28);
    border: 1.5px solid #F0DFC8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10001;
    opacity: 0;
    transform: scale(0.85) translateY(30px);
    transform-origin: bottom right;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-window.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #3A2118 0%, #22120C 100%);
    color: #FFF7EC;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #D85A2A;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FFF;
    padding: 2px;
    border: 1.5px solid #E9A23B;
}

.chat-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.chat-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background: #2ECC71;
    border-radius: 50%;
    border: 2px solid #3A2118;
}

.chat-header-text h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #FFF7EC;
    line-height: 1.2;
}

.chat-header-text p {
    margin: 2px 0 0 0;
    font-size: 11.5px;
    color: #F5B041;
    opacity: 0.95;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #FFF7EC;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.chat-btn-icon:hover {
    background: rgba(216, 90, 42, 0.8);
}

/* Chat Body (Messages Area) */
.chat-body {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #FFFDF9;
    scroll-behavior: smooth;
}

.chat-body::-webkit-scrollbar {
    width: 5px;
}
.chat-body::-webkit-scrollbar-thumb {
    background: #E5D6C5;
    border-radius: 4px;
}

/* Message Bubbles */
.chat-msg {
    display: flex;
    gap: 8px;
    max-width: 88%;
    font-size: 13.5px;
    line-height: 1.5;
    animation: msgFadeIn 0.3s ease;
}

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

.chat-msg.bot {
    align-self: flex-start;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #D85A2A;
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-msg-content {
    background: #FFF;
    padding: 11px 14px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(58, 33, 24, 0.06);
    border: 1px solid #EFE4D6;
    color: #2B1710;
    word-break: break-word;
}

.chat-msg.user .chat-msg-content {
    background: #D85A2A;
    color: #FFF;
    border-color: #D85A2A;
    border-bottom-right-radius: 4px;
}

.chat-msg.bot .chat-msg-content {
    border-bottom-left-radius: 4px;
}

.chat-msg-content p {
    margin: 0 0 6px 0;
}
.chat-msg-content p:last-child {
    margin-bottom: 0;
}
.chat-msg-content strong {
    color: #D85A2A;
    font-weight: 700;
}
.chat-msg.user .chat-msg-content strong {
    color: #FFF;
}
.chat-msg-content ul {
    margin: 4px 0 6px 18px;
    padding: 0;
}
.chat-msg-content li {
    margin-bottom: 3px;
}

/* Action CTA Buttons Inside Chat */
.chat-action-cta-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #E5D6C5;
}

.chat-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border: none;
}

.chat-cta-btn.primary {
    background: linear-gradient(135deg, #D85A2A 0%, #E9A23B 100%);
    color: #FFF;
    box-shadow: 0 4px 12px rgba(216, 90, 42, 0.35);
}

.chat-cta-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(216, 90, 42, 0.5);
}

.chat-cta-btn.secondary {
    background: #FFF;
    color: #3A2118;
    border: 1.5px solid #D85A2A;
}

.chat-cta-btn.secondary:hover {
    background: #FFF7EC;
}

/* Quick Topic Suggestions Chips */
.chat-quick-replies {
    padding: 8px 12px 10px;
    background: #FFFDF9;
    border-top: 1px solid #F0DFC8;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-quick-replies-title {
    font-size: 11px;
    font-weight: 700;
    color: #8C7A70;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.chat-chips-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 98px;
    overflow-y: auto;
    padding-right: 2px;
}

.chat-chips-scroll::-webkit-scrollbar {
    width: 3px;
}
.chat-chips-scroll::-webkit-scrollbar-thumb {
    background: #D85A2A;
    border-radius: 3px;
}

.chat-chip {
    background: #FFF7EC;
    color: #3A2118;
    border: 1px solid #E5D6C5;
    padding: 5px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: left;
}

.chat-chip:hover {
    background: #D85A2A;
    color: #FFF;
    border-color: #D85A2A;
    transform: translateY(-1px);
}

.chat-chip.highlight {
    background: #D85A2A;
    color: #FFF;
    border-color: #D85A2A;
    font-weight: 700;
}
.chat-chip.highlight:hover {
    background: #C2481D;
}

/* Input Area */
.chat-input-bar {
    padding: 10px 12px;
    background: #FFF;
    border-top: 1.5px solid #F0DFC8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-field {
    flex: 1;
    border: 1.5px solid #E5D6C5;
    border-radius: 24px;
    padding: 9px 15px;
    font-size: 13.5px;
    outline: none;
    background: #FFFDF9;
    color: #2B1710;
    transition: border-color 0.2s;
}

.chat-input-field:focus {
    border-color: #D85A2A;
    background: #FFF;
}

.chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #D85A2A;
    color: #FFF;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.chat-send-btn:hover {
    background: #C2481D;
    transform: scale(1.05);
}

/* Responsive for Mobile */
@media (max-width: 768px) {
    #lauNhaChatWidget {
        bottom: 82px; /* Positioned above mobile-sticky-bar */
        right: 16px;
    }
    .chat-tooltip-bubble {
        bottom: 70px;
        right: 0;
        font-size: 12px;
    }
    .chat-trigger-btn {
        width: 56px;
        height: 56px;
        font-size: 23px;
    }
    .chat-window {
        bottom: 145px;
        right: 12px;
        width: calc(100vw - 24px);
        height: calc(100vh - 200px);
        max-height: 520px;
    }
}

/* ==========================================================================
   ORDER CARD & VIETQR PAYMENT STYLES
   ========================================================================== */
.chat-order-card {
    background: #FFFDF9;
    border: 1.5px solid #F0DFC8;
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(58, 33, 24, 0.08);
}

.chat-order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #E5D6C5;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.chat-order-code {
    font-weight: 700;
    font-size: 13px;
    color: #D85A2A;
}

.chat-pay-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chat-pay-badge.pending {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FCD34D;
}

.chat-pay-badge.paid {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
    animation: badgePulse 1.5s infinite;
}

.chat-order-qr-wrap {
    text-align: center;
    margin: 8px 0;
    background: #FFF;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #F0DFC8;
}

.chat-order-qr-img {
    max-width: 170px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: block;
    margin: 0 auto 6px auto;
}

.chat-order-qr-tip {
    font-size: 11px;
    color: #78716C;
    font-weight: 600;
}

.chat-order-bank-info {
    font-size: 12px;
    background: #FDFBF7;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 1px solid #F5EAE0;
}

.chat-order-bank-info .bank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-order-bank-info .bank-row span {
    color: #78716C;
}

.chat-order-bank-info .copyable-val {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-order-bank-info code {
    background: #F3ECE2;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: #2B1710;
    font-weight: 700;
}

.chat-order-bank-info .btn-copy {
    background: #D85A2A;
    color: #FFF;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-order-bank-info .btn-copy:hover {
    background: #C2481D;
}

.chat-order-notice {
    font-size: 11px;
    color: #8C786D;
    margin-top: 8px;
    line-height: 1.4;
}

