/* --- VARIABLES --- */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    
    /* Colores */
    --primary: #0ea5e9;       /* Azul Tech */
    --primary-dark: #0284c7;
    --accent: #f59e0b;        /* Naranja Seguridad/Construcción */
    --success: #10b981;
    
    --radius: 8px;
    --container: 1100px; /* Ancho un poco más contenido para lectura */
    --nav-height: 70px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- UTILIDADES --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius);
    font-weight: 600; cursor: pointer; border: none;
    font-size: 0.95rem; transition: all 0.3s ease;
    text-align: center; justify-content: center;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; box-shadow: 0 4px 15px rgba(14, 165, 233, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4); }

.btn-outline {
    background: transparent; border: 1px solid rgba(255,255,255,0.2); color: var(--text-main);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.section-title { font-size: 2rem; margin-bottom: 0.5rem; text-align: center; }
.section-subtitle { text-align: center; color: var(--text-muted); max-width: 600px; margin: 0 auto 3rem; }
.highlight { color: var(--primary); }

/* --- HEADER OPTIMIZADO --- */
header {
    height: var(--nav-height); 
    position: fixed; top: 0; width: 100%; z-index: 1000;
    background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.header-inner {
    height: 100%; display: flex; justify-content: space-between; align-items: center;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.brand-logo {
    width: 36px; height: 36px;
    background: linear-gradient(45deg, var(--bg-card), #000);
    border: 1px solid var(--primary); border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
.brand-logo::after { content: "⚡"; font-size: 1rem; color: var(--accent); }

/* Desktop Nav & Actions */
.desktop-nav { display: flex; align-items: center; gap: 30px; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; }
.nav-links a:hover { color: white; }

/* Hamburguesa (Oculta en Desktop) */
.hamburger { display: none; cursor: pointer; width: 30px; height: 20px; position: relative; }
.hamburger .bar { width: 100%; height: 2px; background: white; margin-bottom: 6px; transition: 0.3s; }

/* Menú Móvil (Oculto por defecto) */
.mobile-menu {
    position: fixed; top: var(--nav-height); left: 0; width: 100%;
    background: var(--bg-card); padding: 20px;
    display: flex; flex-direction: column; gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transform: translateY(-150%); transition: transform 0.3s ease-in-out;
    z-index: 999;
}
.mobile-menu.active { transform: translateY(0); }
.mobile-menu a { font-size: 1.1rem; color: var(--text-main); padding: 10px 0; }

/* --- HERO SECTION --- */
.hero {
    padding-top: calc(var(--nav-height) + 50px); padding-bottom: 60px;
    display: grid; grid-template-columns: 1fr 0.8fr; gap: 40px; align-items: center;
    position: relative;
}
.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: radial-gradient(circle at 70% 30%, rgba(14, 165, 233, 0.08) 0%, transparent 50%);
}
.hero-content h1 { font-size: 2.8rem; line-height: 1.1; margin-bottom: 15px; }
.hero-content p { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 25px; max-width: 500px; }
.hero-actions { display: flex; gap: 15px; flex-wrap: wrap; }

.hero-image {
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1);
}

/* --- MARCAS --- */
.brands { padding: 30px 0; opacity: 0.7; border-bottom: 1px solid rgba(255,255,255,0.05); }
.brands-grid { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.brand-item { font-weight: 700; font-size: 1.2rem; color: var(--text-muted); letter-spacing: 1px; }

/* --- SERVICIOS (FLEXBOX LAYOUT 3-2) --- */
.services { padding: 80px 0; }
.services-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Esto centra los elementos de la última fila */
    gap: 24px;
}

.card {
    background: var(--bg-card); padding: 25px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03); transition: 0.3s;
    position: relative;
    /* Ancho: 3 columnas menos el gap */
    flex: 0 0 calc(33.333% - 24px); 
    min-width: 280px; /* Evita que se aplasten demasiado */
}

.card:hover { transform: translateY(-5px); border-color: var(--primary); }

.card-icon {
    font-size: 1.8rem; margin-bottom: 15px;
    width: 50px; height: 50px; 
    background: rgba(255,255,255,0.03); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.card h3 { margin-bottom: 10px; font-size: 1.2rem; color: #fff; }
.card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }

.card.featured::after {
    content: "Destacado"; position: absolute; top: 12px; right: 12px;
    background: var(--accent); color: #000; font-size: 0.65rem;
    font-weight: 800; padding: 3px 8px; border-radius: 4px; text-transform: uppercase;
}

/* --- CTA FORM --- */
.cta-section {
    background: linear-gradient(180deg, var(--bg-card), var(--bg-dark));
    padding: 70px 0; text-align: center; border-top: 1px solid rgba(255,255,255,0.05);
}
.lead-form { max-width: 450px; margin: 25px auto 0; display: flex; gap: 10px; flex-wrap: wrap; }
.lead-form input {
    flex: 1; padding: 12px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3); color: white; min-width: 200px;
}

/* --- FOOTER --- */
footer {
    background: #020617; padding: 40px 0 20px;
    border-top: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem;
}
.footer-content { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 30px; }
.footer-col h4 { color: white; margin-bottom: 15px; }
.footer-col ul li { margin-bottom: 8px; color: var(--text-muted); }
.copyright { text-align: center; color: rgba(255,255,255,0.3); font-size: 0.8rem; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px; }

/* --- RESPONSIVE --- */

/* Tablet (Punto de quiebre para la grilla) */
@media (max-width: 900px) {
    .card { flex: 0 0 calc(50% - 24px); } /* 2 columnas */
}

/* Mobile */
@media (max-width: 768px) {
    /* Header Fix */
    .desktop-nav { display: none; } /* Oculta botón grande y nav */
    .hamburger { display: block; }  /* Muestra hamburguesa */
    
    /* Hero */
    .hero { grid-template-columns: 1fr; text-align: center; padding-top: 90px; }
    .hero-actions { justify-content: center; }
    .hero-content h1 { font-size: 2.2rem; }
    
    /* Cards */
    .card { flex: 0 0 100%; } /* 1 columna full width */
    .services-flex { gap: 15px; }
    
    /* Form */
    .lead-form { flex-direction: column; }
    .lead-form input, .lead-form button { width: 100%; }
}

/* Animaciones */
.reveal { opacity: 0; transform: translateY(20px); transition: all 0.6s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* --- CARRUSEL DE MARCAS --- */
.brands-section {
    padding: 40px 0 60px;
    background: var(--bg-dark); /* O un tono ligeramente diferente si prefieres */
    border-bottom: 1px solid rgba(255,255,255,0.05);
    overflow: hidden; /* Vital para que no aparezca scroll horizontal */
}

.brands-title {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Contenedor del slider con degradado a los lados (Efecto Fade) */
.slider {
    height: 80px;
    margin: auto;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.slider::before,
.slider::after {
    background: linear-gradient(to right, var(--bg-dark) 0%, rgba(15, 23, 42, 0) 100%);
    content: "";
    height: 100%;
    position: absolute;
    width: 100px; /* Ancho del desvanecimiento */
    z-index: 2;
}

.slider::after {
    right: 0;
    top: 0;
    transform: rotateZ(180deg);
}

.slider::before {
    left: 0;
    top: 0;
}

/* La pista que se mueve */
.slide-track {
    display: flex;
    width: calc(200px * 14); /* 200px por slide * 14 logos (7 originales + 7 duplicados) */
    animation: scroll 30s linear infinite;
}

/* Pausar animación al pasar el mouse por encima del track */
.slide-track:hover {
    animation-play-state: paused;
}

/* Estilo de cada Logo individual */
.slide {
    height: 80px;
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 30px; /* Espacio entre logos */
}

.slide img {
    max-width: 100%;
    max-height: 50px; /* Altura uniforme para todos */
    width: auto;
    /* Estado Normal: Escala de grises y opacidad media */
    filter: grayscale(100%) opacity(0.5) brightness(1.2); 
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Hover sobre el logo: Color real y brillo */
.slide img:hover {
    filter: grayscale(0%) opacity(1) brightness(1);
    transform: scale(1.1); /* Pequeño zoom */
}

/* Definición de la animación */
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-200px * 7)); } /* Desplaza la mitad del ancho total */
}

/* Ajuste Mobile */
@media (max-width: 768px) {
    .slide { width: 150px; padding: 0 20px; }
    .slide-track { width: calc(150px * 14); }
    @keyframes scroll {
        100% { transform: translateX(calc(-150px * 7)); }
    }
}

