/* =========================================
   1. VARIABLES Y ESTILOS BASE
   ========================================= */
:root {
    --color-bg: #FF981E;       /* Naranja */
    --color-primary: #2A2826;  /* Gris Oscuro */
    --color-white: #FFFFFF;
    --color-blue: #0d6efd;     /* Azul botón */
    --color-green: #25d366;    /* Verde WhatsApp */
    --font-main: 'Montserrat', sans-serif;
    --font-logo: 'Pacifico', cursive;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-primary);
    /* Borra overflow-x: hidden de aquí */
    position: relative; /* Agrega esto para estabilizar */
}



/* Y agrega esta nueva regla para controlar el desborde de forma segura */
/* Solo esto en tu CSS base, nada de height 100% */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: clip; 
    /* El scroll-behavior déjalo si quieres */
    scroll-behavior: smooth;
}

/* Utilidades de Texto */
.fw-black { font-weight: 900; }
.fw-bold { font-weight: 700; }
.text-primary-color { color: var(--color-bg) !important; }
.text-orange { color: var(--color-bg); }
.text-white { color: #fff !important; }
.leading-relaxed { line-height: 1.8; }
img { max-width: 100%; height: auto; }

/* =========================================
   1. NAVBAR BASE Y SMART ANIMATION
   ========================================= */
.navbar-custom {
    position: fixed !important;
    top: 0;
    width: 100%;
    z-index: 1050; 
    background-color: #ff981e; /* Fondo Naranja Base */
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), 
                background-color 0.8s ease, 
                padding 0.8s ease;
}

/* Estado cuando se oculta (BAJANDO) */
.navbar-hidden {
    transform: translateY(-100%);
    background-color: #1a1a1a !important; /* Swap a Gris Oscuro */
}

/* Estilo cuando el usuario baja un poco (Scrolled) */
.navbar-custom.scrolled {
    background-color: rgba(255, 152, 30, 0.98);
    box-shadow: 0 4px 25px rgba(0,0,0,0.15);
    padding: 10px 0;
}

/* =========================================
   2. EFECTOS CINEMÁTICOS (SOLO ESCRITORIO)
   ========================================= */
@media (min-width: 992px) {
    .navbar-custom .navbar-brand,
    .navbar-custom .nav-link,
    .navbar-custom .logo span,
    .navbar-custom .btn-cta {
        color: #1a1a1a !important; /* Texto Oscuro en fondo Naranja */
        transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
        transform-origin: center;
        backface-visibility: hidden;
    }

    /* Efecto Warp al ocultarse */
    .navbar-hidden .navbar-brand,
    .navbar-hidden .nav-link,
    .navbar-hidden .logo span,
    .navbar-hidden .btn-cta {
        color: #ff981e !important; /* Swap a Texto Naranja */
        letter-spacing: 10px !important;
        transform: scale(1.2);
        opacity: 0;
    }
}

/* =========================================
   3. MENÚ MÓVIL REPARADO (SIDEBAR)
   ========================================= */
@media (max-width: 991px) {
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh !important;
        background-color: #1a1a1a !important; /* Sidebar Gris Oscuro Sólido */
        display: flex !important;
        flex-direction: column;
        padding: 40px 0 0 0 !important; /* Sin paddings laterales para el swap full width */
        transition: right 0.4s ease-in-out !important;
        z-index: 1100;
    }

    .navbar-collapse.show { right: 0; }

    /* Enlaces Rectangulares (Sin círculos) */
    .mobile-link {
        width: 100%;
        display: block;
        padding: 18px 25px !important;
        color: #ffffff !important;
        font-size: 1.1rem !important;
        font-weight: 600;
        border-radius: 0 !important; /* Cuadrado total */
        border-bottom: 1px solid rgba(255,255,255,0.05);
        letter-spacing: normal !important; /* Evita que el Warp rompa el texto en móvil */
        transform: none !important;
        opacity: 1 !important;
    }

    /* Botón Contacto en Móvil (Rectángulo Naranja) */
    .mobile-contact-btn {
        background-color: #ff981e !important;
        color: #1a1a1a !important;
        border: none !important;
        margin-top: auto; /* Lo empuja al final del menú */
    }

    /* Toggler (Hamburguesa) siempre visible y oscuro */
    .navbar-toggler {
        border: none;
        color: #1a1a1a;
    }
    
    .navbar-hidden .navbar-toggler {
        color: #ff981e; /* Cambia a naranja cuando la barra es oscura */
    }
}

