/**
 * NeuronCRM Phase 14: Chat Widget Styles
 */

/* Chat Bubble */
#nyx-chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 9990;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#nyx-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(59, 130, 246, 0.6);
}
#nyx-chat-bubble.active {
    transform: scale(0.9);
    opacity: 0.7;
}

.nyx-chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: nyxBadgePulse 2s infinite;
}
@keyframes nyxBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Chat Window */
#nyx-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    z-index: 9991;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
#nyx-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.nyx-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}
.nyx-chat-header__info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nyx-chat-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}
.nyx-chat-header__name {
    font-weight: 700;
    color: #f1f5f9;
    font-size: 0.9rem;
}
.nyx-chat-header__status {
    font-size: 0.7rem;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nyx-chat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    animation: nyxDotPulse 2s infinite;
}
@keyframes nyxDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.nyx-chat-dot--online {
    background: #10b981;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.6);
    animation: none;
    opacity: 1;
}
.nyx-chat-dot--typing {
    background: #f59e0b;
    animation: nyxDotTyping 0.8s infinite;
}
@keyframes nyxDotTyping {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.75); }
}
.nyx-chat-dot--thinking {
    background: #93c5fd;
    box-shadow: 0 0 6px rgba(147, 197, 253, 0.5);
    animation: nyxDotThinking 1.5s ease-in-out infinite;
}
@keyframes nyxDotThinking {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}
.nyx-chat-header__btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 1rem;
    position: relative;
}
.nyx-chat-header__btn:hover {
    color: #f1f5f9;
    background: rgba(255,255,255,0.1);
}
/* Tooltip on hover */
.nyx-chat-header__btn[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.6rem;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid #334155;
    z-index: 10;
    animation: nyx-tooltip-in 0.15s ease;
}
@keyframes nyx-tooltip-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.nyx-chat-header__btn--whatsapp { color: #25d366; opacity: 0.4; }
.nyx-chat-header__btn--whatsapp:hover { color: #25d366; opacity: 1; background: rgba(37,211,102,0.13); }
.nyx-chat-header__btn--report { color: #f59e0b; opacity: 0.4; }
.nyx-chat-header__btn--report:hover { color: #f59e0b; opacity: 1; background: rgba(245,158,11,0.13); }
.nyx-chat-header__btn--new { color: #3b82f6; opacity: 0.4; }
.nyx-chat-header__btn--new:hover { color: #3b82f6; opacity: 1; background: rgba(59,130,246,0.13); }
.nyx-chat-header__btn--end { color: #ef4444; opacity: 0.4; font-size: 0.85rem; }
.nyx-chat-header__btn--end:hover { color: #ef4444; opacity: 1; background: rgba(239,68,68,0.13); }
.nyx-chat-header__actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Dropdown menu */
.nyx-chat-menu-wrap {
    position: relative;
}
.nyx-chat-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 4px;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translateY(-6px) scale(0.95);
    pointer-events: none;
    transition: all 0.18s ease;
    z-index: 10;
}
.nyx-chat-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.nyx-chat-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 0.78rem;
    cursor: pointer;
    border-radius: 7px;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
}
.nyx-chat-menu__item i {
    color: #64748b;
    width: 16px;
    text-align: center;
    font-size: 0.82rem;
    transition: color 0.15s;
}
.nyx-chat-menu__item:hover {
    background: rgba(59,130,246,0.1);
    color: #f1f5f9;
}
.nyx-chat-menu__item:hover i {
    color: #93c5fd;
}

/* Menu divider */
.nyx-chat-menu__divider {
    height: 1px;
    background: #334155;
    margin: 4px 8px;
}

/* Report menu item */
#nyxChatReport i {
    color: #f59e0b;
}
#nyxChatReport:hover i {
    color: #fbbf24;
}

/* WhatsApp menu item */
.nyx-chat-menu__item--whatsapp i {
    color: #25D366;
}
.nyx-chat-menu__item--whatsapp:hover {
    background: rgba(37, 211, 102, 0.1);
}
.nyx-chat-menu__item--whatsapp:hover i {
    color: #34d399;
}

/* WhatsApp quick reply button */
.nyx-chat-quick-btn--whatsapp {
    border-color: #25D366;
    color: #25D366;
    text-decoration: none;
    display: inline-flex;
}
.nyx-chat-quick-btn--whatsapp:hover {
    background: rgba(37, 211, 102, 0.15);
    border-color: #34d399;
    color: #34d399;
}

/* System message (chat ended) */
.nyx-chat-system-msg {
    text-align: center;
    font-size: 0.72rem;
    color: #64748b;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    animation: nyxMsgIn 0.3s ease;
}
.nyx-chat-system-msg i {
    color: #10b981;
    font-size: 0.8rem;
}

/* Restart chat button */
.nyx-chat-restart {
    text-align: center;
    padding: 8px 16px 4px;
    animation: nyxMsgIn 0.3s ease;
}
.nyx-chat-restart button {
    background: none;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nyx-chat-restart button:hover {
    border-color: #3b82f6;
    color: #bfdbfe;
    background: rgba(59,130,246,0.08);
}
.nyx-chat-restart button i {
    font-size: 0.7rem;
}

/* Messages area */
.nyx-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nyx-chat-messages::-webkit-scrollbar { width: 4px; }
.nyx-chat-messages::-webkit-scrollbar-track { background: transparent; }
.nyx-chat-messages::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

/* Message bubbles */
.nyx-chat-msg {
    max-width: 85%;
    animation: nyxMsgIn 0.3s ease;
}
@keyframes nyxMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.nyx-chat-msg--usuario {
    align-self: flex-end;
}
.nyx-chat-msg--asistente {
    align-self: flex-start;
}

/* Assistant message row: avatar + bubble */
.nyx-chat-msg__row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.nyx-chat-msg__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.nyx-chat-msg__bubble {
    flex: 1;
    min-width: 0;
}

.nyx-chat-msg__content {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.nyx-chat-msg--usuario .nyx-chat-msg__content {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.nyx-chat-msg--asistente .nyx-chat-msg__content {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-bottom-left-radius: 4px;
}
.nyx-chat-msg__meta {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 0 4px;
}
.nyx-chat-msg--usuario .nyx-chat-msg__meta {
    justify-content: flex-end;
}
.nyx-chat-msg__time {
    font-size: 0.6rem;
    color: #475569;
}
.nyx-chat-msg__checks {
    font-size: 0.55rem;
    transition: color 0.4s ease, transform 0.3s ease;
    display: inline-block;
}
.nyx-check--sent {
    color: #64748b;
}
.nyx-check--delivered {
    color: #64748b;
    animation: nyx-check-arrive 0.3s ease;
}
.nyx-check--read {
    color: #3b82f6;
    animation: nyx-check-read 0.4s ease;
}
@keyframes nyx-check-arrive {
    0% { transform: scale(0.6); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes nyx-check-read {
    0% { color: #64748b; }
    100% { color: #3b82f6; }
}

/* Typing indicator */
.nyx-chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}
.nyx-chat-typing__name {
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
}
.nyx-chat-typing__dots {
    display: flex;
    gap: 3px;
    align-items: center;
}
.nyx-chat-typing__dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #3b82f6;
    animation: nyxTyping 1.4s infinite;
}
.nyx-chat-typing__dots span:nth-child(2) { animation-delay: 0.2s; }
.nyx-chat-typing__dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes nyxTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Product suggestions */
.nyx-chat-products {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    border-top: 1px solid #1e293b;
    flex-shrink: 0;
}
.nyx-chat-products::-webkit-scrollbar { height: 3px; }
.nyx-chat-products::-webkit-scrollbar-thumb { background: #334155; }

.nyx-chat-product {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    text-decoration: none;
    transition: all 0.2s;
}
.nyx-chat-product:hover {
    background: rgba(255,255,255,0.02);
}
.nyx-chat-product img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.nyx-chat-product__noimg {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 16px;
}
.nyx-chat-product__name {
    font-size: 0.7rem;
    color: #e2e8f0;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nyx-chat-product__price {
    font-size: 0.7rem;
    color: #10b981;
    font-weight: 700;
    margin-top: 2px;
}

/* Quick reply buttons */
.nyx-chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
    animation: nyxMsgIn 0.3s ease;
}
.nyx-chat-quick-btn {
    background: none;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.nyx-chat-quick-btn:hover {
    border-color: #3b82f6;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.1);
}
.nyx-chat-quick-btn i {
    font-size: 0.68rem;
    color: #3b82f6;
}

/* Product card animation */
.nyx-chat-product-card {
    display: flex;
    flex-direction: column;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    min-width: 180px;
    flex-shrink: 0;
    overflow: hidden;
    opacity: 0;
    animation: nyxProductSlideUp 0.4s ease forwards;
    transition: all 0.2s;
}
.nyx-chat-product-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
}
@keyframes nyxProductSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.nyx-chat-product__actions {
    display: flex;
    border-top: 1px solid #334155;
}
.nyx-chat-product__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 0;
    font-size: 0.65rem;
    color: #93c5fd;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
}
.nyx-chat-product__btn:hover {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.08);
}
.nyx-chat-product__btn i {
    font-size: 0.6rem;
}
.nyx-chat-cart-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 0;
    font-size: 0.65rem;
    color: #10b981;
    background: none;
    border: none;
    border-left: 1px solid #334155;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.nyx-chat-cart-btn:hover {
    color: #34d399;
    background: rgba(16, 185, 129, 0.08);
}
.nyx-chat-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.nyx-chat-cart-btn--added {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}
.nyx-chat-cart-btn i {
    font-size: 0.6rem;
}

/* Input area */
.nyx-chat-input-wrap {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px solid #334155;
    gap: 8px;
    flex-shrink: 0;
    background: #0f172a;
}
.nyx-chat-input {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 10px 14px;
    color: #e2e8f0;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s;
}
.nyx-chat-input:focus {
    border-color: #3b82f6;
}
.nyx-chat-input::placeholder {
    color: #475569;
}
.nyx-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.nyx-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.4);
}

/* Satisfaction survey */
.nyx-chat-satisfaction {
    text-align: center;
    padding: 10px 16px;
    animation: nyxMsgIn 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.nyx-chat-satisfaction__text {
    font-size: 0.72rem;
    color: #94a3b8;
}
.nyx-chat-satisfaction__btns {
    display: flex;
    gap: 8px;
}
.nyx-chat-satisfaction__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #334155;
    background: none;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nyx-chat-satisfaction__btn:hover {
    transform: scale(1.15);
}
.nyx-chat-satisfaction__btn[data-type="positivo"]:hover {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}
.nyx-chat-satisfaction__btn[data-type="negativo"]:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Loading & Error */
.nyx-chat-loading {
    text-align: center;
    color: #64748b;
    padding: 40px;
    font-size: 1.2rem;
}
.nyx-chat-error {
    text-align: center;
    color: #ef4444;
    padding: 20px;
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════ */

/* Tablet (small windows) */
@media (max-width: 768px) {
    #nyx-chat-window {
        width: 340px;
        height: 480px;
        bottom: 140px; /* above bubble (76px) + bubble height (52px) + gap (12px) */
        right: 16px;
    }
    #nyx-chat-bubble {
        bottom: 72px; /* above mobile-bottom-nav (60px + 12px gap) */
        right: 16px;
    }
}

/* Mobile fullscreen */
@media (max-width: 480px) {
    #nyx-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        height: 100dvh; /* real viewport height (excl. browser bar) */
        border-radius: 0;
        border: none;
        /* Safe area for notched phones (iPhone X+) */
        padding-top: env(safe-area-inset-top, 0);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    /* When virtual keyboard is open, shrink window */
    #nyx-chat-window.nyx-keyboard-open {
        height: auto;
        bottom: 0;
    }

    /* Bubble: above mobile bottom nav (60px nav + 12px gap) */
    #nyx-chat-bubble {
        bottom: 72px;
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 1.2rem;
        z-index: 9990;
    }

    /* Header: compact for mobile */
    .nyx-chat-header {
        padding: 10px 12px;
        padding-top: calc(10px + env(safe-area-inset-top, 0));
    }
    .nyx-chat-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }
    .nyx-chat-header__name {
        font-size: 0.85rem;
    }
    .nyx-chat-header__status {
        font-size: 0.65rem;
    }
    /* Touch-friendly header buttons */
    .nyx-chat-header__btn {
        padding: 10px;
        font-size: 1.1rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Messages area: use available space */
    .nyx-chat-messages {
        padding: 12px;
        gap: 8px;
        -webkit-overflow-scrolling: touch; /* momentum scroll iOS */
    }
    .nyx-chat-msg__content {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    .nyx-chat-msg {
        max-width: 88%;
    }
    .nyx-chat-msg__avatar {
        width: 24px;
        height: 24px;
    }

    /* Product cards: adaptive width */
    .nyx-chat-products {
        padding: 8px 12px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    .nyx-chat-product-card {
        min-width: 160px;
        max-width: 200px;
        scroll-snap-align: start;
    }
    /* Bigger touch targets for Ver/Agregar */
    .nyx-chat-product__btn,
    .nyx-chat-cart-btn {
        padding: 12px 0;
        font-size: 0.72rem;
        min-height: 44px;
    }
    .nyx-chat-product__btn i,
    .nyx-chat-cart-btn i {
        font-size: 0.7rem;
    }

    /* Quick replies: better spacing for fingers */
    .nyx-chat-quick-replies {
        gap: 8px;
        padding: 6px 0;
    }
    .nyx-chat-quick-btn {
        padding: 10px 16px;
        font-size: 0.75rem;
        min-height: 44px;
    }

    /* Input area: safe area bottom + bigger targets */
    .nyx-chat-input-wrap {
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
        gap: 8px;
    }
    .nyx-chat-input {
        padding: 12px 14px;
        font-size: 16px; /* prevents iOS zoom on focus */
        border-radius: 12px;
    }
    .nyx-chat-send {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        font-size: 0.9rem;
    }

    /* Typing indicator */
    .nyx-chat-typing {
        padding: 8px 12px;
    }
    .nyx-chat-typing__name {
        font-size: 0.7rem;
    }

    /* Menu dropdown: full width on mobile */
    .nyx-chat-menu {
        min-width: 180px;
        right: -8px;
    }
    .nyx-chat-menu__item {
        padding: 12px 14px;
        font-size: 0.82rem;
        min-height: 44px;
    }

    /* Satisfaction survey */
    .nyx-chat-satisfaction {
        padding: 12px;
    }
    .nyx-chat-satisfaction__btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    /* System messages */
    .nyx-chat-system-msg {
        font-size: 0.7rem;
        padding: 10px 12px;
    }
    .nyx-chat-restart button {
        padding: 10px 20px;
        font-size: 0.78rem;
        min-height: 44px;
    }
}

/* Extra small screens (iPhone SE, old androids) */
@media (max-width: 360px) {
    .nyx-chat-product-card {
        min-width: 145px;
    }
    .nyx-chat-quick-btn {
        padding: 9px 12px;
        font-size: 0.7rem;
    }
    .nyx-chat-msg__content {
        font-size: 0.8rem;
        padding: 8px 10px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (max-width: 900px) {
    #nyx-chat-window {
        height: 100dvh;
    }
    .nyx-chat-header {
        padding: 6px 12px;
    }
    .nyx-chat-avatar {
        width: 32px;
        height: 32px;
    }
    .nyx-chat-messages {
        padding: 8px;
        gap: 6px;
    }
    .nyx-chat-products {
        padding: 6px 8px;
    }
    .nyx-chat-input-wrap {
        padding: 6px 10px;
    }
}

/* ── Emoji Reactions (WhatsApp-style) ── */
.nyx-chat-msg--usuario {
    position: relative;
}
.nyx-chat-reaction {
    position: absolute;
    bottom: -8px;
    left: 4px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 1px 6px;
    font-size: 0.75rem;
    line-height: 1.3;
    animation: nyx-reaction-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    cursor: default;
    user-select: none;
}
@keyframes nyx-reaction-pop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
