﻿/* =====================================================
   MODAL AGENDAR CITA
   DISEÑO FORMAL - VERDE OLIVO
===================================================== */

#modalAgenda {
    position: fixed;
    inset: 0;
    background: rgba(40, 45, 32, .55);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}


    /* =====================================================
   MODAL ACTIVO
===================================================== */

    #modalAgenda.activo {
        opacity: 1;
        visibility: visible;
    }


    /* =====================================================
   CONTENEDOR
===================================================== */

    #modalAgenda .formulario {
        width: 100%;
        max-width: 570px;
        max-height: 92vh;
        overflow-y: auto;
        background: #fff;
        border-radius: 22px;
        box-shadow: 0 20px 60px rgba(0,0,0,.25);
        position: relative;
        padding: 0;
        transform: translateY(25px) scale(.97);
        transition: transform .35s ease;
    }


    /* Animación */

    #modalAgenda.activo .formulario {
        transform: translateY(0) scale(1);
    }


    /* Scroll */

    #modalAgenda .formulario::-webkit-scrollbar {
        width: 5px;
    }


    #modalAgenda .formulario::-webkit-scrollbar-thumb {
        background: #7a8450;
        border-radius: 10px;
    }


    /* =====================================================
   ENCABEZADO
===================================================== */

    #modalAgenda .formulario::before {
        content: "";
        display: block;
        height: 7px;
        background: linear-gradient( 90deg, #667044, #89945c, #667044 );
    }


    /* =====================================================
   TÍTULO
===================================================== */

    #modalAgenda .formulario h2 {
        margin: 0;
        padding: 22px 28px 5px;
        color: #4f5735;
        font-family: 'Playfair Display', serif;
        font-size: 27px;
        font-weight: 800;
    }


        #modalAgenda .formulario h2::after {
            content: "Completa los datos para reservar tu servicio";
            display: block;
            margin-top: 5px;
            font-family: 'Poppins', sans-serif;
            font-size: 11px;
            font-weight: 400;
            color: #929292;
        }


    /* =====================================================
   BOTÓN CERRAR
===================================================== */

    #modalAgenda .cerrar {
        position: absolute;
        top: 19px;
        right: 20px;
        width: 34px;
        height: 34px;
        border: none;
        border-radius: 50%;
        background: #f1f2e9;
        color: #5f683f;
        font-size: 15px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 5;
        transition: all .25s ease;
    }


        #modalAgenda .cerrar:hover {
            background: #667044;
            color: white;
            transform: rotate(90deg);
        }


    /* =====================================================
   FORMULARIO
===================================================== */

    #modalAgenda #formCita {
        padding: 18px 28px 25px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 13px;
    }


        /* =====================================================
   INPUTS Y SELECTS
===================================================== */

        #modalAgenda #formCita input,
        #modalAgenda #formCita select,
        #modalAgenda #formCita textarea {
            width: 100%;
            border: 1px solid #dedfd5;
            border-radius: 11px;
            background: #fafbf7;
            color: #4f4f4f;
            font-family: 'Poppins', sans-serif;
            font-size: 12px;
            padding: 11px 13px;
            outline: none;
            transition: all .25s ease;
        }


            /* Focus */

            #modalAgenda #formCita input:focus,
            #modalAgenda #formCita select:focus,
            #modalAgenda #formCita textarea:focus {
                border-color: #7a8450;
                background: #fff;
                box-shadow: 0 0 0 3px rgba(122,132,80,.12);
            }


/* =====================================================
   PRIMERA FILA
===================================================== */

#nombre {
    grid-column: span 1;
}


#telefono {
    grid-column: span 1;
}


/* =====================================================
   SELECT SERVICIO
===================================================== */

#id_categoria {
    grid-column: 1 / -1;
}


/* =====================================================
   FECHA Y HORA
===================================================== */

#fecha,
#hora {
    grid-column: span 1;
}


/* =====================================================
   LABEL
===================================================== */

#modalAgenda #formCita label {
    grid-column: 1 / -1;
    margin: 3px 0 -7px;
    color: #59613d;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
}


/* =====================================================
   ARCHIVO
===================================================== */

#imagen_deposito {
    grid-column: 1 / -1;
    padding: 8px !important;
    background: #f5f6ef !important;
    cursor: pointer;
}


/* =====================================================
   TEXTAREA
===================================================== */

#observaciones {
    grid-column: 1 / -1;
    min-height: 65px;
    max-height: 80px;
    resize: none;
}


/* =====================================================
   BOTÓN CONFIRMAR
===================================================== */

