/* --- VARIABLES --- */
:root {
    --primary-green: #2E7D32;
    --primary-dark: #1B5E20;
    --accent-gold: #F9A825;
    --dark-text: #1a1a1a;
    --gray-text: #555555;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --nav-height: 80px;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }
body { font-family: 'Open Sans', sans-serif; color: var(--dark-text); background-color: var(--bg-light); line-height: 1.6; overflow-x: hidden; }

h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; font-weight: 700; line-height: 1.2; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- UTILIDADES --- */
.btn-primary {
    background-color: var(--primary-green);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    display: inline-block;
    border: 2px solid var(--primary-green);
}
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-2px); }

.btn-outline {
    background-color: transparent;
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    border: 2px solid white;
    display: inline-block;
}
.btn-outline:hover { background-color: white; color: var(--primary-green); }

.bg-light { background-color: var(--bg-light); }

/* --- HEADER --- */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
    transition: var(--transition);
}
header.sticky { height: 70px; box-shadow: var(--shadow-md); }

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--primary-green); font-size: 1.2rem; font-family: 'Montserrat', sans-serif; }
.logo img { height: 80px; width: auto; }

/* Navegación Desktop */
.main-nav { display: flex; align-items: center; gap: 30px; height: 100%; }
.nav-link { font-weight: 600; font-size: 0.95rem; color: var(--dark-text); position: relative; }
.nav-link:hover { color: var(--primary-green); }
.nav-link i { font-size: 0.8rem; margin-left: 5px; transition: transform 0.3s; }

/* Dropdown Desktop */
.has-dropdown { position: relative; height: 100%; display: flex; align-items: center; }
.has-dropdown:hover .nav-link i { transform: rotate(180deg); }

.dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: white;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    border-top: 4px solid var(--primary-green);
    padding: 10px 0;
}
.has-dropdown:hover .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.dropdown li a {
    display: block;
    padding: 10px 20px;
    font-size: 0.9rem;
    color: var(--gray-text);
    border-bottom: 1px solid #f0f0f0;
}
.dropdown li:last-child a { border-bottom: none; }
.dropdown li a:hover { background-color: #f0f5f1; color: var(--primary-green); padding-left: 25px; }

/* Botón Contacto en Nav */
.btn-nav {
    background-color: var(--primary-green);
    color: white !important;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
}
.btn-nav:hover { background-color: var(--primary-dark); box-shadow: 0 4px 10px rgba(46, 125, 50, 0.3); }

/* --- HERO SLIDER --- */
.hero-slider {
    position: relative;
    height: 100vh; /* O usa 100dvh para mejor compatibilidad móvil */
    width: 100%; /* Cambiar 100vw por 100% evita el scroll horizontal */
    max-width: 100%;
    /* resto de tus estilos... */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    overflow: hidden; /* Asegura que nada se salga */
}

.slider-container, .slide, .overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}
.slide { background-size: cover; background-position: center; opacity: 0; transition: opacity 1s ease-in-out; }
.slide.active { opacity: 1; }
.overlay { background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.7)); z-index: 1; }

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}

