/* =========================================
   SISTEMA DE DISEÑO KONECTA (Estilo Adquio + Efectos Apple)
   ========================================= */

:root {
    --color-primary: #0066cc;       
    --color-primary-dark: #004c99;  
    --color-secondary: #f4f7f9;     
    --color-text-dark: #1a202c;     
    --color-text-light: #4a5568;    
    --color-white: #ffffff;
    
    --shadow-soft: 0 4px 20px rgba(0, 102, 204, 0.08);
    --shadow-hover: 0 12px 30px rgba(0, 102, 204, 0.15);
    --border-radius: 10px;
    --font-main: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    color: var(--color-text-dark);
    background-color: var(--color-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   NAVEGACIÓN MEJORADA (Efecto Dinámico)
   ========================================= */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 5%; 
    background-color: rgba(255, 255, 255, 0.75); 
    backdrop-filter: blur(18px); /* Más desenfoque para estilo Apple Premium */
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0; z-index: 1000; 
    transition: all 0.3s ease;
}
.nav-brand { display: flex; align-items: center; gap: 15px; font-weight: 700; font-size: 1.2rem; color: var(--color-text-dark); text-decoration: none; }
.nav-brand img { height: 80px; transition: height 0.3s ease;}

.nav-links { list-style: none; display: flex; gap: 35px; align-items: center; }
.nav-links a { 
    text-decoration: none; 
    color: var(--color-text-dark); 
    font-weight: 500; 
    font-size: 15px; 
    position: relative; /* Para el efecto de la línea inferior */
    transition: all 0.3s ease; 
}

/* Línea animada debajo de los enlaces principales */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after, 
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover { 
    color: var(--color-primary);
    transform: translateY(-1px);
}
.nav-links a.active { color: var(--color-primary); font-weight: 700; }

/* HERO SECTION */
.hero {
    background: linear-gradient(rgba(10, 37, 64, 0.85), rgba(0, 102, 204, 0.75)), 
                url('../images/hero-fondo.webp') center center / cover no-repeat;
    color: var(--color-white); 
    text-align: center; 
    padding: 120px 5%;
}

/* BOTONES */
.btn { display: inline-block; padding: 16px 32px; border-radius: var(--border-radius); text-decoration: none; font-weight: 600; transition: all 0.3s ease; }
.btn-white { background-color: var(--color-white); color: var(--color-primary); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.btn-white:hover { background-color: #f8fafc; transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.2); color: var(--color-primary-dark); }
.btn-primary { background-color: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background-color: var(--color-primary-dark); transform: translateY(-3px); box-shadow: var(--shadow-hover); }

/* SECCIONES */
.section-padding { padding: 100px 5%; background-color: var(--color-secondary); }
.section-white { padding: 100px 5%; background-color: var(--color-white); }
.container { max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; font-size: 2.2rem; margin-bottom: 50px; font-weight: 700; color: var(--color-text-dark); }

/* IMÁGENES ESTILO APPLE (Banners gigantes) */
.apple-banner {
    padding: 60px 5%;
    background-color: var(--color-white);
    text-align: center;
}
.apple-rounded-img {
    width: 100%;
    max-width: 1000px; 
    border-radius: 24px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.08); 
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.apple-rounded-img:hover {
    transform: scale(1.02); 
}

/* TARJETAS (Efecto elevación Apple) */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.card {
    background: #ffffff; padding: 40px 30px; 
    border-radius: 18px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03); 
    border-top: 5px solid var(--color-primary); 
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1); 
    text-align: center; display: flex; flex-direction: column; align-items: center;
}
.card:hover { 
    transform: translateY(-10px) scale(1.01); 
    box-shadow: 0 20px 40px rgba(0, 102, 204, 0.12); 
    border-top-color: var(--color-primary-dark); 
}
.card img { max-width: 180px; height: auto; margin-bottom: 25px; mix-blend-mode: multiply; }
.card h3 { margin-bottom: 15px; font-size: 1.4rem; color: var(--color-text-dark); }
.card p { color: var(--color-text-light); font-size: 1rem; margin-bottom: 25px; flex-grow: 1; }

.card-link {
    display: inline-block; color: var(--color-primary); font-weight: 600; text-decoration: none;
    padding: 8px 16px; border-radius: 6px; background-color: rgba(0, 102, 204, 0.05);
    transition: all 0.2s; margin-top: auto;
}
.card-link:hover { background-color: var(--color-primary); color: var(--color-white); }

/* FOOTER */
.footer { background-color: #0a2540; color: #fff; padding: 50px 5%; text-align: center; font-size: 0.95rem; }
.footer p { color: #cbd5e1; margin-top: 10px; }

/* =========================================
   ANIMACIONES JS (Fade + Scale Up estilo Apple)
   ========================================= */
.hidden {
    opacity: 0;
    transform: translateY(50px) scale(0.95); 
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.visible {
    opacity: 1;
    transform: translateY(0) scale(1); 
}

/* =========================================
   GRILLA DE LOGOS (Marcas y Protocolos)
   ========================================= */
.logos-grid-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 50px;
    margin-top: 50px;
    margin-bottom: 50px;
}

.logo-item {
    width: 150px; 
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: invert(1) grayscale(100%); 
    opacity: 0.5;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
}

.logo-item img:hover {
    filter: invert(1) grayscale(0%);
    opacity: 1;
    transform: scale(1.15);
}

/* =========================================
   SUBMENÚ ANIMADO (Productos)
   ========================================= */
.nav-links li.menu-desplegable {
    position: relative;
    perspective: 1000px;
}

.nav-links li.menu-desplegable .submenu {
    display: block; 
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 120%; /* Empieza un poco más abajo */
    left: -20px;
    background-color: rgba(255, 255, 255, 0.95);
    min-width: 300px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.12), 0 5px 15px rgba(0,0,0,0.05);
    border-radius: 14px;
    padding: 15px 0;
    z-index: 1000;
    border: 1px solid rgba(0,0,0,0.04);
    transform: translateY(15px); /* Efecto de desplazamiento */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); /* Curva de velocidad Apple */
    pointer-events: none;
    list-style: none;
}

/* El truco: Aparece suavemente al hacer hover */
.nav-links li.menu-desplegable:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); 
    top: 100%;
    pointer-events: auto;
}

