/* ==========================================================================
   1. CARGA DE FUENTE LOCAL (.TTF)
   ========================================================================== */
@font-face {
    font-family: 'ForteTTF';
    src: url('fuentes/FORTE.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ==========================================================================
   2. ESTILOS GENERALES Y CONFIGURACIÓN RAÍZ ELÁSTICA
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

body {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #1e293b;
    
    /* Convierte todo el flujo del sitio en un resorte vertical para el footer */
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

/* Compatibilidad absoluta con formularios de servidor en Web Forms (.aspx) */
form#form1 {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    width: 100%;
    margin: 0;
    padding: 0;
}

footer {
    background-color: #212529;
    color: #f8f9fa;
    text-align: center;
    padding: 20px;
    font-size: 14px;
    width: 100%;
    margin-top: auto !important; /* Fuerza el anclaje inferior */
    border-top: 3px solid #0056b3;
    z-index: 10;
}

/* ==========================================================================
   3. BARRA DE NAVEGACIÓN (NAV) CON DEGRADADO CORPORATIVO
   ========================================================================== */
.navbar {
    background: linear-gradient(to right, #0284c7 0%, #eab308 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-name {
    display: flex !important;
    align-items: baseline !important; 
    gap: 6px !important;              
    
    /* SOLUCIÓN CRÍTICA: Impide que el texto salte de línea o se ponga en vertical */
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important; /* Fuerza a mantener toda la frase unida */
}

.brand-large {
    font-family: 'ForteTTF', sans-serif;
    font-size: 3.2rem;               
    font-weight: normal;             
    text-transform: uppercase;       
    text-shadow: 3px 3px 2px rgba(0, 0, 0, 1);
    display: inline-block;
    letter-spacing: -2px;
    
    /* Evita que las letras D-K-R se encojan o se aplasten en pantallas pequeñas */
    flex-shrink: 0 !important; 
}

.letra-azul {
    color: #0B25AE;
    font-family: inherit;
    display: inline-block;
}

.letra-amarilla {
    color: #facc15; 
    font-family: inherit;
    display: inline-block;
}

.brand-small {
    font-size: 1.4rem;               
    font-weight: 500;                
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9); 
    text-transform: none;            
    text-shadow: 2px 2px 1px rgba(0, 0, 0, 1); 
    
    /* Evita que la palabra Informática salte abajo */
    flex-shrink: 0 !important; 
}

/* ENLACES DEL MENÚ HORIZONTAL */
.nav-menu {
    display: flex;         
    flex-direction: row;   
    gap: 32px;             
    align-items: center;   
    list-style: none;      
    margin-left: auto;     
}

.nav-menu li {
    position: relative; 
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 8px 0;    
    display: inline-block;
    transition: color 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;      
    left: 0;
    width: 100%;       
    height: 3px;       
    background-color: #ffffff; 
    transform: scaleX(0); 
    transition: transform 0.3s ease; 
    transform-origin: center; 
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* ==========================================================================
   4. BOTONES DESTACADOS DE LA NAVBAR
   ========================================================================== */
.btn-clientes {
    background-color: #1e293b; 
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease; 
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    white-space: nowrap !important; 
}

.btn-clientes:hover {
    background-color: #22c55e; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4); 
}

.btn-remoto {
    background-color: #FF0000; 
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease; 
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    white-space: nowrap !important; 
    display: inline-block;
}

.btn-remoto:hover {
    background-color: #ffffff; 
    color: #FF0000;
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4); 
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff; 
    cursor: pointer;
}

/* ==========================================================================
   5. CONTENIDO PRINCIPAL, LOGOTIPO Y FONDO (SÓLO PÁGINA INICIO)
   ========================================================================== */
.main-content {
    flex: 1 0 auto; /* Empuja el footer hacia el extremo inferior de la pantalla */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

main.main-content {
    display: flex !important;
    flex-direction: column !important;
}


/* Capa de fondo tecnológico sutil */
main.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url(imagenes/fondo001.jpg); 
    background-size: cover;        
    background-position: center;   
    background-repeat: no-repeat;
    opacity: 0.20;                 
    z-index: 1;                    
}

.footer {
    flex-shrink: 0;
}

/* Caja del logotipo central expandida */
.logo-box {
    text-align: center;
    position: relative;
    z-index: 2; 
    animation: fadeInLogo 1s ease-out forwards;
}

.logo-img {
    width: 100% !important;
    max-width: 450px !important; 
    height: auto !important;
    display: block;
    margin: 0 auto 20px auto;
    filter: drop-shadow(0px 10px 20px rgba(0, 0, 0, 0.15));
}

.subtitle {
    font-size: 1.4rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 15px;
}

@keyframes fadeInLogo {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   6. SECCIÓN SERVICIOS: BOTONERA VERTICAL RESPONSIVA (MÓVILES)
   ========================================================================== */
@media (max-width: 768px) {
    main.servicios-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center; 
        gap: 20px;
        padding-top: 100px !important;
    }

    .servicios-menu {
        width: 100% !important;
        max-width: 280px; 
        display: flex !important;
    }
}







/* ==========================================================================
   8. ENCAJE RESPONSIVO DE BORDES Y CONTROL DE LA SOMBRA PARPADEANTE
   ========================================================================== */

/* ESTADO 1: Pantallas pequeñas (Móvil/Tablet) -> Borde Azul de 4px Fijo */
@media (max-width: 992px) {
    #bloque-publicidad {
        border: 4px solid #003366 !important; /* Cambia a azul al estar minimizada */
        border-radius: 8px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important; /* Sombra estándar oscura */
        animation: none !important; /* Detiene el parpadeo en móvil */
    }
}

/* ESTADO 2: Pantalla Completa (Escritorio) -> Borde Naranja con Sombra Parpadeante */
@media (min-width: 993px) {
    #bloque-publicidad {
        border: 5px solid #ff6600 !important; /* Borde naranja de 5px */
        border-radius: 8px !important;
        
        /* Activamos la animación de la sombra perimetral naranja en los 4 lados */
        animation: parpadeo-sombra-naranja 1.5s infinite ease-in-out !important;
    }
}

