/* --- estilos.css --- */

/* IMPORTAR FUENTES PREMIUM */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --primary-blue: #0277bd;
    --accent-blue: #e1f5fe;
    --dark-blue: #004c8c;
    --text-main: #2c3e50;
    --text-light: #546e7a;
    --white: #ffffff;
    --bg-gray: #f9fbfd;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.04);
    --shadow-hover: 0 20px 40px rgba(2, 119, 189, 0.12);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Lato', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-gray);
    line-height: 1.8;
    padding-top: 80px; 
    font-weight: 400;
    overflow-x: hidden;
}

h1, h2, h3, h4 { 
    font-family: 'Playfair Display', serif;
    color: var(--primary-blue); 
    font-weight: 700; 
    margin-bottom: 1rem; 
    line-height: 1.3; 
    letter-spacing: -0.5px;
}

h2 { font-size: 2.4rem; position: relative; display: inline-block; margin-bottom: 2rem; }
h2::after {
    content: ''; display: block; width: 60px; height: 3px;
    background: var(--primary-blue); margin-top: 15px; border-radius: 2px;
    transition: width 0.3s;
}
.card:hover h2::after { width: 90px; }

p { margin-bottom: 1rem; font-size: 1.1rem; color: var(--text-light); font-weight: 300; }
strong { font-weight: 700; color: var(--text-main); }
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

/* --- HEADER & NAV --- */
header {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 15px rgba(0,0,0,0.05);
    position: fixed; top: 0; left: 0; width: 100%; height: 80px; z-index: 1000;
    backdrop-filter: blur(10px);
    transition: height 0.3s ease, box-shadow 0.3s ease;
}
header.scrolled { height: 70px; box-shadow: 0 5px 20px rgba(0,0,0,0.08); }

.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center; height: 100%;
}

.logo-img { max-height: 55px; width: auto; transition: max-height 0.3s ease; }
header.scrolled .logo-img { max-height: 45px; }

.nav-menu { display: flex; gap: 35px; }
.nav-link {
    font-family: 'Lato', sans-serif;
    font-weight: 700; color: var(--text-main); font-size: 0.95rem; 
    text-transform: uppercase; letter-spacing: 1px; position: relative; padding: 5px 0;
}
.nav-link::after {
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: 0; left: 0; background-color: var(--primary-blue);
    transition: var(--transition);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link:hover, .nav-link.active { color: var(--primary-blue); }

.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--text-main); transition: var(--transition); }

/* --- SECCIONES --- */
.container { max-width: 1200px; margin: 0 auto; padding: 90px 20px; }
.section-bg { background-color: var(--white); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 35px; }

.card {
    background: var(--white); padding: 45px; border-radius: 8px;
    box-shadow: var(--shadow-soft); transition: var(--transition);
    border-top: 4px solid transparent; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); border-top-color: var(--primary-blue); }

/* --- CARRUSEL --- */
.carousel-container {
    position: relative; width: 100%; height: 100%; min-height: 450px;
    border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-hover); background-color: #000;
}
.carousel-slide { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
.carousel-slide.active { display: block; animation: fadeEffect 1s ease-in-out; }
@keyframes fadeEffect { from {opacity: 0.5} to {opacity: 1} }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: center; }
.carousel-slide.active img { animation: kenBurns 5s ease-out forwards; }
@keyframes kenBurns { from { transform: scale(1); } to { transform: scale(1.1); } }
.carousel-btn {
    cursor: pointer; position: absolute; top: 50%; width: 50px; height: 50px; margin-top: -25px;
    color: white; font-weight: bold; font-size: 24px; transition: 0.3s ease; border: none;
    background-color: rgba(0,0,0,0.4); border-radius: 50%; display: flex; align-items: center; justify-content: center;
    z-index: 10; opacity: 0;
}
.carousel-container:hover .carousel-btn { opacity: 1; }
.carousel-btn.next { right: 15px; }
.carousel-btn.prev { left: 15px; }
.carousel-btn:hover { background-color: var(--primary-blue); transform: scale(1.1); }

/* --- MAPA --- */
.map-frame-serious {
    height: 100%; min-height: 450px; border: 1px solid #ccc; padding: 10px; background-color: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); position: relative;
}
.map-frame-serious::before {
    content: ''; position: absolute; top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 2px solid var(--text-main); pointer-events: none; z-index: 2;
}
.map-iframe-container { width: 100%; height: 100%; position: relative; z-index: 1; border: 1px solid #999; }

/* --- HERO --- */
.hero {
    height: calc(100vh - 80px); background-size: cover; background-position: center; background-attachment: fixed;
    display: flex; align-items: center; justify-content: center; text-align: center; color: var(--white); position: relative;
}
.hero::before { content: ''; position: absolute; top:0; left:0; right:0; bottom:0; background: rgba(0, 0, 0, 0.1); }
.hero-content { position: relative; z-index: 2; max-width: 900px; padding: 20px; }

/* Botones */
.btn {
    display: inline-block; padding: 18px 50px; background-color: var(--primary-blue);
    color: var(--white); border-radius: 4px; font-family: 'Lato', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; font-size: 0.9rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15); transition: var(--transition); border: 2px solid var(--primary-blue);
}
.btn:hover { background-color: var(--white); color: var(--primary-blue); transform: translateY(-3px); box-shadow: 0 15px 30px rgba(0,0,0,0.2); }