/* =========================================
   4. HERO INTERACTIVO (REPULSIÓN)
   ========================================= */
.hero-text-interactive {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
    display: inline-block;
    touch-action: none; /* Crucial para que funcione en celular */
}

.hero-text-interactive:hover .main-title {
    text-shadow: 0 10px 20px rgba(255, 152, 30, 0.2);
}

/* =========================================
   3. MENÚ LATERAL MÓVIL (Sidebar Negro) - ESTILO FULL WIDTH
   ========================================= */
@media (max-width: 991px) {
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100dvh !important; 
        display: flex !important;
        flex-direction: column;
        justify-content: flex-start !important;
        background-color: #1a1a1a;
        z-index: 1050;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1) !important;
        box-shadow: -10px 0 50px rgba(0,0,0,0.5);
        overflow-y: auto; 
        overscroll-behavior: contain;
        
        /* CAMBIO CLAVE 1: Quitamos el padding lateral del contenedor principal */
        /* Así los hijos pueden tocar los bordes */
        padding: 40px 0 25px 0 !important; 
    }

    /* Estado Abierto */
    .navbar-collapse.show { right: 0; }

    /* Backdrop y Collapsing (Mantenemos igual) */
    .navbar-collapse.show::before {
        content: ''; position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
        background: rgba(0,0,0,0.6); z-index: -1; transform: translateX(-100%); touch-action: none;
    }

    .navbar-collapse.collapsing {
        right: -100%; height: 100vh !important; display: flex !important; position: fixed;
        top: 0; width: 85%; max-width: 320px; background-color: #1a1a1a; z-index: 1050;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1) !important;
        padding: 40px 0 25px 0 !important; /* Igual que arriba */
        justify-content: flex-start !important; flex-direction: column;
    }

    /* CAMBIO CLAVE 2: Devolvemos el padding al Header para que el logo no se pegue */
    .mobile-menu-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 0 25px 15px 25px; /* Padding interno solo aquí */
        margin-bottom: 10px;
        width: 100%;
        flex-shrink: 0;
    }

    /* Estilos del logo y botón cerrar (Igual) */
    .mobile-menu-header .logo { color: #ffffff !important; font-size: 1.3rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
    .btn-close-custom { background: transparent; border: 2px solid rgba(255,255,255,0.2); color: #fff; width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; }

    /* CAMBIO CLAVE 3: Lista de Enlaces sin huecos */
    .navbar-nav {
        width: 100%;
        gap: 0 !important; /* Sin espacio entre items */
        margin-top: 0;
    }

    .nav-item { width: 100%; }

    /* CAMBIO CLAVE 4: El Enlace Full Width (De borde a borde) */
    .mobile-link {
        font-size: 1rem !important;
        color: rgba(255,255,255,0.7) !important;
        width: 100%;
        display: block;
        padding: 18px 25px; /* Relleno generoso */
        border-radius: 0 !important; /* Cuadrado, no redondo */
        transition: all 0.3s ease;
        font-weight: 600;
        border-bottom: 1px solid rgba(255,255,255,0.03); /* Línea divisoria sutil */
        border-left: 0 solid transparent;
        margin: 0 !important;
    }

    /* Efecto al Activar: Tira Naranja Completa */
    .mobile-link:hover, .mobile-link.active {
        color: #fff !important;
        background-color: var(--color-bg); /* Fondo Naranja */
        /* Opcional: Si es muy fuerte, usa: rgba(255, 152, 30, 0.2) */
        
        padding-left: 35px; /* Desplazamiento del texto */
        border-left: 5px solid #fff; /* Borde blanco decorativo */
    }

    /* CAMBIO CLAVE 5: El botón CTA (Agendar) necesita aire */
    /* Como es el último hijo, le damos padding al contenedor para que no se pegue */
    .nav-item:last-child {
        padding: 30px 25px; 
    }
    
    .btn-cta {
        width: 100%;
        background-color: var(--color-bg);
        color: var(--color-primary);
        padding: 12px 0;
        font-size: 0.9rem;
        text-transform: uppercase;
        font-weight: 700;
        box-shadow: 0 4px 15px rgba(255, 152, 30, 0.3);
        border-radius: 8px; /* Este sí lo mantenemos redondito */
    }
}

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero-section { min-height: 100vh; padding-top: 120px; padding-bottom: 60px; position: relative; overflow: hidden; }
.main-title { line-height: 0.9; letter-spacing: -3px; color: var(--color-primary); }
.subtitle { font-weight: 800; letter-spacing: 3px; font-size: 1.1rem; }

.circle-bg {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 90%; max-width: 500px; aspect-ratio: 1/1;
    background-color: rgba(255, 255, 255, 0.2); border-radius: 50%; z-index: 1;
}
/* Apuntamos DIRECTAMENTE a la clase que tiene tu imagen */
.detective-img {
    /* 1. ROMPEMOS LAS CADENAS DE BOOTSTRAP */
    width: 900px !important;       /* El tamaño que quieras */
    max-width: unset !important;   /* ESTO ES VITAL: Anula el 'img-fluid' */
    max-height: unset !important;  /* Anula cualquier límite de altura */

    /* 2. LA CENTRAMOS A LA FUERZA */
    position: relative;
    left: 50%;
    transform: translateX(-50%);   /* Esto la centra perfectamente aunque sea gigante */
    
    /* 3. AJUSTES FINOS */
    display: block;
    z-index: 10;                   /* Para que tape al círculo y no al revés */
    bottom: -60px;                 /* Ajusta esto para subirla o bajarla */
    
    /* Sombra opcional para realismo */
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3)); 
}

