/**
 * JG WhatsApp - Estilos del módulo
 * Compatible con PrestaShop 8.2+ / 9.x
 * v2.0.0 - Con soporte para colores personalizados
 */

:root {
    --jgwa-color: #25D366;
    --jgwa-color-dark: #128C7E;
}

/* ==========================================================================
   BOTÓN FLOTANTE DE WHATSAPP
   ========================================================================== */

.easycontactwhatsapp-floating {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.easycontactwhatsapp-floating.easycontactwhatsapp-right {
    right: 20px;
    flex-direction: row;
}

.easycontactwhatsapp-floating.easycontactwhatsapp-left {
    left: 20px;
    flex-direction: row-reverse;
}

/* Botón principal */
.easycontactwhatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: var(--jgwa-color, #25D366);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: easycontactwhatsapp-pulse 2s infinite;
}

.easycontactwhatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    animation: none;
}

.easycontactwhatsapp-btn:active {
    transform: scale(0.95);
}

.easycontactwhatsapp-btn svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
}

/* Animación de pulso */
@keyframes easycontactwhatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Tooltip */
.easycontactwhatsapp-tooltip {
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    max-width: 250px;
}

.easycontactwhatsapp-tooltip.easycontactwhatsapp-offline {
    background-color: #ff9800;
    white-space: normal;
}

.easycontactwhatsapp-floating:hover .easycontactwhatsapp-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   BOTÓN COMPARTIR PRODUCTO
   ========================================================================== */

.easycontactwhatsapp-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--jgwa-color, #25D366);
    color: #ffffff !important;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 10px 0;
    border: none;
    cursor: pointer;
}

.easycontactwhatsapp-share:hover {
    background-color: var(--jgwa-color-dark, #128C7E);
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.easycontactwhatsapp-share:active {
    transform: translateY(0);
}

.easycontactwhatsapp-share svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

.easycontactwhatsapp-share-text {
    line-height: 1;
}

/* ==========================================================================
   MULTI-AGENT SELECTOR
   ========================================================================== */

.easycontactwhatsapp-agent-selector {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
}

.easycontactwhatsapp-agent-selector.easycontactwhatsapp-right {
    right: 20px;
}

.easycontactwhatsapp-agent-selector.easycontactwhatsapp-left {
    left: 20px;
}

.easycontactwhatsapp-agent-toggle {
    width: 60px;
    height: 60px;
    background: var(--jgwa-color, #25D366);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.easycontactwhatsapp-agent-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 991px) {
    .easycontactwhatsapp-floating {
        bottom: 15px;
    }

    .easycontactwhatsapp-floating.easycontactwhatsapp-right {
        right: 15px;
    }

    .easycontactwhatsapp-floating.easycontactwhatsapp-left {
        left: 15px;
    }

    .easycontactwhatsapp-btn,
    .easycontactwhatsapp-agent-toggle {
        width: 55px;
        height: 55px;
    }

    .easycontactwhatsapp-btn svg {
        width: 28px;
        height: 28px;
    }

    .easycontactwhatsapp-tooltip {
        display: none;
    }
}

@media (max-width: 576px) {
    .easycontactwhatsapp-floating {
        bottom: 12px;
    }

    .easycontactwhatsapp-floating.easycontactwhatsapp-right {
        right: 12px;
    }

    .easycontactwhatsapp-floating.easycontactwhatsapp-left {
        left: 12px;
    }

    .easycontactwhatsapp-btn,
    .easycontactwhatsapp-agent-toggle {
        width: 50px;
        height: 50px;
    }

    .easycontactwhatsapp-btn svg {
        width: 26px;
        height: 26px;
    }

    .easycontactwhatsapp-share {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
}

/* ==========================================================================
   ACCESIBILIDAD
   ========================================================================== */

.easycontactwhatsapp-btn:focus,
.easycontactwhatsapp-share:focus,
.easycontactwhatsapp-agent-toggle:focus {
    outline: 3px solid var(--jgwa-color-dark, #128C7E);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    .easycontactwhatsapp-btn,
    .easycontactwhatsapp-share,
    .easycontactwhatsapp-floating,
    .easycontactwhatsapp-agent-toggle {
        animation: none;
        transition: none;
    }
}

/* ==========================================================================
   MODO OSCURO
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .easycontactwhatsapp-tooltip {
        background-color: #f5f5f5;
        color: #333;
    }

    .easycontactwhatsapp-tooltip.easycontactwhatsapp-offline {
        background-color: #ff9800;
        color: #fff;
    }
}