/* --- IMÁGENES --- */
.img-responsive { width: 100%; height: auto; border-radius: 6px; box-shadow: var(--shadow-soft); transition: var(--transition); }
.img-responsive:hover { transform: scale(1.01); box-shadow: var(--shadow-hover); }
.profile-pic { 
    width: 160px; height: 160px; border-radius: 50%; object-fit: cover; 
    margin: 0 auto 25px; border: 3px solid var(--accent-blue); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); transition: var(--transition);
}
.card:hover .profile-pic { border-color: var(--primary-blue); }
.client-logo {
    max-width: 100%; max-height: 100px; width: auto; object-fit: contain;
    filter: grayscale(100%); opacity: 0.7; transition: all 0.4s ease; display: block; margin: 0 auto;
}
.card:hover .client-logo { filter: grayscale(0%); opacity: 1; transform: scale(1.1); }

/* --- ANIMACIONES --- */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }
.stagger-delay:nth-child(1) { transition-delay: 0.1s; }
.stagger-delay:nth-child(2) { transition-delay: 0.2s; }
.stagger-delay:nth-child(3) { transition-delay: 0.3s; }
.stagger-delay:nth-child(4) { transition-delay: 0.4s; }
.stagger-delay:nth-child(5) { transition-delay: 0.5s; }

body { opacity: 0; animation: pageIn 0.8s forwards; }
@keyframes pageIn { to { opacity: 1; } }

footer { background-color: #1a252f; color: var(--white); padding: 80px 0 30px; }
.footer-copy { text-align: center; margin-top: 50px; padding-top: 30px; border-top: 1px solid #34495e; font-size: 0.85rem; color: #7f8c8d; text-transform: uppercase; letter-spacing: 1px; }

/* --- ESTILOS DEL CHATBOT PROFESIONAL --- */
.chatbot-toggler {
    position: fixed; bottom: 30px; right: 30px;
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--primary-blue); color: #fff; border: none; outline: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; box-shadow: 0 5px 20px rgba(0,0,0,0.3); z-index: 9999;
    transition: all 0.3s ease;
}
.chatbot-toggler:hover { transform: scale(1.1); background: var(--dark-blue); }

/* Ventana del Chat */
.chatbot-container {
    position: fixed; right: 30px; bottom: 100px;
    width: 380px; background: #fff; border-radius: 15px;
    overflow: hidden; opacity: 0; pointer-events: none;
    transform: scale(0.5); transform-origin: bottom right;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); z-index: 9999;
    transition: all 0.3s ease; font-family: 'Lato', sans-serif;
}

/* Estado Abierto */
body.show-chatbot .chatbot-container { opacity: 1; pointer-events: auto; transform: scale(1); }
body.show-chatbot .chatbot-toggler { transform: rotate(90deg); background: var(--text-main); }

/* Header del Chat */
.chatbot-header {
    background: var(--primary-blue); padding: 15px 20px; 
    display: flex; align-items: center; justify-content: space-between;
}
.chatbot-header h3 { color: #fff; font-size: 1.1rem; margin: 0; font-family: 'Playfair Display', serif; }
.header-controls { display: flex; gap: 10px; }
.header-btn {
    color: #fff; cursor: pointer; font-size: 1.2rem; background: none; border: none; padding: 0;
    opacity: 0.8; transition: 0.3s;
}
.header-btn:hover { opacity: 1; transform: scale(1.1); }

/* TEXTO ONLINE */
.online-text {
    margin: 0; font-size: 0.8rem; 
    color: #00e676; /* Verde Brillante */
    font-weight: bold; text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Cuerpo del Chat */
.chatbot-body {
    padding: 20px; height: 400px; overflow-y: auto; background: #f7f9fc;
    display: flex; flex-direction: column; gap: 15px; scroll-behavior: smooth;
}
.chatbot-body::-webkit-scrollbar { width: 6px; }
.chatbot-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* Burbujas de Mensaje */
.chat-message { display: flex; align-items: flex-end; }
.chat-message.bot { justify-content: flex-start; }
.chat-message.user { justify-content: flex-end; }

.chat-bubble {
    max-width: 80%; padding: 12px 16px; font-size: 0.95rem; line-height: 1.4;
    border-radius: 12px 12px 12px 2px; background: #e0e0e0; color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); animation: popIn 0.3s ease;
}
.chat-message.user .chat-bubble {
    background: var(--primary-blue); color: #fff;
    border-radius: 12px 12px 2px 12px;
}

@keyframes popIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Animación de "Escribiendo..." */
.typing-indicator {
    display: flex; gap: 5px; padding: 10px 15px; background: #e0e0e0; 
    border-radius: 12px 12px 12px 2px; width: fit-content;
}
.typing-dot {
    width: 6px; height: 6px; background: #666; border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* Botones de Preguntas */
.chat-options { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.option-btn {
    background: #fff; border: 1px solid var(--primary-blue); color: var(--primary-blue);
    padding: 10px 15px; border-radius: 20px; cursor: pointer; text-align: left;
    font-size: 0.9rem; transition: 0.3s; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    animation: fadeUp 0.5s ease forwards;
}
.option-btn:hover { background: var(--primary-blue); color: #fff; transform: translateX(5px); }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hamburger { display: block; z-index: 1001; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .nav-menu {
        position: fixed; left: -100%; top: 0; 
        flex-direction: column; background-color: var(--white); width: 100%; height: 100vh;
        justify-content: center; align-items: center;
        text-align: center; transition: 0.4s ease-in-out; box-shadow: none;
    }
    .nav-menu.active { left: 0; }
    .nav-item { margin: 20px 0; opacity: 0; transform: translateY(20px); transition: 0.4s; }
    .nav-menu.active .nav-item { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
    
    .grid-2 { grid-template-columns: 1fr; gap: 40px; }
    .carousel-container { min-height: 300px; } 

    /* Chatbot Móvil */
    .chatbot-container { right: 0; bottom: 0; width: 100%; height: 100%; border-radius: 0; }
    .chatbot-body { height: calc(100% - 70px); }
    .chatbot-toggler { bottom: 20px; right: 20px; }
}