#modalAgenda .enviar {
    grid-column: 1 / -1;
    margin-top: 3px;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    background: linear-gradient( 135deg, #667044, #879154 );
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 7px 18px rgba(102,112,68,.25);
    transition: all .3s ease;
}


    #modalAgenda .enviar:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(102,112,68,.35);
    }


    #modalAgenda .enviar:active {
        transform: scale(.98);
    }


    #modalAgenda .enviar:disabled {
        opacity: .65;
        cursor: wait;
        transform: none;
    }


/* =====================================================
   PLACEHOLDER
===================================================== */

#modalAgenda input::placeholder,
#modalAgenda textarea::placeholder {
    color: #aaa;
}


/* =====================================================
   SELECT
===================================================== */

#modalAgenda select {
    cursor: pointer;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 600px) {

    #modalAgenda {
        padding: 10px;
        align-items: center;
    }


        #modalAgenda .formulario {
            max-height: 94vh;
            border-radius: 18px;
        }


            #modalAgenda .formulario h2 {
                padding: 19px 20px 4px;
                font-size: 23px;
            }


        #modalAgenda #formCita {
            padding: 15px 20px 20px;
            grid-template-columns: 1fr;
            gap: 11px;
        }


    #nombre,
    #telefono,
    #id_categoria,
    #fecha,
    #hora,
    #imagen_deposito,
    #observaciones {
        grid-column: 1 / -1;
    }


    #modalAgenda .cerrar {
        top: 15px;
        right: 15px;
    }
}

/* =====================================================
   BOTÓN FLOTANTE DEL ASISTENTE
===================================================== */




/* ICONO */

#btnAsistente i {
    color: white !important;
    font-size: 25px !important;
}


/* EFECTO AL PASAR EL MOUSE */

#btnAsistente:hover {

    transform:
        translateY(-5px)
        scale(1.05) !important;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, .30) !important;

}


/* EFECTO AL PRESIONAR */

#btnAsistente:active {

    transform:
        scale(.92) !important;

}


/* =====================================================
   PEQUEÑA ANIMACIÓN
===================================================== */

#btnAsistente {

    animation:
        aparecerBoton .5s ease,
        pulsoAsistente 2.5s infinite 1s;

}


@keyframes aparecerBoton {

    from {

        opacity: 0;
        transform: scale(0);

    }

    to {

        opacity: 1;
        transform: scale(1);

    }

}


@keyframes pulsoAsistente {

    0% {
        box-shadow:
            0 8px 25px rgba(0, 0, 0, .25);
    }

    50% {
        box-shadow:
            0 8px 25px rgba(111, 118, 80, .55);
    }

    100% {
        box-shadow:
            0 8px 25px rgba(0, 0, 0, .25);
    }

}

/* =====================================================
   CONTENEDOR DEL ASISTENTE
===================================================== */

#asistenteVirtual {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}


/* =====================================================
   VENTANA DE CONVERSACIÓN
===================================================== */

#ventanaAsistente {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 360px;
    max-width: calc(100vw - 30px);
    height: 520px;
    max-height: calc(100vh - 130px);
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 20px 55px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(.95);
    transform-origin: bottom right;
    transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
}


    /* =====================================================
   ASISTENTE ABIERTO
===================================================== */

    #ventanaAsistente.mostrar {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }


/* =====================================================
   HEADER
===================================================== */

