/* =========================================================
   HEJAZ AI - ASISTENTE VIRTUAL
   ========================================================= */


/* ---------------------------------------------------------
   BOTÓN FLOTANTE
   --------------------------------------------------------- */

#hejaz-ai-button {

    position: fixed;

    right: 25px;
    bottom: 25px;

    width: 64px;
    height: 64px;

    border: none;

    border-radius: 50%;

    background: #2946f3;

    color: #ffffff;

    font-size: 28px;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    z-index: 99999;

    box-shadow:
        0 8px 25px rgba(0,0,0,0.25);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


#hejaz-ai-button:hover {

    transform: scale(1.08);

    box-shadow:
        0 12px 30px rgba(0,0,0,0.30);
}


/* ---------------------------------------------------------
   VENTANA
   --------------------------------------------------------- */

#hejaz-ai-chat {

    position: fixed;

    right: 25px;
    bottom: 105px;

    width: 390px;

    max-width: calc(100vw - 30px);

    height: 590px;

    max-height: calc(100vh - 130px);

    background: #ffffff;

    border-radius: 20px;

    overflow: hidden;

    display: none;

    flex-direction: column;

    z-index: 99998;

    box-shadow:
        0 15px 50px rgba(0,0,0,0.25);

    border: 1px solid #e9e9e9;
}


/* ---------------------------------------------------------
   HEADER
   --------------------------------------------------------- */

#hejaz-ai-header {

    background: #2946f3;

    color: #ffffff;

    padding: 15px 17px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    flex-shrink: 0;
}


.hejaz-ai-header-info {

    display: flex;

    align-items: center;

    gap: 10px;
}


.hejaz-ai-avatar {

    width: 42px;

    height: 42px;

    border-radius: 50%;

    background: rgba(255,255,255,0.18);

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 22px;
}


.hejaz-ai-header-info strong {

    display: block;

    font-size: 16px;

    line-height: 1.2;
}


.hejaz-ai-header-info span {

    display: block;

    font-size: 12px;

    opacity: 0.85;

    margin-top: 2px;
}


#hejaz-ai-close {

    border: none;

    background: transparent;

    color: #ffffff;

    font-size: 27px;

    line-height: 1;

    cursor: pointer;

    padding: 2px 5px;
}


/* ---------------------------------------------------------
   ÁREA DE MENSAJES
   --------------------------------------------------------- */

#hejaz-ai-messages {

    flex: 1;

    overflow-y: auto;

    padding: 18px;

    background: #f7f8fb;

    scroll-behavior: smooth;
}


/* ---------------------------------------------------------
   MENSAJES
   --------------------------------------------------------- */

.hejaz-ai-message {

    margin-bottom: 15px;

    padding: 12px 14px;

    border-radius: 14px;

    max-width: 88%;

    font-size: 14px;

    line-height: 1.55;
}


.hejaz-ai-message.bot {

    background: #ffffff;

    margin-right: auto;

    border: 1px solid #e8e8e8;

    color: #333333;

    box-shadow:
        0 2px 6px rgba(0,0,0,0.04);
}


.hejaz-ai-message.user {

    background: #2946f3;

    color: #ffffff;

    margin-left: auto;

}


/* ---------------------------------------------------------
   BIENVENIDA
   --------------------------------------------------------- */

.hejaz-ai-welcome strong {

    font-size: 16px;
}


.hejaz-ai-welcome p {

    margin: 7px 0;
}


/* ---------------------------------------------------------
   BOTONES DE OPCIONES
   --------------------------------------------------------- */

#hejaz-ai-options {

    display: flex;

    flex-direction: column;

    gap: 8px;

    margin-top: 4px;
}


.hejaz-ai-option {

    width: 100%;

    min-height: 48px;

    display: flex;

    align-items: center;

    gap: 11px;

    padding: 9px 12px;

    background: #ffffff;

    border: 1px solid #e1e4ea;

    border-radius: 10px;

    color: #333333;

    font-size: 13px;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.hejaz-ai-option:hover {

    background: #f1f4ff;

    border-color: #2946f3;

    transform: translateX(2px);
}


.hejaz-ai-option-icon {

    width: 30px;

    height: 30px;

    border-radius: 8px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #f1f4ff;

    font-size: 17px;

    flex-shrink: 0;
}


/* ---------------------------------------------------------
   FORMULARIO
   --------------------------------------------------------- */

#hejaz-ai-form {

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 11px;

    background: #ffffff;

    border-top: 1px solid #eeeeee;

    flex-shrink: 0;
}


