/* Evitar bordes extraños en los logos al cargar o hacer clic */
.navbar-brand img {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Hacer que los círculos de las horas "pulsen" */
.n8n-node-center {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(30, 94, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(30, 94, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(30, 94, 255, 0); }
}


.fade-up {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(5px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}






/* --- Estilización Pro para la sección El Problema --- */

/* La sección con un fondo apenas gris para que las tarjetas blancas resalten */
.scenario-section {
    background-color: #f8fafc; 
    padding: 100px 0;
}

/* La tarjeta: ahora con el ADN de "Servicios" */
.scenario-section .n8n-card {
    .scenario-section .n8n-card {
    background: #ffffff !important;
    border: 1px solid rgba(30, 94, 255, 0.12) !important; /* Borde un pelín más marcado */
    box-shadow: 0 15px 45px rgba(30, 94, 255, 0.06) !important; /* Sombra más envolvente */
}
    border-radius: 20px !important; /* Curvatura moderna */
    padding: 1.8rem !important;
    
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.scenario-section .n8n-card:hover {
    transform: translateY(-5px);
}

/* El toque maestro: Íconos de fondo sutiles (como en tus servicios) */
.scenario-section .n8n-card::after {
    font-family: "bootstrap-icons";
    position: absolute;
    bottom: -15px;
    right: -10px;
    font-size: 5rem;
    opacity: 0.03; /* Casi invisible, pura textura */
    pointer-events: none;
}

.n8n-side--bad .n8n-card::after { content: "\f62a"; color: #ef4444; } /* Icono X */
.n8n-side--good .n8n-card::after { content: "\f52c"; color: #1e5eff; } /* Icono Robot */

/* Transformando los títulos en "Badges" Pro */
.n8n-side-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem !important;
    border: 1px solid transparent;
}

/* Estilo para el lado "Malo" */
.n8n-side--bad .n8n-side-title {
    background: rgba(239, 68, 68, 0.06);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.1);
}

/* Estilo para el lado "Bueno" */
.n8n-side--good .n8n-side-title {
    background: rgba(30, 94, 255, 0.06);
    color: #1e5eff;
    border: 1px solid rgba(30, 94, 255, 0.1);
}

/* El círculo del reloj central */
.n8n-node-center {
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    color: #64748b !important;
    font-weight: 700;
    font-family: var(--font-display);
    box-shadow: var(--shadow-sm);
}

/* Las cajas de resultado final (Outcome) */
.n8n-outcome {
    border-radius: 15px !important;
    padding: 15px 25px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
}

.n8n-outcome--bad { 
    background: #fff5f5 !important; 
    color: #c53030 !important; 
    border: 1px solid #feb2b2 !important; 
}
.n8n-outcome--good { 
    background: #ebf8ff !important; 
    color: #2b6cb0 !important; 
    border: 1px solid #bee3f8 !important; 
}




/* --- Fondo Pro: Blanco con Trama de Puntos --- */
.scenario-section {
    background-color: #ffffff; /* Volvemos al blanco puro */
    background-image: radial-gradient(#e2e8f0 0.8px, transparent 0.8px); /* Puntos sutiles */
    background-size: 24px 24px; /* Tamaño de la trama */
    position: relative;
    padding: 100px 0;
}

/* Añadimos un degrade suave en los bordes para que no "corte" con las otras secciones */
.scenario-section::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 100px;
    background: linear-gradient(to bottom, #ffffff, transparent);
    z-index: 1;
}

.scenario-section::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 100px;
    background: linear-gradient(to top, #ffffff, transparent);
    z-index: 1;
}

/* Ajustamos los iconos decorativos para que floten con elegancia */
.scenario-section .bi-moon-stars-fill, 
.scenario-section .bi-exclamation-triangle-fill {
    opacity: 0.03 !important; /* Menos es más: que apenas se intuyan */
    filter: blur(1px);
}

.n8n-side-text {
    font-size: 1.05rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.6;
}
.service-bento p {
    color: var(--gray-600);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 0;
}
.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.05rem;
    color: var(--gray-600);
}
.faq-answer {
    display: none;
    padding: 0 1.6rem 1.3rem;
    font-size: 1.05rem;
    color: var(--gray-600);
    line-height: 1.75;
    background: var(--white);
}

.market-stats-section .bento-glass {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(30, 94, 255, 0.1) !important; /* Borde celeste muy fino */
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(30, 94, 255, 0.05); /* Sombra azulada muy suave */
    transition: transform 0.3s ease;
}

.market-stats-section .bento-glass:hover {
    transform: translateY(-5px); /* Pequeña interacción al pasar el mouse */
}

.market-stats-section .bento-num-sm {
    color: #1e5eff !important;
    font-weight: 800;
    letter-spacing: -2px;
}

/* Fondo de la sección El Problema */
.scenario-section {
    background-color: #fcfdfe; /* Un blanco con un toque de azul */
}

/* El lado del "Manual" (Gris apagado) */
.n8n-side--bad .n8n-card {
    background: #f1f3f5 !important; 
    border: 1px solid #e9ecef !important;
    opacity: 0.8;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* El lado de la "IA" (Blanco brillante con borde azul) */
.n8n-side--good .n8n-card {
    background: #ffffff !important;
    border: 1px solid rgba(30, 94, 255, 0.3) !important;
    box-shadow: 0 15px 35px rgba(30, 94, 255, 0.1);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* --- Efecto 3D Timeline (Solo PC) --- */
@media (min-width: 768px) {
    /* Efecto "Valle" hacia la columna central */
    .n8n-side--bad { perspective: 1200px; }
    .n8n-side--bad .n8n-card {
        transform: rotateY(8deg) rotateX(3deg) translateZ(-10px);
        box-shadow: -10px 20px 30px rgba(0,0,0,0.03);
    }
    
    .n8n-side--good { perspective: 1200px; }
    .n8n-side--good .n8n-card {
        transform: rotateY(-8deg) rotateX(3deg) translateZ(5px); /* Un poco más elevado porque es la IA */
        box-shadow: 15px 20px 40px rgba(30, 94, 255, 0.1);
    }

    /* Interacción Magnética (Se aplanan mágicamente hacia el usuario on hover) */
    .n8n-side--bad:hover .n8n-card,
    .n8n-side--good:hover .n8n-card {
        transform: rotateY(0deg) rotateX(0deg) translateZ(30px) translateY(-5px);
        opacity: 1;
    }
    .n8n-side--good:hover .n8n-card {
        box-shadow: 0 25px 50px rgba(30, 94, 255, 0.15), inset 0 0 0 1px rgba(30, 94, 255, 0.5);
    }
    .n8n-side--bad:hover .n8n-card {
        box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    }
}

/* La línea de tiempo central */
.n8n-node-center {
    background: #ffffff !important;
    border: 2px solid #1e5eff !important;
    color: #1e5eff !important;
    font-weight: 700;
}

@media (max-width: 768px) {
    .row-mobile-scroll {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        gap: 15px !important;
        padding-bottom: 20px !important;
    }
    
    .row-mobile-scroll > div {
        flex: 0 0 85% !important; /* La tarjeta ocupa el 85% para que se vea la que sigue */
        scroll-snap-align: center !important;
    }
}

@media (min-width: 768px) {
    .text-md-start {
        text-align: center !important; 
    }
}

.bento-num-sm {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}
.bento-text-sm {
    font-size: 1.05rem;
    color: var(--gray-600);
    line-height: 1.4;
}
.fw-medium {
    font-weight: 400 !important;
}



/* Estilo Terminal Premium */
.code-terminal {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    margin-top: 1.5rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.terminal-header {
    background: #323232;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.terminal-title {
    color: #999;
    font-size: 0.75rem;
    margin-left: 10px;
    font-family: var(--font-display);
}

.terminal-body {
    padding: 20px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #ddd;
    text-align: left; /* Clave para que no se centre */
}

.terminal-body p { margin-bottom: 8px; }

/* Efecto de escritura (Opcional pero dinámico) */
.terminal-body p {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid transparent;
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

/* --- Premium Glass Window Mockup --- */
.perspective-container {
    perspective: 1500px;
}

.browser-mockup {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,255,0.7) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 0;
    transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
    box-shadow: 
        -20px 20px 60px rgba(30, 94, 255, 0.1),
        0 10px 30px rgba(0,0,0,0.05),
        inset 0 0 0 1px rgba(255,255,255,1),
        inset 0 0 20px rgba(255,255,255,0.5);
    border: 1px solid rgba(30, 94, 255, 0.2);
    overflow: hidden;
}

.browser-screen {
    background: transparent;
}

/* 3D Floating Animation */
.floating-3d {
    animation: floatGlass 6s ease-in-out infinite;
    transform-origin: center;
}

@keyframes floatGlass {
    0% { transform: perspective(1200px) rotateY(-8deg) rotateX(4deg) translateY(0px); }
    50% { transform: perspective(1200px) rotateY(-5deg) rotateX(2deg) translateY(-15px); box-shadow: -20px 30px 70px rgba(30, 94, 255, 0.15), 0 15px 40px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(255,255,255,1); }
    100% { transform: perspective(1200px) rotateY(-8deg) rotateX(4deg) translateY(0px); }
}

@media (max-width: 991px) {
    .browser-mockup {
        transform: none !important;
        animation: none !important; /* Quitar animación en mobile para texto 100% nítido */
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: #ffffff !important; /* Fondo sólido para anular el desenfoque del Glass */
        box-shadow: 0 10px 40px rgba(30, 94, 255, 0.08), inset 0 0 0 1px rgba(0,0,0,0.05) !important;
        margin-top: -1.5rem; /* Subir el elemento para que no quede tan abajo de los botones/tags */
        margin-bottom: 1rem;
    }
}

@keyframes floatMobileGlass {
    0% { transform: translateY(0px); box-shadow: 0 15px 40px rgba(30, 94, 255, 0.08), inset 0 0 0 2px rgba(255,255,255,1); }
    50% { transform: translateY(-10px); box-shadow: 0 25px 50px rgba(30, 94, 255, 0.12), inset 0 0 0 2px rgba(255,255,255,1); }
    100% { transform: translateY(0px); box-shadow: 0 15px 40px rgba(30, 94, 255, 0.08), inset 0 0 0 2px rgba(255,255,255,1); }
}

/* --- Efectos 3D Hover Globales (Nuestros Servicios, Teléfono, Pipeline) --- */
@media (min-width: 992px) {
    /* 1. El Bento Grid (Nuestros Servicios) */
    .service-bento {
        transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.6s ease !important;
    }
    .service-bento:hover {
        transform: perspective(1000px) translateZ(30px) translateY(-5px) scale(1.03) !important;
        box-shadow: 0 35px 70px rgba(30,94,255,0.15), inset 0 0 0 1px rgba(255,255,255,0.2) !important;
        z-index: 10; /* Prioridad de capa al flotar */
    }

    /* 2. El Celular (Agente en Acción) */
    .mockup-phone {
        transform: perspective(1200px) rotateY(6deg) rotateX(3deg) !important;
        box-shadow: 20px 25px 50px rgba(30, 94, 255, 0.15), inset 0 0 0 1px rgba(255,255,255,0.5) !important;
        animation: floatPhone 6s ease-in-out infinite !important;
        transform-style: preserve-3d;
    }

    /* 3. Tarjetas del Pipeline (Infraestructura) */
    .deploy-content-light {
        transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.6s ease !important;
    }
    .deploy-stage:hover .deploy-content-light {
        transform: perspective(1000px) translateX(20px) translateZ(25px) rotateY(-6deg) !important;
        box-shadow: 25px 30px 60px rgba(30, 94, 255, 0.15), inset 2px 0 0 0 rgba(30,94,255,0.6) !important;
    }
}

@keyframes floatPhone {
    0% { transform: perspective(1200px) rotateY(6deg) rotateX(3deg) translateY(0px); }
    50% { transform: perspective(1200px) rotateY(4deg) rotateX(2deg) translateY(-15px); box-shadow: 20px 35px 70px rgba(30, 94, 255, 0.2), inset 0 0 0 1px rgba(255,255,255,0.8) !important; }
    100% { transform: perspective(1200px) rotateY(6deg) rotateX(3deg) translateY(0px); }
}

/* --- Lenis Smooth Scroll --- */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   BOTÓN FLOTANTE DE WHATSAPP — PULSE ANIMATION
   ═══════════════════════════════════════════════════════ */

#il-whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 6px 20px rgba(37, 211, 102, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
  text-decoration: none;
  animation: waBounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 1s;
}

#il-whatsapp-float:hover {
  transform: scale(1.12) translateY(-3px);
  box-shadow:
    0 12px 32px rgba(37, 211, 102, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.12);
}

#il-whatsapp-float:active {
  transform: scale(0.95);
}

#il-whatsapp-float svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* Anillo pulsante alrededor del botón */
.il-wa-pulse-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #25D366;
  animation: waPulseRing 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  pointer-events: none;
}

@keyframes waPulseRing {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  80%, 100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

@keyframes waBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(40px);
  }
  60% {
    opacity: 1;
    transform: scale(1.08) translateY(-4px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

/* Mobile: un poco más chico y pegado al borde */
@media (max-width: 480px) {
  #il-whatsapp-float {
    bottom: 18px;
    right: 18px;
    width: 56px;
    height: 56px;
  }
  #il-whatsapp-float svg {
    width: 28px;
    height: 28px;
  }
}