.submenu li {
    padding: 0;
    margin: 0;
}

.submenu li a {
    color: #4a5568 !important;
    padding: 12px 25px !important;
    display: block;
    font-size: 0.92rem;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    border-radius: 0;
    text-decoration: none;
}

/* Efecto de desplazamiento lateral en los ítems del submenú */
.submenu li a:hover {
    background-color: #f1f7ff !important; 
    color: var(--color-primary) !important;
    padding-left: 35px !important; /* Se mueve a la derecha */
    box-shadow: inset 4px 0 0 var(--color-primary); /* Línea lateral de énfasis */
}

.submenu-header {
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    padding: 15px 25px 8px 25px;
    color: #a0aec0;
    text-transform: uppercase;
}

.submenu-divisor {
    height: 1px;
    background-color: #eeeeee;
    margin: 10px 20px;
}

/* =========================================
   MENÚ HAMBURGUESA PARA CELULARES
   ========================================= */

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    margin-left: auto;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: #0066cc; 
    margin: 4px 0;
    border-radius: 5px;
    transition: 0.3s;
} 

/* =========================================
   RESPONSIVE DESIGN (Adaptación a Móviles)
   ========================================= */

@media (max-width: 990px) {
    .menu-toggle {
        display: flex; 
    }
    
    .nav-links {
        display: none; 
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 70px; 
        left: 0;
        background-color: #ffffff;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        padding: 20px;
        z-index: 1000;
    }

    .nav-links.active {
        display: flex; 
    }

    .nav-links li {
        text-align: left;
        margin-bottom: 10px;
        width: 100%;
    }

    .nav-links li.menu-desplegable .submenu {
        position: relative;
        display: block; 
        box-shadow: none;
        border: none;
        border-left: 2px solid #0066cc;
        margin-left: 15px;
        padding-left: 10px;
        top: 0;
        width: 100%;
        opacity: 1; /* Forzamos visibilidad en móvil */
        visibility: visible;
        transform: none; /* Quitamos la animación de vuelo en móvil para evitar bugs */
        pointer-events: auto;
    }
}

