
/* =========================================================
   CHATBOT TURÍSTICO - TURISMO SAN RAFAEL
   Botón circular + panel adaptable
   ========================================================= */

#rlt-chatbot {
    --verde: #1F4D3A;
    --verde-claro: #2A6B57;
    --crema: #F1EFE3;
    --dorado: #C99A2E;
    --texto: #24352D;

    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    font-family: inherit;
    color: var(--texto);
}

#rlt-chatbot *,
#rlt-chatbot *::before,
#rlt-chatbot *::after {
    box-sizing: border-box;
}

#rlt-chatbot button,
#rlt-chatbot input {
    font: inherit;
}

#rlt-chatbot button {
    cursor: pointer;
}

/* ---------------------------------------------------------
   BOTÓN FLOTANTE CIRCULAR
   --------------------------------------------------------- */

#rlt-chatbot .rlt-chatbot__launcher {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    padding: 0;

    border: 2px solid var(--dorado);
    border-radius: 50%;

    background: var(--verde);
    color: var(--crema);

    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25);
    transition: background 0.25s ease,
                color 0.25s ease,
                transform 0.25s ease,
                box-shadow 0.25s ease;
}

/* Ícono SVG del botón */
#rlt-chatbot .rlt-chatbot__launcher svg {
    display: block;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Si el ícono está hecho con una fuente */
#rlt-chatbot .rlt-chatbot__launcher i {
    font-size: 28px;
    line-height: 1;
}

#rlt-chatbot .rlt-chatbot__launcher:hover,
#rlt-chatbot .rlt-chatbot__launcher:focus-visible {
    background: var(--dorado);
    color: var(--verde);
    transform: translateY(-3px);
    box-shadow: 0 9px 26px rgba(0, 0, 0, 0.3);
}

#rlt-chatbot .rlt-chatbot__launcher:focus-visible {
    outline: 3px solid var(--verde-claro);
    outline-offset: 4px;
}

/* Evita que el tema agregue efectos a los botones */
#rlt-chatbot .rlt-chatbot__launcher::before,
#rlt-chatbot .rlt-chatbot__launcher::after {
    content: none !important;
    display: none !important;
}

/* ---------------------------------------------------------
   PANEL DEL CHAT
   --------------------------------------------------------- */

#rlt-chatbot .rlt-chatbot__panel[hidden] {
    display: none !important;
}

#rlt-chatbot .rlt-chatbot__panel {
    position: absolute;
    right: 0;
    bottom: 78px;

    display: flex;
    flex-direction: column;

    width: min(390px, calc(100vw - 32px));
    height: min(650px, calc(100dvh - 120px));
    min-height: 400px;

    overflow: hidden;
    border: 1px solid rgba(31, 77, 58, 0.18);
    border-radius: 20px;

    background: #fff;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.22);
}

/* ---------------------------------------------------------
   ENCABEZADO
   --------------------------------------------------------- */

#rlt-chatbot .rlt-chatbot__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--verde);
    color: #fff;
}

#rlt-chatbot .rlt-chatbot__avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: 2px solid var(--dorado);
    border-radius: 50%;
    background: var(--crema);
    color: var(--verde);
    font-weight: 800;
}

#rlt-chatbot .rlt-chatbot__heading {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

#rlt-chatbot .rlt-chatbot__heading strong {
    color: #fff;
    font-size: 16px;
}

#rlt-chatbot .rlt-chatbot__heading span {
    color: #e5eee7;
    font-size: 12px;
}

/* Botón para cerrar el chat */
#rlt-chatbot .rlt-chatbot__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 26px;
    line-height: 1;
}

#rlt-chatbot .rlt-chatbot__close:hover,
#rlt-chatbot .rlt-chatbot__close:focus-visible {
    background: var(--dorado);
    color: var(--verde);
}

/* ---------------------------------------------------------
   MENSAJES
   --------------------------------------------------------- */

#rlt-chatbot .rlt-chatbot__messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 15px;
    overflow-y: auto;
    background: #fff;
    overscroll-behavior: contain;
}

#rlt-chatbot .rlt-chatbot__message {
    max-width: 94%;
    padding: 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

