/* ===== BOTONES FLOTANTES ===== */
.floating-buttons {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Botón principal circular */
.floating-main {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
    z-index: 10000;
    position: relative;
}

.floating-main:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.floating-main i {
    font-size: 1.8rem;
    color: white;
    transition: transform 0.3s ease;
}

.floating-main.active i {
    transform: rotate(90deg);
}

/* Menú de opciones */
.floating-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.floating-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Cada botón flotante */
.floating-item {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    position: relative;
}

.floating-item:hover {
    transform: scale(1.1) translateX(-5px);
}

.floating-item i {
    font-size: 1.4rem;
    color: white;
}

/* Tooltips */
.floating-item .tooltip {
    position: absolute;
    right: 60px;
    background: #1e293b;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.floating-item:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-5px);
}

/* Colores específicos */
.floating-item.whatsapp {
    background: #25D366;
}

.floating-item.whatsapp:hover {
    background: #128C7E;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.floating-item.facebook {
    background: #1877F2;
}

.floating-item.facebook:hover {
    background: #0D6EFD;
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.4);
}

.floating-item.instagram {
    background: linear-gradient(45deg, #f09433, #d62976, #962fbf);
}

.floating-item.instagram:hover {
    background: linear-gradient(45deg, #e0862e, #c41e6a, #7f26a0);
    box-shadow: 0 4px 15px rgba(214, 41, 118, 0.4);
}

.floating-item.tiktok {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.floating-item.tiktok:hover {
    background: #1a1a1a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.floating-item.phone {
    background: #EF4444;
}

.floating-item.phone:hover {
    background: #DC2626;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.floating-item.chat {
    background: #10b981;
}

.floating-item.chat:hover {
    background: #059669;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* Badge de notificación */
.floating-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #EF4444;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    border: 2px solid white;
}

/* ===== MODAL DEL CHAT ===== */
.chat-modal {
    position: fixed;
    bottom: 100px;
    right: 2rem;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

.chat-modal.active {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}

/* Header del modal */
.chat-modal-header {
    background: linear-gradient(135deg, #0a0f1a 0%, #0f172a 100%);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #10b981;
}

.chat-modal-header-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.chat-modal-header-info .avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-modal-header-info .avatar i {
    font-size: 1.2rem;
    color: white;
}

.chat-modal-header-info h4 {
    color: white;
    font-size: 1rem;
    margin: 0;
}

.chat-modal-header-info p {
    color: #10b981;
    font-size: 0.7rem;
    margin: 0;
}

.chat-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-modal-close:hover {
    color: #ef4444;
    transform: scale(1.1);
}

/* Body del chat */
.chat-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Mensajes del chat */
.chat-message {
    display: flex;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.bot {
    justify-content: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message-content {
    max-width: 80%;
    padding: 0.7rem 1rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.chat-message.bot .chat-message-content {
    background: white;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 0.2rem;
    color: #1a202c;
}

.chat-message.user .chat-message-content {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-bottom-right-radius: 0.2rem;
}

.chat-message-content strong {
    color: #10b981;
}

.chat-message.user .chat-message-content strong {
    color: white;
}

/* Typing indicator */
.chat-typing {
    display: flex;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 1rem;
    border-bottom-left-radius: 0.2rem;
    width: fit-content;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

/* Footer del chat */
.chat-modal-footer {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
}

.chat-modal-footer input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
}

.chat-modal-footer input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: #10b981;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 480px) {
    .floating-buttons {
        bottom: 1rem;
        right: 1rem;
    }
    
    .floating-main {
        width: 50px;
        height: 50px;
    }
    
    .floating-main i {
        font-size: 1.5rem;
    }
    
    .floating-item {
        width: 45px;
        height: 45px;
    }
    
    .chat-modal {
        width: calc(100vw - 2rem);
        right: 1rem;
        bottom: 80px;
        height: 500px;
    }
    
    .floating-item .tooltip {
        display: none;
    }
}

/* Imagen dentro del botón principal */
.floating-main .floating-icon-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    /* Si la imagen tiene fondo oscuro y quieres que se vea blanca, usa filtro */
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
    border-radius: 50%; /* Opcional, si quieres que sea circular */
}

.floating-main.active .floating-icon-img {
    transform: rotate(90deg);
}

/* Atribución de Flaticon dentro del chat */
.chat-credit {
    padding: 0.4rem 1rem;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    font-size: 0.6rem;
    text-align: center;
    color: #64748b;
}

.chat-credit a {
    color: #64748b;
    text-decoration: none;
}

.chat-credit a:hover {
    color: #10b981;
    text-decoration: underline;
}

/* Ajuste responsive para la imagen */
@media (max-width: 480px) {
    .floating-main .floating-icon-img {
        width: 30px;
        height: 30px;
    }
}