/* =========================================
   AJUSTES PARA MÓVIL (Pantallas menores a 768px)
   ========================================= */
@media (max-width: 768px) {
    .detective-img {
        /* 1. TAMAÑO EN CELULAR */
        width: 580px !important;  /* <- CAMBIA ESTE NÚMERO para agrandar/achicar */
        
        /* 2. POSICIÓN VERTICAL */
        bottom: -41px !important; /* <- CAMBIA ESTE NÚMERO para subir/bajar */
        
        /* Aseguramos que siga centrado */
        left: 50%;
        transform: translateX(-50%);
    }
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

/* =========================================
   5. LOADER (PANTALLA DE CARGA)
   ========================================= */
.section-loader {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--color-primary);
    z-index: 50; display: flex; justify-content: center; align-items: center;
    transition: transform 0.8s cubic-bezier(0.8, 0, 0.2, 1);
}
.section-loader.finish { transform: translateY(-100%); }
.loader-content { text-align: center; position: relative; z-index: 2; }

.loader-brand {
    font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 3.5rem; color: #fff;
    position: relative; overflow: hidden; margin-bottom: 20px;
    animation: fadeUpText 0.8s ease-out forwards; opacity: 0;
}
.loader-brand::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--color-bg);
    animation: revealBlock 1.2s cubic-bezier(0.7, 0, 0.3, 1) forwards;
    transform: translateX(-101%);
}

.loader-progress {
    width: 200px; height: 4px; background: rgba(255, 255, 255, 0.2);
    margin: 0 auto; border-radius: 4px; overflow: hidden; opacity: 0;
    animation: fadeIn 0.5s ease-out 0.5s forwards;
}
.progress-bar {
    height: 100%; width: 0; background-color: var(--color-bg);
    animation: fillProgress 1.5s ease-in-out forwards; 
}
.wait-for-loader { opacity: 0 !important; transition: none !important; }
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Usa min-height para evitar saltos con la barra del navegador */
    height: 100dvh; 
    background-color: #ff9800; /* Tu color naranja */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* Evita cualquier desbordamiento */
    overflow: hidden;
    touch-action: none;
}