/* MOTOR DE ANIMACIÓN: Hace parpadear el color del marco y el brillo de la sombra naranja */
@keyframes parpadeo-sombra-naranja {
    0% {
        border-color: #ff6600 !important;
        box-shadow: 0 0 30px rgba(255, 102, 0, 0.9) !important; /* Resplandor naranja potente */
    }
    50% {
        border-color: #cc3300 !important; /* Tono naranja oscuro de transición */
        box-shadow: 0 0 10px rgba(255, 102, 0, 0.1) !important; /* Sombra atenuada al mínimo */
    }
    100% {
        border-color: #ff6600 !important;
        box-shadow: 0 0 30px rgba(255, 102, 0, 0.9) !important; /* Recupera brillo máximo */
    }
}


/* ==========================================================================
   9. CORRECCIÓN DE FLUJO HORIZONTAL Y CENTRADO VERTICAL EN ESCRITORIO
   ========================================================================== */

@media (min-width: 993px) {
    /* 1. Neutralizamos la columna global y forzamos el modo FILA (Izquierda - Derecha) */
    main.main-content.main-content-responsive {
        flex-direction: row !important;
        justify-content: center !important;  /* Centra el conjunto horizontalmente */
        align-items: center !important;      /* Centra verticalmente logo y publicidad */
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        height: calc(100vh - 80px) !important; /* Aprovecha el alto total visible bajo la navbar */
        padding: 80px 40px 0 40px !important;
        box-sizing: border-box !important;
    }

    /* 2. El bloque del logo/contenido se expande ocupando el espacio izquierdo de forma alineada */
    #bloque-contenido {
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        height: 100% !important;
    }

    /* 3. La publicidad se fija estrictamente a la derecha y se centra de manera autónoma */
    #bloque-publicidad {
        display: flex; /* Quitamos el !important para permitir que JS lo oculte */
        align-items: center !important;
        height: auto !important;
        margin-left: 40px !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
    }
}








/* Estilos del Footer */
.webdkr-footer {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.9); /* Azul oscuro translúcido */
    border-top: 2px solid #0284c7; /* Línea superior azul corporativo */
    padding: 20px 0;
    margin-top: auto; /* Empuja el footer abajo si usas flexbox en el body */
    font-family: sans-serif;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: #cbd5e1; /* Gris azulado del proyecto */
    font-size: 14px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-legal {
    color: #ffffff !important; /* Blanco puro brillante para contraste */
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-legal:hover {
    color: #38bdf8 !important; /* Azul claro brillante al pasar el cursor */
    text-decoration: underline;
}

.separador {
    color: #0284c7;
}

/* Adaptación pantallas menores a 768px */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}


