/* /whatsapp-publicidad/whatsapp-publicidad.css
   Widget flotante de WhatsApp con tooltip de dos columnas y botón de cierre
*/

/* --------------------------------------------------------------
   CONFIGURACIÓN DEL WIDGET
   -------------------------------------------------------------- */
.whatsapp-float-widget {
    position: fixed;
    right: 180px;
    top: 75%;
    transform: translateY(-30%);
    z-index: 9999;
    transition: bottom 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.2s ease,
                visibility 0.2s ease;
    will-change: bottom;
}

/* BOTÓN CIRCULAR */
.whatsapp-float-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

.whatsapp-icon {
    font-size: 2.5rem;
    color: white;
    transition: transform 0.2s ease;
}

/* TOOLTIP RECTANGULAR */
.whatsapp-tooltip {
    position: absolute;
    right: 70px;
    top: 80%;
    transform: translateY(-30%);
    width: 480px;
    height: 360px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border: 2px solid #0087ff;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

/* Botón de cierre (oculto por defecto en escritorio) */
.tooltip-close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    z-index: 10001;
    display: none;
    pointer-events: auto;
    background: transparent;
    border: none;
    line-height: 1;
    width: 30px;
    height: 30px;
    text-align: center;
}

.tooltip-close-btn:hover {
    color: #333;
}

/* Contenedor interno flex */
.tooltip-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.tooltip-left {
    flex: 1.8;
    background: #f8f9fc;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.9rem;
    color: #1e2a3e;
    text-align: left;
}

.tooltip-left p {
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.stars {
    color: #ffb400;
    font-size: 1rem;
    margin: 4px 0;
    letter-spacing: 2px;
}

.greeting {
    font-weight: bold;
    margin-top: 8px;
    font-size: 0.9rem;
    text-align: center;
    color: #0a4b6e;
}

.despacho-name {
    color: #0087ff;
    font-weight: bold;
}

.phone-number {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.tooltip-right {
    flex: 0.8;
    background: #eef2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lawyer-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hover botón (solo escritorio) */
.whatsapp-float-button:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
}

.whatsapp-float-button:hover {
    transform: scale(1.02);
    background-color: #20b859;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Modo oscuro */
body.dark-mode .whatsapp-tooltip,
body.night-mode .whatsapp-tooltip {
    background: #1e1e2a;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #0087ff;
}
body.dark-mode .tooltip-left {
    background: #2a2a3a;
    color: #e0e0f0;
}
body.dark-mode .greeting {
    color: #8bcbff;
}
body.dark-mode .tooltip-right {
    background: #1f1f2f;
}
body.dark-mode .despacho-name,
body.night-mode .despacho-name {
    color: #5cb0ff;
}

/* --------------------------------------------------------------
   RESPONSIVE MÓVIL (ancho < 768px)
   -------------------------------------------------------------- */
@media (max-width: 767px) {
    .whatsapp-float-widget {
        right: 20px;
        bottom: 280px;
        top: auto;
        transform: none;
        opacity: 0;
        visibility: hidden;
        transition: bottom 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    opacity 0.3s ease,
                    visibility 0.3s ease;
    }

    .whatsapp-float-widget.visible {
        opacity: 1;
        visibility: visible;
    }

    .whatsapp-float-button {
        width: 60px;
        height: 60px;
    }

    .whatsapp-icon {
        font-size: 2.8rem;
    }

    /* TOOLTIP: 75% de alto, centrado, ancho casi completo */
    .whatsapp-tooltip {
        position: fixed;
        width: calc(100% - 20px);   /* 10px a cada lado */
        height: 75vh;               /* 75% de la altura de la pantalla */
        left: 10px;
        top: 50%;                   /* Centrado vertical */
        right: auto;
        bottom: auto;
        transform: translateY(-50%);
        margin: 0;
        border-radius: 10px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;       /* 🔥 Permite interactuar con el modal (tocar fuera, botón cierre) */
        overflow-y: auto;
    }

    /* Botón de cierre más grande y visible (sin efectos hover molestos) */
    .tooltip-close-btn {
        display: block;
        font-size: 32px;
        top: 8px;
        right: 15px;
        background: rgba(255,255,255,0.8);
        border-radius: 50%;
        width: 36px;
        height: 36px;
        line-height: 32px;
        text-align: center;
        color: #333;
        transition: none;           /* Evita cualquier transición que pueda causar intermitencia */
    }

    /* Eliminamos el hover en móvil (por si acaso) */
    .tooltip-close-btn:hover {
        background: rgba(255,255,255,0.8);
        color: #333;
    }

    /* Clase para ocultar tooltip temporalmente */
    .whatsapp-tooltip.hide-tooltip {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    /* AUMENTO SIGNIFICATIVO DE FUENTES EN MÓVIL */
    .tooltip-left {
        padding: 18px 14px;
        font-size: 1.15rem;
    }

    .tooltip-left p {
        font-size: 1.15rem;
        line-height: 1.5;
        margin-bottom: 12px;
    }

    .stars {
        font-size: 1.4rem;
        margin: 8px 0;
    }

    .greeting {
        font-size: 1.2rem;
        margin-top: 12px;
    }
}

/* Móviles muy pequeños (ancho < 480px) - ajuste fino */
@media (max-width: 480px) {
    .whatsapp-float-widget {
        right: 13px;
        bottom: 240px;
    }
    .whatsapp-float-button {
        width: 52px;
        height: 52px;
    }
    .whatsapp-icon {
        font-size: 2rem;
    }
    .whatsapp-tooltip {
        width: calc(100% - 20px);
        height: 75vh;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
    .tooltip-left {
        padding: 14px 12px;
        font-size: 1rem;
    }
    .tooltip-left p {
        font-size: 1rem;
    }
    .stars {
        font-size: 1.25rem;
    }
    .greeting {
        font-size: 1.05rem;
    }
    .tooltip-close-btn {
        font-size: 28px;
        width: 32px;
        height: 32px;
        line-height: 28px;
        top: 5px;
        right: 10px;
    }
}

/* Escritorio: mantener tooltip oculto hasta .visible */
@media (min-width: 768px) {
    .whatsapp-float-widget:not(.visible) {
        opacity: 0;
        visibility: hidden;
    }
    .whatsapp-float-widget.visible {
        opacity: 1;
        visibility: visible;
    }
    .whatsapp-tooltip {
        top: auto;
        bottom: -125%;
        transform: none;
        margin-bottom: 12px;
        right: 2;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Animación pulso */
@keyframes whatsappPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}