/* Animaciones Loader */
@keyframes revealBlock { 0% { transform: translateX(-101%); } 40%, 60% { transform: translateX(0); } 100% { transform: translateX(101%); } }
@keyframes fadeUpText { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fillProgress { to { width: 100%; } }
@keyframes fadeIn { to { opacity: 1; } }

/* =========================================
   6. SECCIONES Y COMPONENTES
   ========================================= */
/* Marquee */
.marquee-wrapper { overflow: hidden; white-space: nowrap; }
.marquee-content { display: inline-block; animation: marquee 30s linear infinite; font-weight: 800; font-size: 1.2rem; opacity: 0.9; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Sección Nosotros */
.section-padding { padding: 100px 0; }
.bg-decoration {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 25vw; font-weight: 900; color: rgba(255, 255, 255, 0.03); z-index: 1; pointer-events: none;
}

/* =========================================
   ANIMACIÓN REVEAL-PRO (Minimalista y Fluida)
   ========================================= */

.reveal-pro {
    opacity: 0;
    /* Movimiento muy corto (solo 15px) para evitar la tosquedad */
    transform: translateY(15px);
    /* Usamos una curva de velocidad 'Out-Expo' para máxima suavidad */
    transition: 
        transform 1.0s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 1.0s cubic-bezier(0.19, 1, 0.22, 1) !important;
    will-change: transform, opacity;
}

.reveal-pro.active {
    opacity: 1;
    transform: translateY(0);
}

/* Tarjetas con diseño premium y estático */
.mv-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    transition: background 0.4s ease, border-color 0.4s ease;
}

.mv-card:hover {
    background: rgba(255, 152, 30, 0.05); /* Naranja muy tenue */
    border-color: rgba(255, 152, 30, 0.3);
}

/* Estilo para los iconos */
.icon-mv .material-icons-outlined {
    font-size: 2.5rem;
    color: var(--color-bg); /* Tu naranja */
    margin-bottom: 1rem;
    display: block;
}

/* Sección Servicios */
.service-card {
    background: var(--color-white); border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.service-card:hover { transform: translateY(-12px); box-shadow: 0 25px 50px rgba(0,0,0,0.15); }
.icon-box { width: 55px; height: 55px; background-color: var(--color-bg); border-radius: 15px; display: flex; align-items: center; justify-content: center; color: var(--color-primary); }
.icon-box span { font-size: 30px; }

/* Footer */
.footer-monkey { background-color: var(--color-primary); color: #fff; padding-top: 80px; padding-bottom: 30px; font-size: 0.9rem; }
.footer-logo { font-family: var(--font-logo); font-size: 3rem; color: #fff; text-decoration: none; }
.footer-links a, .footer-contact li { color: #ccc; text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--color-bg); }
.reclamaciones-btn { border: 1px solid #fff; padding: 8px 15px; border-radius: 5px; display: inline-block; }
.social-icons a { color: #fff; font-size: 1.5rem; margin: 0 10px; transition: transform 0.3s, color 0.3s; }
.social-icons a:hover { color: var(--color-bg); transform: translateY(-5px); }
.google-partner-badge { background: #fff; width: 130px; padding: 15px 10px 8px; border-radius: 10px; overflow: hidden; margin-top: 20px; }
.premier-strip { background: #555; color: #fff; font-size: 0.65rem; font-weight: bold; margin-top: 8px; margin-left: -10px; margin-right: -10px; padding: 4px 0; }
.dev-credit { margin-left: 10px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.3); }
.dev-link { color: var(--color-bg) !important; font-weight: 800; text-decoration: none; }

/* =========================================
   7. BOTONES FLOTANTES
   ========================================= */
.floating-container {
    position: fixed; bottom: 30px; right: 30px; z-index: 1000;
    display: flex; flex-direction: row; align-items: center; gap: 15px;
}
.btn-float {
    display: flex; align-items: center; justify-content: center; color: #fff; text-decoration: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-float:hover { transform: translateY(-5px) scale(1.05); }

.btn-blue {
    background-color: #2A2826; 
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 700; font-size: 0.9rem; white-space: nowrap; overflow: hidden;
    max-width: 200px; opacity: 1; margin-right: 0;
}
/* Clase para ocultar botón azul */
.btn-blue.hide-btn {
    max-width: 0; padding: 12px 0; opacity: 0; pointer-events: none;
}
.btn-green { background-color: var(--color-green); width: 60px; height: 60px; border-radius: 50%; font-size: 2rem; }
/* =========================================
   CORRECCIÓN BOTONES FLOTANTES MÓVIL
   ========================================= */
@media (max-width: 991px) {
    .floating-container {
        display: flex !important;
        position: fixed !important;
        
        /* FUERZA MÁXIMA */
        z-index: 2147483647 !important; /* El número más alto permitido en CSS */
        
        bottom: 90px !important;
        right: 20px !important;
        
        /* TRUCO GPU: Esto arregla el bug de que se oculten tras el navbar */
        transform: translateZ(0); 
        -webkit-transform: translateZ(0);
        
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}
/* 4. AJUSTE PARA MÓVIL (Por si quieres ajustar algo solo en celular) */
@media (max-width: 991px) {
    .floating-container {
        /* En celular los pegamos un poquito más al borde si quieres */
        bottom: 15px !important; 
        right: 15px !important;
    }
    
    /* Si en celular los sientes MUY grandes, baja estos números un poco */
    .btn-green {
        width: 65px !important;
        height: 65px !important;
        font-size: 35px !important;
    }
}
/* =========================================
   8. ANIMACIONES SCROLL (OPTIMIZADAS PRO)
   ========================================= */
.animate-on-scroll {
    opacity: 0;
    /* Curva Bezier "Expo Out": Movimiento ultra suave y premium */
    transition: opacity 1.2s cubic-bezier(0.19, 1, 0.22, 1), 
                transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: opacity, transform;
}

/* Usamos translate3d para forzar aceleración de GPU */
.fade-up { transform: translate3d(0, 40px, 0); }
.zoom-in { transform: scale(0.9); }

/* Reduje la distancia de 80px a 50px para que sea más sutil y rápido */
.slide-right { transform: translate3d(-50px, 0, 0); }
.slide-left { transform: translate3d(50px, 0, 0); }

.animate-on-scroll.active { 
    opacity: 1; 
    transform: translate3d(0, 0, 0) scale(1); 
}

/* =========================================
   9. OPTIMIZACIÓN RESPONSIVA (CELULAR)
   ========================================= */
@media (max-width: 991px) {
    /* Hero ajustado */
    .hero-section { padding-top: 100px; padding-bottom: 40px; text-align: center; }
    .circle-bg { width: 280px; height: 280px; }
    
    /* Tipografía que no se rompe */
    .main-title { font-size: 13vw; margin-bottom: 15px; }
    .subtitle { font-size: 0.9rem; }
    .lead { font-size: 1rem; padding: 0 15px; }

    /* Botones Hero apilados */
    .hero-section .d-flex { flex-direction: column; align-items: center; gap: 15px !important; width: 100%; }
    .hero-section .btn { width: 80%; max-width: 300px; padding: 12px 0; }

    /* Loader responsivo */
    .loader-brand { font-size: 2.2rem; }
    .loader-progress { width: 150px; }

    /* Footer ajustado */
    .dev-credit { display: block; border: none; margin-top: 10px; padding: 0; }
    
    /* Botones flotantes pequeños */
    .btn-blue { padding: 10px 15px; font-size: 0.8rem; height: 45px; }
    .btn-green { width: 50px; height: 50px; font-size: 1.5rem; }
}
/* =========================================
   CORRECCIÓN FINAL: MENÚ CORTADO
   ========================================= */

/* Cuando el menú está abierto (detectado por la clase que pondremos con JS),
   desactivamos el transform para que el 'fixed' funcione respecto a la pantalla
   y no respecto al navbar pequeño */
.navbar-custom.menu-open {
    transform: none !important; 
    background-color: transparent !important; /* Opcional: si quieres que se vea limpio */
}

/* Forzamos al menú lateral a usar unidades de pantalla real (dvh) 
   para evitar problemas con la barra de direcciones del celular */
@media (max-width: 991px) {
    .navbar-collapse {
        height: 100dvh !important; /* Dynamic Viewport Height */
        top: 0 !important;
        bottom: 0 !important;
        max-height: none !important;
    }
    
    /* Aseguramos que el contenido sea scrolleable si la pantalla es muy chica */
    .navbar-collapse.show {
        overflow-y: auto !important; 
    }
}
/* =========================================
   SECCIÓN PORTAFOLIO
   ========================================= */
.portfolio-item {
    height: 300px; /* Altura fija para uniformidad */
    cursor: pointer;
}

.portfolio-item img {
    height: 100%;
    object-fit: cover; /* Recorta la imagen para llenar el espacio sin deformarse */
    transition: transform 0.5s ease;
}

/* La capa oscura que aparece encima */
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 152, 0, 0.9); /* Tu color naranja con transparencia (o usa rgba(0,0,0,0.8) para negro) */
    opacity: 0; /* Invisible por defecto */
    transition: all 0.4s ease;
    transform: translateY(20px); /* Empieza un poquito abajo */
}

/* EFECTOS AL PASAR EL MOUSE (HOVER) */
.portfolio-item:hover .portfolio-overlay {
    opacity: 1; /* Se vuelve visible */
    transform: translateY(0); /* Sube a su posición original */
}

.portfolio-item:hover img {
    transform: scale(1.1); /* La imagen de fondo hace un zoom suave */
}

.bg-orange {
    background-color: var(--color-primary) !important;
}
/* =========================================
   ANIMACIÓN PARA OCULTAR BOTONES FLOTANTES
   ========================================= */
.floating-container {
    /* Agregamos transición para que se mueva suave */
    transition: transform 0.4s ease, opacity 0.4s ease !important;
}

/* Esta es la clase que JS pondrá cuando bajes */
.floating-container.btn-hidden {
    transform: translateY(150px) !important; /* Los baja 150px fuera de la pantalla */
    opacity: 0 !important;
    pointer-events: none !important; /* Evita clicks accidentales cuando no se ven */
}
/* ARREGLO CRÍTICO: Romper el 'Containing Block' cuando el menú está abierto */
.navbar-custom.menu-open {
    transform: none !important;       /* Anula el movimiento */
    will-change: auto !important;     /* Anula optimizaciones que crean contextos */
    filter: none !important;          /* Por si acaso */
    position: fixed !important;       /* Asegura que se quede quieto */
    top: 0 !important;
}

/* Aseguramos que el menú negro (hijo) sepa que debe llenar la pantalla */
.navbar-custom.menu-open .navbar-collapse {
    position: fixed !important; /* Refuerza la posición fija a la pantalla */
    top: 0 !important;
    height: 100dvh !important;
}
/* =========================================
   ESTILOS DEL FORMULARIO DE CONTACTO
   ========================================= */

/* Caja de información izquierda */
.contact-info-box {
    transition: transform 0.3s ease;
}
.contact-info-box:hover {
    transform: translateY(-5px);
}

.icon-contact {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 152, 30, 0.1); /* Naranja suave */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-bg);
}

.social-mini a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.3s;
}
.social-mini a:hover {
    background-color: var(--color-bg);
    color: #fff;
    transform: translateY(-3px);
}

/* Estilos de los Inputs del Formulario */
.contact-form .form-control, 
.contact-form .form-select {
    border: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding-left: 20px;
}

.contact-form .form-control:focus, 
.contact-form .form-select:focus {
    box-shadow: 0 0 0 4px rgba(255, 152, 30, 0.15); /* Sombra naranja al escribir */
    border-color: var(--color-bg);
    background-color: #fff;
}

/* Botón de Enviar */
.btn-submit {
    background-color: var(--color-bg);
    color: #fff;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(255, 152, 30, 0.2);
}

.btn-submit:hover {
    background-color: #e68a1b; /* Un naranja un poco más oscuro */
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(255, 152, 30, 0.3);
}

/* Decoración naranja en la esquina del formulario */
.form-decoration {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background-color: var(--color-bg);
    border-radius: 50%;
    opacity: 0.1;
}
/* =========================================
   SECCIÓN DE MÉTRICAS (STATS)
   ========================================= */

.stats-section {
    position: relative;
    background-color: #1a1a1a; /* Color de respaldo */
    overflow: hidden;
}

/* Imagen de fondo (Parallax opcional) */
.stats-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* URL de una foto de oficina oscura/tech. Puedes cambiarla */
    background-image: url('https://images.unsplash.com/photo-1522071820081-009f0129c71c?ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Efecto Parallax (se queda quieta al bajar) */
    z-index: 0;
}

/* Capa oscura encima de la foto para que se lea el texto */
.stats-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(42, 40, 38, 0.92); /* Gris oscuro muy opaco (Tono de tu marca) */
    z-index: 1;
}

/* Círculo del icono */
.stat-icon-circle {
    width: 70px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.05); /* Blanco muy transparente */
    border: 1px solid rgba(255, 152, 30, 0.3); /* Borde naranja sutil */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.stat-icon-circle span {
    font-size: 35px;
    color: var(--color-white);
}

/* Efecto Hover: El icono se pinta de naranja y sube */
.stat-item:hover .stat-icon-circle {
    background-color: var(--color-bg);
    border-color: var(--color-bg);
    transform: translateY(-5px);
}

.stat-item:hover .stat-icon-circle span {
    color: #fff;
}
/* =========================================
   ANIMACIÓN DEL FOOTER (Elegancia Pro)
   ========================================= */

/* Reutilizamos la lógica Pro pero ajustada para el fondo oscuro del footer */
.footer-monkey .reveal-pro {
    opacity: 0;
    transform: translateY(20px); /* Movimiento vertical sutil */
    transition: 
        transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: transform, opacity;
}

.footer-monkey .reveal-pro.active {
    opacity: 1;
    transform: translateY(0);
}

/* Detalle interactivo para los iconos de redes sociales */
.social-icons a {

    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
    
}

.social-icons a:hover {
    transform: translateY(-5px) scale(1.1);
    color: var(--color-bg) !important; /* Tu naranja corporativo */
}

/* Créditos del desarrollador */
.dev-link {
    color: var(--color-bg);
    text-decoration: none;
    font-weight: 700;
    transition: opacity 0.3s ease;
}

.dev-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}
/* Eliminamos el anillo de enfoque y la sombra por defecto de Bootstrap */
.btn-cta:focus, 
.btn-cta:active, 
.btn-cta:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    /* Mantenemos el fondo naranja para que el usuario sepa que hizo clic */
    background-color: var(--color-bg) !important;
    border-color: transparent !important;
}
/* =========================================
   ESTILO CRÉDITO ARDEVSTUDIO EN CONTACTO
   ========================================= */

.dev-link-contact {
    color: var(--color-bg) !important; /* Tu naranja Agencia PE */
    text-decoration: none !important;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-block;
}

.dev-link-contact:hover {
    color: #fff !important; /* Cambia a blanco al pasar el mouse */
    transform: translateX(5px); /* Desplazamiento sutil a la derecha */
}

/* Ajuste para la línea divisoria sutil */
.footer-contact .border-top {
    border-color: rgba(255, 255, 255, 0.1) !important;
}


/* =========================================
   CARRUSEL INFINITO - HYBRID ENGINE
   ========================================= */

/* 1. CONTENEDOR PRINCIPAL */
.carousel-container {
    position: relative;
    width: 100%;
    /* Padding generoso para que las sombras al hacer hover no se corten */
    padding: 50px 0; 
    overflow: hidden; 
    touch-action: pan-y; /* Permite scroll vertical, bloquea horizontal */
    background: transparent;
    min-height: 400px; /* Evita saltos de layout al cargar */
}

/* 2. PISTA (TRACK) */
.services-track {
    display: flex;
    flex-wrap: nowrap; /* CRÍTICO: Nunca bajar de línea */
    gap: 20px;
    
    /* ESTADO INICIAL: Invisible hasta que JS lo prepare (evita el "flicker") */
    opacity: 0; 
    transition: opacity 0.5s ease;
    
    /* El ancho lo calculará el contenido */
    width: max-content; 
    
    /* Posición inicial */
    transform: translateX(0);
    will-change: transform;
    
    cursor: grab;
    cursor: -webkit-grab;
    
    /* Padding interno extra por seguridad */
    padding: 0 20px; 
}

/* Clase que JS activa cuando termina de clonar */
.services-track.ready {
    opacity: 1;
}

.services-track.active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

/* 3. TARJETAS */
.service-card-item {
    width: 280px; 
    min-width: 280px;
    flex-shrink: 0; 
    
    position: relative;
    user-select: none; 
    -webkit-user-drag: none;
    
    transition: transform 0.2s ease;
}

.service-card-item:hover {
    transform: translateY(-8px); /* Efecto de flotar */
    z-index: 5;
}

/* 4. DISEÑO INTERNO DE LA TARJETA (Aquí estaba el hueco) */
.service-card-inner {
    background: #fff;
    border-radius: 20px;
    padding: 30px 20px;
    height: 100%;
    min-height: 300px;
    
    /* Flexbox para centrar todo */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    
    /* Sombra suave inicial */
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card-item:hover .service-card-inner {
    box-shadow: 0 20px 40px rgba(0,0,0,0.15); /* Sombra fuerte al hover */
    border-color: var(--color-bg); /* Borde naranja */
}

/* Elementos decorativos */
.card-pattern {
    position: absolute; top: 0; left: 0; width: 100%; height: 6px;
    background: var(--color-bg); opacity: 0.8;
}

.icon-box {
    width: 65px; height: 65px;
    background-color: #f8f9fa; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--color-primary); font-size: 2rem;
    margin-bottom: 15px;
    pointer-events: none;
}

.service-card-item h3 {
    font-size: 1.1rem;
    font-weight: 900;
    margin-bottom: 5px;
    pointer-events: none;
}

.expand-icon {
    margin-top: auto; padding-top: 15px; 
    color: var(--color-bg); opacity: 0.6;
    transition: transform 0.3s;
}

.service-card-item:hover .expand-icon {
    transform: scale(1.2); opacity: 1;
}

/* OCULTAR FLECHAS (Ya no se usan en este modo) */
.carousel-btn { display: none !important; }


/* =========================================
   5. MODAL SUPERPUESTO (POP-UP)
   ========================================= */
.service-modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(10, 10, 10, 0.9);
    z-index: 9999;
    
    display: flex; align-items: center; justify-content: center;
    
    opacity: 0; pointer-events: none; 
    transition: opacity 0.3s ease;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.service-modal-backdrop.active {
    opacity: 1; pointer-events: all;
}

.service-modal-content {
    background: #fff;
    width: 100%; max-width: 450px;
    border-radius: 25px;
    position: relative;
    overflow: hidden;
    
    transform: translateY(50px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    padding: 40px 30px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    text-align: center;
}

.service-modal-backdrop.active .service-modal-content {
    transform: translateY(0) scale(1);
}

/* Decoración Modal */
.modal-header-pattern {
    position: absolute; top: 0; left: 0; width: 100%; height: 12px;
    background-image: repeating-linear-gradient(45deg, var(--color-bg) 0, var(--color-bg) 15px, var(--color-primary) 15px, var(--color-primary) 30px);
}

.close-modal-btn {
    position: absolute; top: 15px; right: 15px;
    background: transparent; border: none; 
    width: 35px; height: 35px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #999; transition: all 0.3s;
}
.close-modal-btn:hover { background: #f0f0f0; color: var(--color-primary); }

.modal-icon-wrapper {
    width: 80px; height: 80px; margin: 0 auto 20px auto;
    background: var(--color-bg); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 20px rgba(255, 152, 30, 0.3);
}
.modal-icon-wrapper span { font-size: 40px; }

#modalTitle { color: var(--color-primary); letter-spacing: -1px; }
#modalDesc { font-size: 0.95rem; line-height: 1.6; margin-bottom: 25px; color: #555; }

/* =========================================
   FILTROS DE PORTAFOLIO (Carrusel Horizontal Móvil)
   ========================================= */

/* 1. Estilo Base (PC / Laptop) - Centrado y elegante */
.portfolio-filter-wrapper {
    display: flex;
    justify-content: center; /* Centrado horizontalmente */
    flex-wrap: wrap;         /* Si no caben, bajan de línea (seguridad para PC) */
    gap: 10px;               /* Espacio entre botones */
}

/* 2. Estilo Móvil (Celulares) - Scroll Horizontal */
@media (max-width: 768px) {
    .portfolio-filter-wrapper {
        display: flex;
        justify-content: flex-start; /* Alineado a la izquierda para empezar el scroll */
        flex-wrap: nowrap;           /* OBLIGATORIO: Prohibido bajar de línea */
        
        overflow-x: auto;            /* Activa el deslizamiento horizontal */
        padding-bottom: 15px;        /* Espacio para el dedo */
        
        /* Estética App Nativa */
        -webkit-overflow-scrolling: touch; /* Inercia suave en iPhone */
        scrollbar-width: none;             /* Ocultar barra en Firefox */
        
        /* Opcional: Hacer que los botones toquen los bordes de la pantalla */
        margin-left: -12px;  /* Rompe el margen del container de Bootstrap */
        margin-right: -12px;
        padding-left: 20px;  /* Espacio inicial */
        padding-right: 20px; /* Espacio final */
    }

    /* Ocultar barra de scroll en Chrome/Safari */
    .portfolio-filter-wrapper::-webkit-scrollbar {
        display: none;
    }

    /* Asegurar que los botones no se aplasten */
    .portfolio-filter-wrapper .filter-btn {
        flex-shrink: 0;      /* No te encojas */
        white-space: nowrap; /* No partas el texto */
    }
}