.asistente-header {
    min-height: 75px;
    padding: 14px 16px;
    background: linear-gradient( 135deg, #667044, #879154 );
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* =====================================================
   TÍTULO
===================================================== */

.asistente-titulo {
    display: flex;
    align-items: center;
    gap: 11px;
}


    .asistente-titulo strong {
        display: block;
        font-family: 'Poppins', sans-serif;
        font-size: 14px;
        font-weight: 600;
    }


    .asistente-titulo small {
        display: block;
        margin-top: 2px;
        font-family: 'Poppins', sans-serif;
        font-size: 10px;
        opacity: .85;
    }


/* =====================================================
   ICONO DEL BOT
===================================================== */

.icono-bot {
    width: 43px;
    height: 43px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


    .icono-bot i {
        font-size: 20px;
        color: white;
    }


/* =====================================================
   BOTÓN CERRAR
===================================================== */

.cerrar-asistente {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .25s ease;
}


    .cerrar-asistente:hover {
        background: rgba(255,255,255,.30);
        transform: rotate(90deg);
    }


/* =====================================================
   CUERPO DE LA CONVERSACIÓN
===================================================== */

.asistente-body {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background: #faf7f4;
    font-family: 'Poppins', sans-serif;
}


    /* Scroll */

    .asistente-body::-webkit-scrollbar {
        width: 5px;
    }


    .asistente-body::-webkit-scrollbar-thumb {
        background: #b8bd9c;
        border-radius: 10px;
    }


/* =====================================================
   MENSAJE DEL BOT
===================================================== */

.mensaje-bot {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 16px;
}


.bot-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: linear-gradient( 135deg, #667044, #879154 );
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(102,112,68,.20);
}


    .bot-avatar i {
        font-size: 14px;
    }


/* =====================================================
   BURBUJA DEL BOT
===================================================== */

.burbuja-bot {
    max-width: 260px;
    padding: 12px 14px;
    background: white;
    border-radius: 4px 16px 16px 16px;
    box-shadow: 0 3px 12px rgba(0,0,0,.07);
    color: #555;
    font-size: 12px;
    line-height: 1.5;
}


    .burbuja-bot p {
        margin: 0 0 5px 0;
    }


        .burbuja-bot p:last-child {
            margin-bottom: 0;
        }


    .burbuja-bot strong {
        color: #667044;
    }


/* =====================================================
   OPCIONES
===================================================== */

.opciones-asistente {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}


    .opciones-asistente button {
        width: 100%;
        min-height: 65px;
        border: 1px solid #e4e5dc;
        border-radius: 14px;
        background: white;
        padding: 10px 12px;
        display: flex;
        align-items: center;
        gap: 11px;
        text-align: left;
        cursor: pointer;
        font-family: 'Poppins', sans-serif;
        transition: all .25s ease;
        box-shadow: 0 3px 10px rgba(0,0,0,.04);
    }


        .opciones-asistente button:hover {
            transform: translateX(4px);
            border-color: #9ba374;
            box-shadow: 0 6px 16px rgba(102,112,68,.12);
        }


/* =====================================================
   ICONOS DE OPCIONES
===================================================== */

.icono-opcion {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 11px;
    background: #f0f2e7;
    color: #667044;
    display: flex;
    align-items: center;
    justify-content: center;
}


    .icono-opcion i {
        font-size: 16px;
    }


/* =====================================================
   TEXTO OPCIÓN
===================================================== */

.texto-opcion {
    flex: 1;
}


    .texto-opcion strong {
        display: block;
        color: #4f5735;
        font-size: 12px;
        font-weight: 600;
    }


    .texto-opcion small {
        display: block;
        margin-top: 2px;
        color: #999;
        font-size: 10px;
    }


/* =====================================================
   FLECHA
===================================================== */

.flecha {
    color: #9ca286;
    font-size: 11px;
    transition: transform .25s ease;
}


.opciones-asistente button:hover .flecha {
    transform: translateX(3px);
    color: #667044;
}


/* =====================================================
   ANIMACIÓN DE MENSAJES
===================================================== */

.mensaje-nuevo {
    animation: aparecerMensaje .4s ease forwards;
}


@keyframes aparecerMensaje {

    from {
        opacity: 0;
        transform: translateY(15px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* =====================================================
   INDICADOR "ESCRIBIENDO..."
===================================================== */

.burbuja-bot.escribiendo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 55px;
    min-height: 38px;
}


    .burbuja-bot.escribiendo span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #667044;
        animation: escribir 1.2s infinite;
    }


        .burbuja-bot.escribiendo span:nth-child(2) {
            animation-delay: .2s;
        }


        .burbuja-bot.escribiendo span:nth-child(3) {
            animation-delay: .4s;
        }


@keyframes escribir {

    0%, 60%, 100% {
        transform: translateY(0);
        opacity: .4;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}


/* =====================================================
   WHATSAPP
===================================================== */

.contenedor-whatsapp {
    margin-top: 8px;
    margin-left: 43px;
    animation: aparecerMensaje .4s ease forwards;
}


.btn-contactar-whatsapp {
    width: calc(100% - 10px);
    border: none;
    border-radius: 13px;
    padding: 13px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: linear-gradient( 135deg, #667044, #879154 );
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(102,112,68,.20);
    transition: all .25s ease;
}


    .btn-contactar-whatsapp:hover {
        transform: translateY(-2px);
        box-shadow: 0 9px 20px rgba(102,112,68,.30);
    }


    .btn-contactar-whatsapp i:first-child {
        font-size: 19px;
    }


    .btn-contactar-whatsapp i:last-child {
        margin-left: auto;
        font-size: 11px;
    }


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 600px) {

    #asistenteVirtual {
        right: 15px;
        bottom: 85px;
    }


    #ventanaAsistente {
        width: calc(100vw - 30px);
        height: min(520px, calc(100vh - 120px));
        right: 0;
        bottom: 75px;
        border-radius: 18px;
    }


    #btnAsistente {
        right: 15px !important;
        bottom: 20px !important;
    }
}

/* =====================================================
   ASISTENTE VIRTUAL
===================================================== */


#asistenteVirtual {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}



/* =====================================================
   BOTÓN DEL ASISTENTE
===================================================== */

#btnAsistente {
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    min-height: 58px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: linear-gradient( 135deg, #6f7650, #555c3c ) !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 2 !important;
    box-shadow: 0 8px 22px rgba(0,0,0,.25) !important;
    /* 👇 AQUÍ ESTÁ LA ANIMACIÓN */
    animation: movimientoRobot 2.5s ease-in-out infinite !important;
    transition: box-shadow .3s ease, transform .3s ease !important;
}


/* =====================================================
   MOVIMIENTO SUAVE ARRIBA / ABAJO
===================================================== */

@keyframes movimientoRobot {

    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0);
    }
}


