/* ====================================================================== CHATBOT ====================================================================== */

#chatbot-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999;
    background: linear-gradient(135deg, #0a84ff, #0066d6);
    box-shadow: 0 8px 25px rgba(46, 114, 139, 0.35);
    transition: .3s ease;

    overflow: visible; /* <- ESTE ES EL CAMBIO */
}

#chatbot-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 30px rgba(46, 133, 139, 0.45);
}

#chatbot-btn img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

/* ventana */

#chatbot-window {
    position: fixed;
    bottom: 110px;
    right: 25px;
    width: 360px;
    height: 520px;
    background: rgba(242, 242, 242, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 15px 45px rgba(0,0,0,.18);
    z-index: 9999;
    display: none;
    border: 1px solid rgba(255,255,255,.5);
    animation: chatbotOpen .3s ease;
}

@keyframes chatbotOpen {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* header */

#chatbot-header {
    background: linear-gradient(135deg,#7ea7ff,#9b8cff);
    color: white;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
}

.chatbot-info h3 {
    margin: 0;
    font-size: 18px;
}

.chatbot-info span {
    font-size: 13px;
    opacity: .9;
}

/* =====================================================
   BOTÓN CERRAR CHAT MÁS VISIBLE
===================================================== */

#close-chat {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    transition: .25s ease;
}

#close-chat:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.08) rotate(90deg);
}

#close-chat i {
    font-size: 20px;
    pointer-events: none;
}

@media (max-width: 768px) {
    #close-chat {
        width: 42px;
        height: 42px;
        min-width: 42px;
        background: rgba(255, 255, 255, 0.3);
        font-size: 24px;
    }

    #close-chat i {
        font-size: 22px;
    }
}

/* body */

#chatbot-body {
    height: 360px;
    padding: 20px;
    overflow-y: auto;
    background:
    linear-gradient(
        to bottom,
        #f9fdff,
        #f4f9fa
    );
}

.bot-message {
    background: white;
    margin-bottom: 20px;
    padding: 16px 18px;
    border-radius: 18px 18px 18px 5px;
    width: fit-content;
    animation: messageIn .8s ease;
    max-width: 85%;
    box-shadow: 0 6px 18px rgba(0,0,0,.07);
    line-height: 1.55;
    color: #444;
    font-size: 14.5px;
    word-wrap: break-word;
}

/* =====================================================
   FORMATO HTML EN MENSAJES DE LUZ
===================================================== */

.bot-message p {
    margin: 0 0 10px;
}

.bot-message p:last-child {
    margin-bottom: 0;
}

.bot-message strong,
.bot-message b {
    display: inline-block;
    color: #2563eb;
    font-weight: 800;
    margin-bottom: 6px;
}

.bot-message small {
    display: block;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eef2f7;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
}

.bot-message ul,
.bot-message ol {
    margin: 8px 0 0;
    padding-left: 18px;
}

.bot-message li {
    margin-bottom: 6px;
    padding-left: 2px;
}

.bot-message li:last-child {
    margin-bottom: 0;
}

.bot-message br + br {
    display: block;
    content: "";
    margin-top: 8px;
}

/* input */

#chatbot-input {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 10px;
    background: white;
    border-top: 1px solid #eeeeee;
}

#chatbot-input input {
    flex: 1;
    border: none;
    background: #f4f4f4;
    border-radius: 20px;
    padding: 15px 18px;
    outline: none;
    font-size: 14px;
}

#chatbot-input button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: linear-gradient(135deg,#7ea7ff,#9b8cff);
    color: white;
    font-size: 20px;
    transition: .3s;
}

#chatbot-input button:hover {
    transform: scale(1.10);
}

#chat-notification {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    background: #ff3b30;
    color: white;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    display: none;
    justify-content: center;
    align-items: center;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
    z-index: 10000;
}

/* Botones del chatbot */

.chat-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.chat-btn {
    text-decoration: none;
    padding: 12px;
    border-radius: 14px;
    text-align: center;
    font-weight: 600;
    transition: .25s;
}

.chat-btn-login {
    background: linear-gradient(135deg, #0a84ff, #0066d6);
    color: white;
}

.chat-btn-register {
    background: #eef7f8;
    color: #0a84ff;
    border: 1px solid #d6e8e9;
}

.chat-btn:hover {
    transform: translateY(-2px);
}



.user-message {
    background: #0066d6;
    color: white;
    padding: 14px 16px;
    border-radius: 18px 18px 5px 18px;
    width: fit-content;
    max-width: 85%;
    margin-left: auto;
    margin-bottom: 12px;
    line-height: 1.5;
    animation: messageIn .4s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#chatbot-btn i {
    font-size: 30px;
    color: white;
}

#close-chat i {
    pointer-events: none;
}