@media (max-width: 768px) {
    .grid-cards, 
    .contenedor-casos, 
    .row {
        display: grid !important;
        grid-template-columns: 1fr !important; 
        gap: 20px !important;
        width: 100% !important;
    }
    
    .card, .tarjeta-caso {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .nav-links a {
        font-size: 14px;
    }

    .hero h1 {
        font-size: 2.2rem; 
    }

    .hero p {
        font-size: 1rem;
    }

    .section-padding {
        padding: 60px 5%;
    }

    .grid-cards {
        grid-template-columns: 1fr; 
    }
    
    .feature-row {
        flex-direction: column !important; 
        padding: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .btn {
        width: 100%; 
        text-align: center;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .nav-brand img {
        height: 35px;
    }
}
/* =========================================
   CARRUSEL HERO (Swiper.js)
   ========================================= */
.hero-carousel {
    width: 100%;
    height: 60vh; /* Ocupa casi toda la pantalla */
    min-height: 400px;
    position: relative;
}

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    background-position: center;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 5%;
}

.slide-content {
    max-width: 900px;
    color: var(--color-white);
    /* Animación del texto subiendo al aparecer la foto */
    animation: fadeInUp 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.slide-content h1 {
    font-size: 2.8rem; /* Bajó de 3.5rem para que encaje perfecto sin amontonarse */
    font-weight: 700;
    margin-bottom: 15px; /* Un poco menos de margen inferior */
    text-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.slide-content p {
    font-size: 1.2rem;
    margin-bottom: 35px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    color: #f1f5f9;
}

.slide-content .btn {
    margin: 0 10px; /* Separación si pones 2 botones */
}

/* Modificando los controles por defecto de Swiper para que se vean Konecta */
.swiper-button-next, .swiper-button-prev {
    color: rgba(255, 255, 255, 0.7) !important;
    transition: all 0.3s ease;
}
.swiper-button-next:hover, .swiper-button-prev:hover {
    color: #ffffff !important;
    transform: scale(1.1);
}
.swiper-pagination-bullet {
    background: #ffffff !important;
    opacity: 0.4 !important;
    width: 10px !important;
    height: 10px !important;
    transition: all 0.3s ease;
}
.swiper-pagination-bullet-active {
    opacity: 1 !important;
    background: var(--color-primary) !important;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(0, 102, 204, 0.8);
}

/* Animación del texto */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Adaptación a móviles */
@media (max-width: 768px) {
    .hero-carousel { height: 75vh; }
    .slide-content h1 { font-size: 2.2rem; }
    .slide-content p { font-size: 1rem; }
    .swiper-button-next, .swiper-button-prev { display: none !important; } /* Ocultar flechas en móvil, se usa el dedo */
}

/* Banner para páginas internas (Soluciones, Proyectos, etc.) */
.hero-interno {
    background: linear-gradient(rgba(10, 37, 64, 0.9), rgba(0, 102, 204, 0.8)), 
                url('../images/hero-fondo.webp') center center / cover no-repeat;
    color: #ffffff; 
    text-align: center; 
    padding: 80px 5%; /* Más delgado que el inicio */
    border-bottom: 3px solid var(--color-primary);
}

.hero-interno h1 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 10px;
}

.hero-interno p {
    color: #cbd5e1;
    font-size: 1.1rem;
}