/* =============================================================================
 * Archivo   : /s-internos/chatbot/wordpress/poeh-chatbot/assets/css/poeh-chatbot.css
 * Sistema   : Chatbot del Periódico Oficial del Estado de Hidalgo (POEH) — plugin de WordPress
 * Propósito : Botón flotante, invitación, panel del asistente y código corto [poeh_chatbot]. Los colores y la
 *             separación del borde llegan como variables CSS desde los ajustes (--poeh-cb-principal, --poeh-cb-secundario,
 *             --poeh-cb-acento, --poeh-cb-margen). Todo lleva el prefijo «poeh-cb-» para no chocar con el tema.
 *
 * BITÁCORA DE CAMBIOS
 *   2026-11-18 | v1.0.0 | Creación del archivo.
 * ========================================================================== */

#poeh-cb-boton, #poeh-cb-panel, #poeh-cb-invitacion { --poeh-cb-lado: var(--poeh-cb-margen, 22px); box-sizing: border-box; }

/* Botón */
#poeh-cb-boton {
    position: fixed; bottom: var(--poeh-cb-margen, 22px); z-index: 2147483000;
    display: inline-flex; align-items: center; gap: 10px; height: 64px; min-width: 64px; padding: 0 15px; margin: 0;
    border-radius: 32px; border: 3px solid var(--poeh-cb-acento, #BC955B); cursor: pointer;
    background: linear-gradient(135deg, var(--poeh-cb-principal, #691b31), var(--poeh-cb-secundario, #A02142)); color: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .3); font: 600 15px/1 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; letter-spacing: normal; text-transform: none;
    transition: transform .25s ease, box-shadow .25s ease;
}
#poeh-cb-boton.poeh-cb-derecha { right: var(--poeh-cb-margen, 22px); }
#poeh-cb-boton.poeh-cb-izquierda { left: var(--poeh-cb-margen, 22px); }
#poeh-cb-boton:hover, #poeh-cb-boton:focus { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, .38); color: #fff; }
#poeh-cb-boton:focus-visible { outline: 3px solid var(--poeh-cb-acento, #BC955B); outline-offset: 3px; }
#poeh-cb-boton .poeh-cb-icono { display: inline-flex; width: 30px; height: 30px; flex: 0 0 auto; }
#poeh-cb-boton svg { width: 30px; height: 30px; fill: currentColor; }
#poeh-cb-boton:not(.poeh-cb-con-etiqueta), #poeh-cb-boton.poeh-cb-activo { width: 64px; padding: 0; justify-content: center; }
#poeh-cb-boton.poeh-cb-activo .poeh-cb-etiqueta { display: none; }

/* Invitación */
#poeh-cb-invitacion {
    position: fixed; bottom: calc(var(--poeh-cb-margen, 22px) + 76px); z-index: 2147483000; max-width: 260px; padding: 11px 15px; cursor: pointer;
    background: #fff; color: var(--poeh-cb-principal, #691b31); border-radius: 14px; border-left: 5px solid var(--poeh-cb-acento, #BC955B);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18); font: 600 14px/1.35 "Segoe UI", Roboto, Arial, sans-serif; animation: poeh-cb-entra .4s ease-out;
}
#poeh-cb-invitacion.poeh-cb-derecha { right: var(--poeh-cb-margen, 22px); }
#poeh-cb-invitacion.poeh-cb-izquierda { left: var(--poeh-cb-margen, 22px); }

/* Panel */
#poeh-cb-panel {
    position: fixed; bottom: calc(var(--poeh-cb-margen, 22px) + 78px); z-index: 2147483001; display: none;
    width: 420px; max-width: calc(100vw - 32px); height: 640px; max-height: calc(100vh - 130px);
    border-radius: 18px; overflow: hidden; background: #fff; border-top: 5px solid var(--poeh-cb-acento, #BC955B);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35); animation: poeh-cb-entra .3s ease-out;
}
#poeh-cb-panel.poeh-cb-derecha { right: var(--poeh-cb-margen, 22px); }
#poeh-cb-panel.poeh-cb-izquierda { left: var(--poeh-cb-margen, 22px); }
#poeh-cb-panel.poeh-cb-abierto { display: block; }
#poeh-cb-panel iframe { display: block; width: 100%; height: 100%; border: 0; }

@keyframes poeh-cb-entra { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Celulares: el panel ocupa la pantalla y el botón queda arriba como «cerrar» */
@media (max-width: 600px) {
    #poeh-cb-boton { height: 56px; min-width: 56px; }
    #poeh-cb-boton .poeh-cb-etiqueta { display: none; }
    #poeh-cb-boton.poeh-cb-con-etiqueta { width: 56px; padding: 0; justify-content: center; }
    #poeh-cb-panel { left: 0 !important; right: 0 !important; bottom: 0; width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; }
    #poeh-cb-boton.poeh-cb-activo { top: 8px; bottom: auto; width: 42px; height: 42px; min-width: 42px; z-index: 2147483002; }
    #poeh-cb-boton.poeh-cb-activo svg { width: 22px; height: 22px; }
    #poeh-cb-invitacion { max-width: calc(100vw - 2 * var(--poeh-cb-margen, 22px)); bottom: calc(var(--poeh-cb-margen, 22px) + 66px); }
    .poeh-cb-sin-movil { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    #poeh-cb-panel, #poeh-cb-invitacion { animation: none; }
    #poeh-cb-boton { transition: none; }
    #poeh-cb-boton:hover, #poeh-cb-boton:focus { transform: none; }
}

@media print { #poeh-cb-boton, #poeh-cb-panel, #poeh-cb-invitacion { display: none !important; } }

/* Código corto [poeh_chatbot] */
.poeh-cb-incrustado { margin: 1.5em 0; }
.poeh-cb-incrustado iframe {
    display: block; width: 100%; height: var(--poeh-cb-alto, 650px); border: 0; border-radius: 14px; background: #fff;
    border-top: 5px solid var(--poeh-cb-acento, #BC955B); box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}
.poeh-cb-alterno { margin: .5em 0 0; font-size: .9em; text-align: right; }