/* =====================================================
   CHATBOT RESPONSIVE
===================================================== */

@media (max-width: 768px) {

    #chatbot-btn {
        width: 62px;
        height: 62px;
        right: 18px;
        bottom: 18px;
    }

    #chatbot-btn i {
        font-size: 26px;
    }

    #chatbot-window {
        width: calc(100vw - 24px);
        height: 72vh;
        right: 12px;
        bottom: 92px;
        border-radius: 22px;
    }

    #chatbot-header {
        padding: 15px;
    }

    .chat-avatar {
        width: 42px;
        height: 42px;
        font-size: 19px;
    }

    .chatbot-info h3 {
        font-size: 16px;
    }

    .chatbot-info span {
        font-size: 12px;
    }

    #close-chat {
        font-size: 18px;
    }

    #chatbot-body {
        height: calc(72vh - 145px);
        padding: 16px;
    }

    .bot-message,
    .user-message {
        max-width: 90%;
        font-size: 14px;
        padding: 13px 15px;
        line-height: 1.5;
    }

    #chatbot-input {
        padding: 12px;
        gap: 8px;
    }

    #chatbot-input input {
        padding: 13px 15px;
        font-size: 14px;
    }

    #chatbot-input button {
        width: 46px;
        height: 46px;
        min-width: 46px;
        font-size: 18px;
    }

    .chat-actions {
        gap: 8px;
    }

    .chat-btn {
        padding: 11px;
        font-size: 14px;
    }
}

/* Celulares muy pequeños */
@media (max-width: 420px) {

    #chatbot-window {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 86px;
        height: 75vh;
        border-radius: 20px;
    }

    #chatbot-body {
        height: calc(75vh - 140px);
        padding: 14px;
    }

    #chatbot-btn {
        width: 58px;
        height: 58px;
        right: 14px;
        bottom: 14px;
    }

    .bot-message,
    .user-message {
        max-width: 92%;
        font-size: 13.5px;
    }

    #chatbot-input input {
        font-size: 13.5px;
    }
}

/* Evita problemas en pantallas bajitas */
@media (max-height: 600px) {

    #chatbot-window {
        height: 82vh;
        bottom: 80px;
    }

    #chatbot-body {
        height: calc(82vh - 140px);
    }
}
/* =====================================================
   CHATBOT MÓVIL - PESTAÑA LATERAL SIN TEXTO FIJO
===================================================== */

@media (max-width: 768px) {

    #chatbot-btn {
        width: 54px;
        height: 54px;
        right: -18px;
        bottom: 115px;
        border-radius: 18px 0 0 18px;
        box-shadow: 0 8px 22px rgba(0, 102, 214, 0.35);
        transition: right .3s ease, transform .3s ease, border-radius .3s ease;
    }

    #chatbot-btn.chat-visible {
        right: 16px;
        border-radius: 50%;
    }

    #chatbot-btn i {
        font-size: 24px;
        transform: translateX(-7px);
        transition: transform .3s ease;
    }

    #chatbot-btn.chat-visible i {
        transform: translateX(0);
    }

    #chatbot-btn::before {
        content: "Luz";
        position: absolute;
        left: -42px;
        top: 50%;
        transform: translateY(-50%) rotate(-90deg);
        font-size: 11px;
        font-weight: 700;
        color: #0066d6;
        background: white;
        padding: 4px 8px;
        border-radius: 999px;
        box-shadow: 0 4px 12px rgba(0,0,0,.12);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }

    #chatbot-btn.mostrar-nombre::before {
        opacity: 1;
    }

    #chatbot-window {
        width: calc(100vw - 24px);
        height: 72vh;
        right: 12px;
        bottom: 92px;
        border-radius: 22px;
    }

    #chatbot-body {
        height: calc(72vh - 145px);
    }
}





.chat-centro-card{
    margin-top:12px;
    background:#fff;
    border-radius:16px;
    overflow:hidden;
    box-shadow:0 8px 24px rgba(0,0,0,.08);
    border:1px solid #eef2f7;
    margin-bottom: 20px;
}

.chat-centro-contenido{
    padding:16px;
}

.chat-centro-contenido h4{
    margin:8px 0;
    color:#1f2937;
}

.chat-centro-badge{
    display:inline-block;
    background:#dcfce7;
    color:#166534;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}