:root {
            --undesa-cyan: #29ABE2;
            --undesa-blue: #0071BC;
            --undesa-dark: #0f172a;
            --undesa-dark-trans: rgba(15, 23, 42, 0.9);
            --font-heading: 'Poppins', sans-serif;
            --font-body: 'Roboto', sans-serif;
        }

        body {
            font-family: var(--font-body);
            background-color: var(--undesa-dark);
            color: #fff;
            overflow-x: hidden;
        }

        h1, h2, h3, h4 { font-family: var(--font-heading); }

        /* --- 1. HERO CON VIDEO --- */
        .hero-section {
            position: relative;
            height: 100vh; /* Ocupa toda la pantalla */
            width: 100%;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
        }

        .video-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover; /* Asegura que el video cubra todo sin deformarse */
            z-index: -1;
        }

        /* Capa oscura sobre el video para leer el texto */
        .hero-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(to bottom, rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0.9));
            z-index: 0;
        }

        .hero-content {
            z-index: 1;
            position: relative;
            padding: 0 20px;
            opacity: 0; /* Animación de entrada */
            animation: fadeUp 1s ease forwards 0.5s;
        }

        .hero-title {
            font-size: 3.5rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 20px;
            text-shadow: 0 0 20px rgba(0,0,0,0.5);
        }

        .hero-subtitle {
            font-size: 1.2rem;
            margin-bottom: 30px;
            color: #cbd5e1;
        }

        /* --- 2. BARRA DE NAVEGACIÓN FLOTANTE --- */
        .navbar-custom {
            position: absolute;
            top: 0;
            width: 100%;
            z-index: 10;
            padding: 20px 0;
            transition: background 0.3s;
        }

        .logo-text { font-weight: 700; letter-spacing: 2px; color: white; text-decoration: none; font-size: 1.2rem; }
        .logo-span { color: var(--undesa-cyan); }

        /* --- 3. SECCIONES DE CONTENIDO --- */
        .section-padding { padding: 100px 0; }

        /* Tarjetas Glassmorphism para Servicios */
        .service-card {
            background: rgba(30, 41, 59, 0.6);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 15px;
            padding: 40px 30px;
            transition: all 0.3s ease;
            height: 100%;
            position: relative;
            overflow: hidden;
        }

        .service-card::before {
            content: '';
            position: absolute;
            top: 0; left: 0; width: 4px; height: 100%;
            background: var(--undesa-cyan);
            transform: scaleY(0);
            transition: transform 0.3s ease;
        }

        .service-card:hover {
            transform: translateY(-10px);
            background: rgba(30, 41, 59, 0.9);
            box-shadow: 0 20px 40px rgba(0,0,0,0.4);
        }

        .service-card:hover::before { transform: scaleY(1); }

        .service-icon {
            font-size: 3rem;
            margin-bottom: 20px;
    
            /* El degradado de fondo */
            background: -webkit-linear-gradient(45deg, var(--undesa-blue), var(--undesa-cyan));

            /* REGLAS PARA RECORTAR EL FONDO (MÁSCARA) */
            -webkit-background-clip: text; /* Para Chrome, Safari, Edge (Versiones viejas) */
            background-clip: text;         /* <--- ESTA ES LA LÍNEA QUE TE PIDE EL EDITOR (Estándar) */
    
            /* HACE EL TEXTO TRANSPARENTE PARA QUE SE VEA EL FONDO */
            -webkit-text-fill-color: transparent;
        }

        /* Botón estilo Undesa */
        .btn-undesa {
            padding: 12px 35px;
            border-radius: 50px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: white;
            background: linear-gradient(90deg, var(--undesa-blue), var(--undesa-cyan));
            border: none;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-block;
        }

        .btn-undesa:hover {
            box-shadow: 0 0 20px rgba(41, 171, 226, 0.6);
            transform: scale(1.05);
            color: white;
        }

        /* Scroll Down Indicator */
        .scroll-down {
            position: absolute;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            animation: bounce 2s infinite;
            z-index: 2;
            color: rgba(255,255,255,0.7);
            font-size: 1.5rem;
            cursor: pointer;
        }

        /* ANIMACIONES */
        @keyframes fadeUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% {transform: translateY(0) translateX(-50%);}
            40% {transform: translateY(-10px) translateX(-50%);}
            60% {transform: translateY(-5px) translateX(-50%);}
        }

        /* RESPONSIVE */
        @media (max-width: 768px) {
            .hero-title { font-size: 2rem; }
            .hero-subtitle { font-size: 1rem; }
            .section-padding { padding: 60px 0; }
        }

        /* =========================================
   FOOTER PREMIUM UNDESA
   ========================================= */