#rlt-chatbot .rlt-chatbot__message--bot {
    align-self: flex-start;
    border: 1px solid rgba(31, 77, 58, 0.12);
    border-bottom-left-radius: 4px;
    background: var(--crema);
}

#rlt-chatbot .rlt-chatbot__message--user {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    background: var(--verde);
    color: #fff;
}

#rlt-chatbot .rlt-chatbot__message a {
    display: inline-block;
    margin-top: 10px;
    color: var(--verde);
    font-weight: 800;
    text-decoration: underline;
}

#rlt-chatbot .rlt-chatbot__message a:hover {
    color: #936c12;
}

/* ---------------------------------------------------------
   PREGUNTAS FRECUENTES
   --------------------------------------------------------- */

#rlt-chatbot .rlt-chatbot__quick-area {
    flex-shrink: 0;
    padding: 12px;
    border-top: 1px solid rgba(31, 77, 58, 0.12);
}

#rlt-chatbot .rlt-chatbot__quick-title {
    margin: 0 0 8px;
    color: var(--verde);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

#rlt-chatbot .rlt-chatbot__quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 112px;
    overflow-y: auto;
}

#rlt-chatbot .rlt-chatbot__quick-questions button {
    padding: 7px 10px;
    border: 1px solid rgba(31, 77, 58, 0.4);
    border-radius: 20px;
    background: #fff;
    color: var(--verde);
    font-size: 11px;
    line-height: 1.4;
    transition: background 0.2s ease,
                color 0.2s ease,
                border-color 0.2s ease;
}

#rlt-chatbot .rlt-chatbot__quick-questions button:hover,
#rlt-chatbot .rlt-chatbot__quick-questions button:focus-visible {
    border-color: var(--dorado);
    background: var(--dorado);
    color: #fff;
}

/* ---------------------------------------------------------
   CAMPO PARA ESCRIBIR Y ENVIAR
   --------------------------------------------------------- */

#rlt-chatbot .rlt-chatbot__form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 11px;
    border-top: 1px solid rgba(31, 77, 58, 0.12);
}

#rlt-chatbot .rlt-chatbot__form input {
    width: 100%;
    min-width: 0;
    height: 43px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid #bdc9c0;
    border-radius: 30px;
    background: #fff;
    box-shadow: none;
    outline: none;
    font-size: 13px;
}

#rlt-chatbot .rlt-chatbot__form input:focus {
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(31, 77, 58, 0.12);
}

#rlt-chatbot .rlt-chatbot__form button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    padding: 0;
    border: 1px solid var(--dorado);
    border-radius: 50%;
    background: var(--verde);
    color: #fff;
    font-size: 18px;
}

#rlt-chatbot .rlt-chatbot__form button:hover,
#rlt-chatbot .rlt-chatbot__form button:focus-visible {
    background: var(--dorado);
    color: var(--verde);
}

/* ---------------------------------------------------------
   PIE DEL CHAT
   --------------------------------------------------------- */

#rlt-chatbot .rlt-chatbot__footer {
    flex-shrink: 0;
    padding: 0 12px 12px;
    color: #647269;
    font-size: 10px;
    text-align: center;
}

#rlt-chatbot .rlt-chatbot__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------
   DISEÑO PARA CELULARES
   --------------------------------------------------------- */

@media (max-width: 600px) {
    #rlt-chatbot {
        right: 14px;
        bottom: 14px;
    }

    #rlt-chatbot .rlt-chatbot__launcher {
        width: 60px;
        height: 60px;
        min-width: 60px;
        min-height: 60px;
    }

    #rlt-chatbot .rlt-chatbot__panel {
        position: fixed;
        right: 8px;
        bottom: 84px;
        width: calc(100vw - 16px);
        height: calc(100dvh - 110px);
        min-height: 320px;
        max-height: 680px;
        border-radius: 18px;
    }
}

/* Pantallas pequeñas o de poca altura */
@media (max-height: 520px) {
    #rlt-chatbot .rlt-chatbot__panel {
        height: calc(100dvh - 100px);
        min-height: 0;
    }
}

/* Respeta la preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    #rlt-chatbot *,
    #rlt-chatbot *::before,
    #rlt-chatbot *::after {
        transition: none !important;
        animation: none !important;
    }
}
