/* 
 * UTILITIES.CSS - Componentes reutilizables y utilidades
 * Contiene:
 * - Modal de carga
 * - Botón flotante de WhatsApp
 * - Botón "Volver arriba"
 * - Animaciones y efectos
 * - Responsive para todos los componentes
 * - modal Login clientes
 */

 :root {
    --verde-ws: #25d366;
    --verde-ws-hover: #128C7E;
    --blanco-spinner: #f3f3f3;
    --azul-spinner: #0066cc;
}

/* Modal de carga */
.loading-modal {
    display: none;
    position: fixed;
    flex-direction: column;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background-color: var(--blanco);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
    position: relative;
}

.loading-spinner {
    border: 5px solid var(--blanco-spinner);
    border-top: 5px solid var(--azul-spinner);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Icono flotante de WhatsApp */

/* Animación de balanceo */
@keyframes balanceo {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(5deg) scale(1.05); }
    50% { transform: rotate(-5deg) scale(1.05); }
    75% { transform: rotate(3deg) scale(1.03); }
    100% { transform: rotate(0deg) scale(1); }
}

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--verde-ws);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .whatsapp-float {
        animation: balanceo 3s ease-in-out infinite;
    }
}

.whatsapp-float:hover {
    background-color: var(--verde-ws-hover);
    transform: scale(1.1) rotate(0deg);
    animation: none;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.whatsapp-float i {
    line-height: 1;
    vertical-align: middle;
    margin: 0;
}

/* Responsive para componentes */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 25px;
        bottom: 20px;
        right: 20px;
    }
}

/* Botón "Volver arriba" */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--color-primario);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 99;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--color-secundario);
}

.back-to-top:hover {
    background-color: var(--color-secundario);
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Responsive para componentes */
@media (max-width: 768px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
        bottom: 20px;
        left: 20px;
    }
}

@media (max-width: 576px) {
    .back-to-top {
        width: 36px;
        height: 36px;
        font-size: 14px;
        bottom: 15px;
        left: 15px;
    }
}