/* =====================================================
   HOVER
===================================================== */

#btnAsistente:hover {
    animation-play-state: paused !important;
    transform: scale(1.07) !important;
    box-shadow: 0 12px 30px rgba(85,92,60,.40) !important;
}


/* =====================================================
   ICONO
===================================================== */

#btnAsistente i {
    color: white !important;
    font-size: 23px !important;
}


/* =====================================================
   MOVIMIENTO SUAVE ARRIBA / ABAJO
===================================================== */

@keyframes movimientoRobot {

    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0);
    }
}


/* =====================================================
   HOVER
===================================================== */

#btnAsistente:hover {
    animation-play-state: paused;
    transform: scale(1.07);
    box-shadow: 0 12px 30px rgba(85,92,60,.40) !important;
}


/* =====================================================
   ICONO
===================================================== */

#btnAsistente i {
    color: white !important;
    font-size: 25px;
}


/* =====================================================
   BURBUJA DE BIENVENIDA
===================================================== */

#mensajeBienvenida {
    position: absolute;
    right: 75px;
    bottom: 8px;
    width: 255px;
    min-height: 62px;
    background: white;
    border-radius: 17px 17px 5px 17px;
    padding: 11px 13px;
    display: flex;
    align-items: center;
    gap: 9px;
    box-shadow: 0 8px 25px rgba(0,0,0,.15);
    border: 1px solid #eeeeea;
    font-family: 'Poppins', sans-serif;
    animation: aparecerBienvenida .6s ease;
}


/* =====================================================
   ANIMACIÓN DE LA BURBUJA
===================================================== */

@keyframes aparecerBienvenida {

    from {
        opacity: 0;
        transform: translateX(15px) scale(.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}


/* =====================================================
   AVATAR DE LA BURBUJA
===================================================== */

.bienvenida-avatar {
    width: 35px;
    height: 35px;
    min-width: 35px;
    border-radius: 50%;
    background: linear-gradient( 135deg, #667044, #879154 );
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}


    .bienvenida-avatar i {
        font-size: 14px;
    }


/* =====================================================
   TEXTO
===================================================== */

.bienvenida-texto {
    color: #555;
    font-size: 11px;
    line-height: 1.5;
}


    .bienvenida-texto::first-line {
        color: #4f5735;
        font-weight: 600;
    }


/* =====================================================
   PUNTA DE LA BURBUJA
===================================================== */

.bienvenida-flecha {
    position: absolute;
    right: -7px;
    bottom: 17px;
    width: 14px;
    height: 14px;
    background: white;
    transform: rotate(45deg);
    border-top: 1px solid #eeeeea;
    border-right: 1px solid #eeeeea;
}


/* =====================================================
   VENTANA DE CONVERSACIÓN
===================================================== */

#ventanaAsistente {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 360px;
    max-width: calc(100vw - 30px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 20px 55px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(.95);
    transform-origin: bottom right;
    transition: all .3s ease;
}


    /* =====================================================
   MOSTRAR CONVERSACIÓN
===================================================== */

    #ventanaAsistente.mostrar {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }


/* =====================================================
   CUANDO SE ABRE LA CONVERSACIÓN
   OCULTAMOS LA BURBUJA
===================================================== */

#asistenteVirtual:has(#ventanaAsistente.mostrar)
#mensajeBienvenida {
    opacity: 0;
    visibility: hidden;
    transform: translateX(15px) scale(.95);
    transition: all .25s ease;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 600px) {

    #asistenteVirtual {
        right: 15px;
        bottom: 25px;
    }


    #mensajeBienvenida {
        right: 72px;
        width: 220px;
        font-size: 10px;
    }


    #btnAsistente {
        width: 58px !important;
        height: 58px !important;
    }


    #ventanaAsistente {
        width: calc(100vw - 30px);
        height: calc(100vh - 110px);
        bottom: 70px;
        border-radius: 18px;
    }
}