/* Texto legal en formulario */
.texto-legal-formulario {
    font-size: 11px;
    line-height: 1.4;
    color: #cbd5e1; /* Gris azulado para integrarse sin saturar */
    text-align: justify;
    margin-top: 15px;
    border-top: 1px solid rgba(2, 132, 199, 0.3); /* Línea sutil azul corporativo */
    padding-top: 10px;
}

.texto-legal-formulario a {
    color: #38bdf8 !important; /* Azul claro brillante para el enlace */
    text-decoration: underline;
}

.texto-legal-formulario a:hover {
    color: #ffffff !important; /* Blanco al pasar el cursor */
}







/* ==========================================================================
   ESTILOS DEL NAV UNIFICADO (ESCRITORIO)
   ========================================================================== */
.webdkr-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px; /* Altura fija controlada */
    background-color: rgba(15, 23, 42, 0.95); /* Azul oscuro corporativo */
    border-bottom: 2px solid #0284c7;
    z-index: 10000; /* Siempre por encima de todo */
    font-family: sans-serif;
    box-sizing: border-box;
}

.nav-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo {
    color: #ffffff;
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #38bdf8;
}

.btn-acceso {
    background-color: #0284c7;
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
}

.btn-acceso:hover {
    background-color: #0369a1;
}

/* BOTÓN HAMBURGUESA (Oculto en escritorio) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle .barrita {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ==========================================================================
   VERSION MÓVIL (Menos de 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex; /* Mostramos la hamburguesa */
    }

    .nav-menu {
        position: absolute;
        top: 70px; /* Justo debajo de la barra del nav */
        left: 0;
        width: 100%;
        background-color: rgba(15, 23, 42, 0.98);
        border-bottom: 2px solid #0284c7;
        flex-direction: column; /* Botones uno debajo de otro */
        gap: 0;
        padding: 0;
        max-height: 0; /* Oculto por defecto mediante colapso */
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }

    /* Clase que activará JavaScript al pulsar el botón */
    .nav-menu.abierto {
        max-height: 300px; /* Abre el menú de forma fluida */
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu .nav-link {
        display: block;
        padding: 15px 0;
        border-bottom: 1px solid rgba(2, 132, 199, 0.1);
        width: 100%;
    }
    
    .nav-menu li:last-child .nav-link {
        border-bottom: none;
    }
}





/* ==========================================================================
   ESTILOS COMPLEMENTARIOS PARA CONTROL RESPONSIVO DEL NAV ACTUAL
   ========================================================================== */

/* Ocultamos el botón hamburguesa en pantallas grandes de forma predeterminada */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
}

/* Solo modificamos el comportamiento si la pantalla baja de 768px */
@media (max-width: 768px) {
    .menu-toggle {
        display: block !important; /* Mostramos tu botón SVG original */
    }

    /* Transformamos la lista a formato vertical desplegable */
    #nav-links {
        position: absolute;
        top: 70px; /* Ajusta a la altura en píxeles de tu .navbar si difiere */
        left: 0;
        width: 100%;
        background-color: rgba(15, 23, 42, 0.98) !important;
        border-bottom: 2px solid #0284c7;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none;
        max-height: 0; /* Cerrado por defecto */
        overflow: hidden;
        display: flex !important;
        transition: max-height 0.4s ease-in-out;
        z-index: 10000;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    }

    /* Clase que inyectará el JS para abrir el acordeón */
    #nav-links.abierto {
        max-height: 380px !important;
    }

    /* Estiramos los botones para que ocupen todo el ancho táctil en móvil */
    #nav-links li {
        width: 100%;
        text-align: center;
    }

    #nav-links .nav-link, 
    #nav-links .btn-clientes, 
    #nav-links .btn-remoto {
        display: block !important;
        width: 100% !important;
        padding: 15px 0 !important;
        box-sizing: border-box;
        margin: 0 !important;
        border-radius: 0 !important;
        background-color: transparent !important;
        border-bottom: 1px solid rgba(2, 132, 199, 0.1);
    }
}