.footer-premium {
    background-color: #020407; /* Casi negro, muy elegante */
    color: #a0aec0;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(41, 171, 226, 0.1); /* Línea sutil Cyan */
}

/* Títulos del Footer */
.footer-title {
    color: white;
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 3px;
    background: var(--undesa-cyan);
    border-radius: 2px;
}

/* Enlaces con efecto Hover deslizante */
.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #a0aec0;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-links a:hover {
    color: var(--undesa-cyan);
    padding-left: 8px; /* Efecto de deslizamiento a la derecha */
}

.footer-links a i {
    font-size: 0.8rem;
    margin-right: 8px;
    color: var(--undesa-blue);
    transition: color 0.3s;
}

.footer-links a:hover i { color: var(--undesa-cyan); }

/* Items de Contacto */
.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.contact-icon {
    background: rgba(41, 171, 226, 0.1);
    color: var(--undesa-cyan);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

/* Mapa */
.map-container {
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    height: 200px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    filter: grayscale(100%) invert(92%) contrast(83%); /* Mapa estilo oscuro */
}

.copyright-bar {
    background-color: #000;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
}

/* =========================================
   MODAL LIGHT (ESTRUCTURADO)
   ========================================= */
.light-modal {
    background-color: #ffffff;
    border: none;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5); /* Sombra fuerte para resaltar sobre el fondo oscuro */
    border-radius: 12px;
    overflow: hidden; /* Asegura que el header respete los bordes redondeados */
}

/* HEADER Y FOOTER: Color suave para dar estructura */
.light-modal .modal-header,
.light-modal .modal-footer {
    background-color: #f1f5f9; /* GRIS AZULADO SUAVE */
    border-color: #e2e8f0;     /* Borde sutil */
}

.light-modal .modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
}

.light-modal .modal-footer {
    padding: 1.2rem;
}

/* BODY: Blanco puro para los inputs */
.light-modal .modal-body {
    background-color: #ffffff;
}

/* Inputs Personalizados Claros */
.light-input .form-control,
.light-input .form-select {
    background-color: #ffffff;
    border: 1px solid #cbd5e1; /* Borde un poco más visible */
    color: #334155;
    border-radius: 6px;
}

.light-input .form-control:focus,
.light-input .form-select:focus {
    background-color: #ffffff;
    border-color: var(--undesa-cyan);
    box-shadow: 0 0 0 4px rgba(41, 171, 226, 0.1); /* Glow suave cyan */
    color: #0f172a;
}

/* Etiquetas flotantes */
.light-input label {
    color: #64748b; /* Gris pizarra texto */
    background-color: transparent !important;
}

.light-input .form-control:focus ~ label,
.light-input .form-control:not(:placeholder-shown) ~ label,
.light-input .form-select ~ label {
    color: var(--undesa-cyan);
    font-weight: 600;
    background-color: transparent !important;
}

/* Botón Undesa Ajustado */
.btn-undesa {
    background: linear-gradient(90deg, var(--undesa-blue), var(--undesa-cyan));
    border: none;
    color: white;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-undesa:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(41, 171, 226, 0.4);
}

/* =========================================
   1. STICKY HEADER (Cabecera Flotante)
   ========================================= */