.hero-title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.hero-logo-dji { width: 120px; filter: brightness(0) invert(1); }
.hero-content h1 { font-size: 3.5rem; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); }
.hero-content p { font-size: 1.25rem; margin-bottom: 30px; font-weight: 300; }
.hero-btns { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

/* --- STATS SECTION --- */
.stats-section {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    background: var(--primary-green);
    color: white;
    padding: 40px 20px;
    margin-top: -5px; /* Fix gap */
}
.stat-item { text-align: center; padding: 20px; min-width: 200px; }
.stat-item i { font-size: 2.5rem; margin-bottom: 10px; color: var(--accent-gold); }
.stat-item h3 { font-size: 2.5rem; margin-bottom: 5px; }
.stat-item p { font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }

/* --- SECCIONES GENERALES --- */
section { padding: 80px 20px; max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 60px; }
.subtitle { color: var(--accent-gold); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; font-size: 0.9rem; display: block; margin-bottom: 10px; }
.section-title { color: var(--primary-green); font-size: 2.5rem; position: relative; display: inline-block; }

/* --- EMPRESA / NOSOTROS --- */
.empresa-container { display: flex; align-items: center; gap: 50px; flex-wrap: wrap; }
.empresa-text, .empresa-img { flex: 1; min-width: 300px; }
.empresa-img img { border-radius: 20px; box-shadow: var(--shadow-md); }
.empresa-text p { margin-bottom: 20px; color: var(--gray-text); font-size: 1.05rem; }
.check-list li { margin-bottom: 15px; display: flex; align-items: center; gap: 15px; font-weight: 600; }
.check-list i { color: var(--primary-green); background: #e8f5e9; padding: 5px; border-radius: 50%; }

/* --- CARDS SERVICIOS --- */
.grid-container { 
    display: grid; 
    /* Cambiamos 280px a 250px para dar más aire en móviles pequeños */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 20px; /* Reducimos el gap original de 30px */
}

@media (max-width: 480px) {
    .grid-container {
        grid-template-columns: 1fr; /* Una sola columna obligatoria */
        padding: 0 10px; /* Un poco de margen extra a los lados */
    }
}

.card {
    background: white; border-radius: 15px; overflow: hidden;
    box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid #eee;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-10px); box-shadow: var(--shadow-md); }
.card-img { position: relative; height: 220px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card:hover .card-img img { transform: scale(1.1); }
.icon-box {
    position: absolute;
    bottom: 20px; 
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--accent-gold);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 2; 
}
.card-body { padding: 30px 25px; flex-grow: 1; display: flex; flex-direction: column; }
.card h3 { font-size: 1.4rem; margin-bottom: 15px; color: var(--dark-text); }
.card p { color: var(--gray-text); margin-bottom: 20px; font-size: 0.95rem; flex-grow: 1; }
.card-link { color: var(--primary-green); font-weight: 700; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.card-link:hover { gap: 12px; }

/* --- TECNOLOGIA / CTA --- */
.tech-section { background-color: white; padding: 100px 20px; }
.tech-container {
    display: flex; align-items: center; justify-content: space-between; gap: 50px;
    background: #f1f8e9; padding: 50px; border-radius: 30px; flex-wrap: wrap;
}
.tech-content { flex: 1; min-width: 300px; }
.tech-image-wrapper { flex: 1; min-width: 300px; text-align: center; }
.tech-image-wrapper img { max-height: 300px; width: auto; display: inline-block; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15)); }
.tech-list { margin: 30px 0; }
.tech-list li { display: flex; gap: 15px; margin-bottom: 20px; }
.tech-list i { font-size: 1.5rem; color: var(--primary-green); margin-top: 5px; }
.tech-list strong { display: block; color: var(--dark-text); font-size: 1.1rem; }
.tech-list small { color: var(--gray-text); font-size: 0.95rem; }

/* --- FOOTER --- */
footer { background-color: #111; color: #ccc; padding: 60px 20px 20px; }
.footer-container { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 50px; justify-content: space-between; }
.footer-col { flex: 1; min-width: 280px; }
.footer-logo { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; color: white; }
.contact-data p { margin-bottom: 12px; display: flex; align-items: center; gap: 15px; font-size: 0.95rem; }
.social-icons { display: flex; gap: 15px; margin-top: 25px; }
.social-icons a {
    width: 40px; height: 40px; background: #333; color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; transition: 0.3s;
}
.social-icons a:hover { background: var(--primary-green); transform: translateY(-3px); }

/* Formulario Footer */
.contact-form input, .contact-form textarea {
    width: 100%; padding: 12px; margin-bottom: 10px;
    border: none; border-radius: 5px; background: #333; color: white; font-family: inherit;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--primary-green); background: #444; }
.full-width { width: 100%; border-radius: 5px; }

.copyright { text-align: center; border-top: 1px solid #333; margin-top: 50px; padding-top: 20px; font-size: 0.85rem; }

/* --- WHATSAPP FLOAT --- */
.whatsapp-float {
    position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px;
    background: #25d366; color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 2rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); z-index: 2000;
    transition: var(--transition); animation: pulse 2s infinite;
}
.whatsapp-float:hover { background: #20b858; transform: scale(1.1); }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* --- ANIMACIONES SCROLL --- */
.reveal, .reveal-hero { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.reveal.active, .reveal-hero.active { opacity: 1; transform: translateY(0); }

/* --- RESPONSIVE --- */
.menu-toggle { display: none; font-size: 1.5rem; cursor: pointer; color: var(--dark-text); }

@media (max-width: 1024px) {
    .menu-toggle { display: block; }
    
    .main-nav {
        position: absolute; top: var(--nav-height); left: 0; width: 100%;
        background: white; flex-direction: column; height: 0; overflow: hidden;
        transition: height 0.4s ease; box-shadow: 0 10px 10px rgba(0,0,0,0.1); align-items: flex-start;
    }
    .main-nav.active { height: auto; padding: 20px 0; }
    .main-nav > li { width: 100%; }
    .nav-link {
        font-size: 1.1rem; /* Texto un poco más grande */
        padding: 20px; /* Más área de toque */
        border-bottom: 1px solid #eee; /* Separador visual sutil */
    }
    
    
    /* Dropdown Móvil */
    .has-dropdown { display: block; height: auto; }
    .has-dropdown:hover .dropdown { position: static; opacity: 1; visibility: visible; transform: none; } /* Reset para mobile */
    .dropdown {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border-top: none; padding: 0; display: none; /* Oculto por defecto */
        background: #f8f9fa; width: 100%;
    }
    .dropdown.dropdown-active { display: block; } /* Clase activada por JS */
    .dropdown li a { padding-left: 50px; font-size: 0.85rem; }
    
    .dropdown-toggle { display: flex; justify-content: space-between; align-items: center; }
    .btn-nav {
        margin-top: 20px;
        width: 80%; /* Que no ocupe todo el ancho pero sí sea grande */
        text-align: center;
        padding: 15px;
    }
    

    .hero-content h1 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
    .empresa-container, .tech-container { flex-direction: column; }
    .stats-section { flex-direction: column; gap: 30px; }
    .hero-content h1 { font-size: 2rem; }
    
    .btn-outline, .btn-primary { width: 100%; text-align: center; }
    .hero-btns {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        max-width: 300px; /* Para que no se estiren infinitamente en tablets */
        margin: 0 auto; /* Centrar los botones */
    }

    .btn-primary, .btn-outline {
        width: 100%; /* Botones full width */
        display: block;
        text-align: center;
        padding: 15px 20px; /* Zona de toque más grande */
    }
}
.footer-content {
    max-width: 1200px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px; margin-bottom: 40px;
}
.footer-col h4 { color: white; margin-bottom: 20px; font-size: 1.2rem; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a:hover { color: var(--primary-green); padding-left: 5px; }
/* --- RESPONSIVE OPTIMIZADO --- */
/* Muestra el botón hamburguesa solo en móvil/tablet */
.menu-toggle { 
    display: none; 
    font-size: 1.8rem; 
    cursor: pointer; 
    color: var(--dark-text);
    transition: var(--transition);
}

/* Tablet y Móvil (max-width: 1024px) */
@media (max-width: 1024px) {
    
    /* Mostrar toggle */
    .menu-toggle { display: block; }
    
    /* Contenedor de Navegación */
    .main-nav {
        position: fixed; 
        top: var(--nav-height); /* Empieza justo debajo del header */
        left: 0; 
        width: 100%;
        height: calc(100vh - var(--nav-height)); /* Ocupa el resto de la altura */
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        
        flex-direction: column; 
        align-items: center;
        justify-content: flex-start; /* Alineación arriba para permitir scroll */
        padding: 40px 0;
        gap: 20px;
        
        transform: translateX(100%); /* Oculto a la derecha */
        transition: transform 0.4s ease-in-out;
        box-shadow: none;
        overflow-y: auto; /* IMPORTANTE: Permite scroll si el menú es muy alto */
    }

    /* Clase activa (JS) */
    .main-nav.active { 
        transform: translateX(0); 
    }
    
    /* Enlaces del menú */
    .main-nav > li {
        width: 100%;
        text-align: center;
        opacity: 0; /* Animación de entrada */
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }
    
    /* Animación escalonada al abrir */
    .main-nav.active > li {
        opacity: 1;
        transform: translateY(0);
    }
    
    .nav-link { 
        font-size: 1.2rem; 
        display: block;
        padding: 15px;
        width: 100%;
    }

    /* --- DROPDOWN MÓVIL --- */
    .has-dropdown { 
        display: flex; 
        flex-direction: column; 
        align-items: center;
        width: 100%;
    }
    
    /* Reset total de estilos desktop para el dropdown */
    .dropdown {
        position: static; /* Ya no flota, ahora ocupa espacio */
        opacity: 1; 
        visibility: visible; 
        transform: none;
        box-shadow: none; 
        border-top: none; 
        padding: 0; 
        
        display: none; /* Oculto por defecto (display none para no ocupar espacio) */
        background: #f4f4f4; /* Un gris muy suave para diferenciar submenú */
        width: 100%; 
        text-align: center;
    }
    
    /* Clase activa del dropdown (agregada por JS) */
    .dropdown.dropdown-active { 
        display: block; 
        animation: fadeIn 0.3s ease;
    }
    
    .dropdown li a { 
        padding: 15px 0; 
        font-size: 1rem;
        border-bottom: 1px solid #e0e0e0;
        color: var(--gray-text);
    }

    /* Botón de Contacto en móvil */
    .btn-nav {
        margin-top: 20px;
        display: inline-block;
        width: auto;
    }

    /* Ajustes generales de texto móvil */
    .hero-content h1 { font-size: 2.2rem; }
    .section-title { font-size: 2rem; }
}

/* Móviles Pequeños (max-width: 768px) */
@media (max-width: 768px) {
    section { padding: 50px 20px; }
    
    /* Stackear columnas */
    .empresa-container, 
    .tech-container, 
    .stats-section { 
        flex-direction: column; 
        gap: 40px; 
    }
    
    /* Footer a una columna */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-col { align-items: center; }
    .social-icons, .contact-data p, .footer-logo { justify-content: center; }

    /* Ajustes Hero */
    .hero-content h1 { font-size: 1.8rem; }
    .hero-btns { flex-direction: column; width: 100%; }
    .btn-primary, .btn-outline { width: 100%; text-align: center; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    /* Reducir el espaciado general de las secciones */
    section { 
        padding: 50px 20px; 
    }

    /* Ajustar el contenedor "Tecnología" que tiene mucho padding interno */
    .tech-container {
        padding: 30px 20px; /* Originalmente tenía 50px */
        border-radius: 20px;
    }
    
    /* Reducir tamaño de títulos */
    .section-title {
        font-size: 1.8rem; /* Más pequeño para que no ocupe 3 líneas */
    }
    
    .hero-content h1 {
        font-size: 2rem; /* Título principal más controlado */
    }
    
    .hero-content p {
        font-size: 1rem;
        padding: 0 10px;
    }
}