#hejaz-ai-input {

    flex: 1;

    min-width: 0;

    height: 43px;

    border: 1px solid #dddddd;

    border-radius: 22px;

    padding: 0 15px;

    outline: none;

    font-size: 14px;

    background: #ffffff;
}


#hejaz-ai-input:focus {

    border-color: #2946f3;

    box-shadow:
        0 0 0 2px rgba(41,70,243,0.10);
}


#hejaz-ai-send {

    width: 43px;

    height: 43px;

    border: none;

    border-radius: 50%;

    background: #2946f3;

    color: #ffffff;

    font-size: 17px;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;
}


#hejaz-ai-send:hover {

    background: #1e36c7;
}


/* ---------------------------------------------------------
   INDICADOR "ESCRIBIENDO"
   --------------------------------------------------------- */

.hejaz-ai-typing {

    display: inline-flex;

    gap: 4px;

    align-items: center;
}


.hejaz-ai-typing span {

    width: 6px;

    height: 6px;

    background: #999999;

    border-radius: 50%;

    animation: hejazTyping 1.2s infinite ease-in-out;
}


.hejaz-ai-typing span:nth-child(2) {

    animation-delay: 0.15s;
}


.hejaz-ai-typing span:nth-child(3) {

    animation-delay: 0.30s;
}


@keyframes hejazTyping {

    0%,
    60%,
    100% {

        transform: translateY(0);

        opacity: 0.4;
    }

    30% {

        transform: translateY(-4px);

        opacity: 1;
    }
}


/* =========================================================
   CELULAR
   ========================================================= */

@media (max-width: 767px) {

    #hejaz-ai-button {

        right: 15px;

        bottom: 15px;

        width: 58px;

        height: 58px;

        font-size: 25px;
    }


    #hejaz-ai-chat {

        left: 8px;

        right: 8px;

        bottom: 82px;

        width: auto;

        max-width: none;

        height: calc(100vh - 100px);

        max-height: calc(100vh - 100px);

        border-radius: 17px;
    }


    #hejaz-ai-messages {

        padding: 14px;
    }


    .hejaz-ai-option {

        min-height: 46px;

        font-size: 13px;
    }

}


/* =========================================================
   CELULARES PEQUEÑOS
   ========================================================= */

@media (max-width: 380px) {

    #hejaz-ai-chat {

        left: 4px;

        right: 4px;

        bottom: 72px;

        height: calc(100vh - 85px);

        max-height: calc(100vh - 85px);

        border-radius: 14px;
    }


    #hejaz-ai-button {

        right: 10px;

        bottom: 10px;

        width: 54px;

        height: 54px;

        font-size: 23px;
    }
	
	/* =========================================================
   ASISTENTE HEJAZ - AJUSTE PARA CELULARES
   ========================================================= */

#hejaz-ai-chat {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Zona donde aparecen los mensajes y botones */
#hejaz-ai-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

/* Formulario siempre visible */
#hejaz-ai-form {
    flex: 0 0 auto;
    position: relative;
    z-index: 10;
}

/* En teléfonos */
@media (max-width: 767px) {

    #hejaz-ai-chat {
        width: calc(100% - 16px);
        max-width: none;
        height: calc(100dvh - 90px);
        max-height: calc(100dvh - 90px);
        bottom: 8px;
        left: 8px;
        right: 8px;
        border-radius: 20px;
    }

    #hejaz-ai-messages {
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    #hejaz-ai-options {
        padding-bottom: 15px;
    }

    .hejaz-ai-option {
        min-height: 68px;
    }

    #hejaz-ai-form {
        background: #fff;
        padding: 10px;
    }
}
	
	/* =========================================================
   WHATSAPP - HEADER HEJAZ SYSTEM
   ========================================================= */

.hejaz-whatsapp-header {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-radius: 50px;
    text-decoration: none !important;
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.35);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.hejaz-whatsapp-header:hover {
    transform: translateY(-2px);
    background: rgba(37, 211, 102, 0.20);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.18);
}

.hejaz-whatsapp-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}

.hejaz-whatsapp-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.hejaz-whatsapp-text strong {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.hejaz-whatsapp-text small {
    color: rgba(255, 255, 255, 0.70);
    font-size: 11px;
    margin-top: 3px;
}


/* =========================================================
   CELULAR
   ========================================================= */

@media (max-width: 575px) {

    .hejaz-whatsapp-header {
        padding: 8px 12px;
    }

    .hejaz-whatsapp-text {
        display: none;
    }

    .hejaz-whatsapp-icon {
        width: 40px;
        height: 40px;
        font-size: 21px;
    }

}

}