.undesa-sticky-nav {
    position: fixed;
    top: -100px; /* Oculto arriba de la pantalla */
    left: 0;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.95); /* Azul noche casi opaco */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(41, 171, 226, 0.2);
    padding: 10px 0;
    z-index: 1000;
    transition: top 0.4s ease-in-out; /* Animación de deslizamiento */
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.undesa-sticky-nav.visible {
    top: 0; /* Baja a la vista */
}

/* Ajustes de texto para el sticky */
.sticky-logo {
    font-size: 1rem;
    color: white;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
}

/* =========================================
   2. BOTONES FLOTANTES (WhatsApp y ScrollTop)
   ========================================= */
/* Corrección de Z-Index y Posición */
.floating-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    
    /* Z-INDEX EXTREMO: Asegura que flote sobre todo, incluso sobre el footer */
    z-index: 2147483647; 
    
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

/* ESTADO VISIBLE */
.floating-container.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* === AJUSTE CRÍTICO PARA MÓVILES === */
@media (max-width: 768px) {
    .floating-container {
        /* Subimos los botones más arriba para evitar la barra del navegador */
        bottom: 90px; 
        right: 20px; /* Un poco más pegado al borde derecho */
        gap: 10px;
    }

    /* Hacemos los botones un poco más pequeños en móvil para que no estorben */
    .float-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* Estilo Base del Botón Flotante */
.float-btn {
    width: 50px !important;  /* Forzamos el ancho */
    height: 50px !important; /* Forzamos el alto */
    border-radius: 50% !important; /* Forzamos que sea redondo */
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    font-size: 1.5rem;
    border: none; /* Asegura que no haya bordes raros */
    outline: none;
}

/* Estilo WhatsApp */
.btn-whatsapp {
    background-color: #25D366 !important;
}
.btn-whatsapp:hover {
    background-color: #1ebe57 !important;
    transform: scale(1.1);
    color: white;
}

/* Estilo Scroll Top */
.btn-scroll-top {
    background: linear-gradient(135deg, var(--undesa-blue), var(--undesa-cyan)) !important;
}
.btn-scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(41, 171, 226, 0.6);
    color: white;
}

/* Estilos para la sección de Proyectos */
.project-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 300px; /* Altura fija para uniformidad */
    object-fit: cover;
}

.project-card:hover img {
    transform: scale(1.1);
}

/* Mejora de legibilidad para Tarjetas de Proyecto */
.project-overlay {
    /* 1. DEGRADADO SUAVE: Mucho más transparente y corto */
    /* Empieza al 70% de opacidad abajo y se desvanece rápido hacia arriba */
    background: linear-gradient(to top, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.1) 60%, transparent 100%);
    
    /* Mantenemos tus ajustes de posición */
    padding: 2rem 1.5rem 1rem;
    transition: all 0.3s ease;
    /* Opcional: Si quieres que siempre se vea un poco más claro, sube la opacidad base */
    /* opacity: 1; */ 
}

/* 2. FORZAR COLOR BLANCO */
/* Importante: Usamos !important para sobrescribir la clase 'text-secondary' (gris) de Bootstrap */
.project-overlay p.text-secondary,
.project-overlay h4 {
    color: #ffffff !important;
}

/* 3. SOMBRA DE TEXTO (El truco para que resalte) */
/* Crea un contorno oscuro difuminado detrás de las letras blancas */
.project-overlay h4 {
    /* Sombra un poco más fuerte para el título principal */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.project-overlay p.text-secondary {
    /* Sombra nítida para el texto más pequeño */
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    font-weight: 500; /* Un poquito más de grosor ayuda a que no se pierda */
    letter-spacing: 0.3px;
}

/* Ajuste responsivo para el borde del contador */
@media (max-width: 767px) {
    .border-end-md {
        border-right: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
}
@media (min-width: 768px) {
    .border-end-md {
        border-right: 1px solid rgba(255,255,255,0.1) !important;
    }
}