/* ==========================================================================
   1. CONFIGURACIÓN BASE Y RESETEO
   ========================================================================== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
}

body { 
    color: #333; 
    line-height: 1.6; 
    background-color: #f4f7f6; 
    scroll-behavior: smooth; 
}

a { 
    text-decoration: none; 
    color: inherit; 
}

img {
    max-width: 100%;
    display: block;
}

/* ==========================================================================
   2. NAVEGACIÓN (HEADER)
   ========================================================================== */
header { 
    background-color: #fff; 
    padding: 10px 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.logo { 
    display: flex; 
    align-items: center; 
    height: 60px; 
}

/* Ajuste para que el logo funcione como link */
.logo a {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo-img { 
    height: 55px; 
    width: auto; 
    object-fit: contain; 
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.nav-links { 
    display: flex; 
    list-style: none; 
    gap: 20px; 
}

.nav-links a { 
    font-weight: bold; 
    color: #555; 
    transition: color 0.3s; 
    font-size: 0.95rem;
}

.nav-links a:hover { 
    color: #1e3c72; 
}

/* ==========================================================================
   3. SECCIONES HERO (INICIO Y PÁGINAS INTERNAS)
   ========================================================================== */

/* Hero Principal con Slider de 5 fotos */
.hero { 
    height: 85vh; 
    display: flex; 
    flex-direction: column; 
    align-items: center;    
    justify-content: center; 
    text-align: center; 
    color: white; 
    padding: 0 20px; 
    position: relative;
    overflow: hidden;
}

/* Capa de Fondo Animado */
.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    /* 30 segundos total para 5 fotos (6s por foto) */
    animation: sliderFondoSuave 30s infinite ease-in-out;
}

/* Filtro oscuro para legibilidad del texto */
.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.65), rgba(30, 60, 114, 0.45));
    z-index: -1;
}

/* Hero Pequeño para páginas internas (Nosotros, Contacto, etc) */
.hero-small { 
    background: linear-gradient(rgba(30, 60, 114, 0.9), rgba(42, 82, 152, 0.85)), 
                url('../img/fondo/trabajo1.png') center/cover;
    height: 40vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    color: white; 
    padding: 0 20px; 
}

.hero-content { 
    max-width: 900px; 
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.hero h2 { font-size: 3.5rem; margin-bottom: 20px; text-shadow: 2px 2px 15px rgba(0,0,0,0.7); line-height: 1.2; }
.hero p { font-size: 1.3rem; margin-bottom: 40px; max-width: 750px; text-shadow: 1px 1px 8px rgba(0,0,0,0.7); }

/* ==========================================================================
   4. COMPONENTES REUTILIZABLES (BOTONES, TÍTULOS)
   ========================================================================== */
.btn { 
    background-color: #f39c12; 
    color: #fff; 
    padding: 16px 45px; 
    border-radius: 5px; 
    font-weight: bold; 
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn:hover { 
    background-color: #e67e22; 
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.section { padding: 80px 5%; }

.section-title { 
    text-align: center; 
    font-size: 2.5rem; 
    color: #1e3c72; 
    margin-bottom: 20px; 
    text-transform: uppercase; 
}

.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: #f39c12;
    margin: 10px auto;
}

.subtitle { text-align: center; color: #666; margin-bottom: 40px; font-size: 1.1rem; }
.bg-light { background-color: #ebf0f3; }

/* ==========================================================================
   5. NOSOTROS, SERVICIOS Y GRIDS
   ========================================================================== */
.about-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 30px; 
    max-width: 1200px;
    margin: 0 auto;
}

.about-card { 
    background: #fff; 
    padding: 40px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    border-top: 5px solid #1e3c72; 
    text-align: center;
    transition: transform 0.3s ease;
}

.about-card:hover { transform: translateY(-10px); }

.services-list { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
    justify-content: center; 
    max-width: 1000px; 
    margin: 0 auto; 
}

.tag { 
    background-color: #1e3c72; 
    color: white; 
    padding: 12px 25px; 
    border-radius: 50px; 
    font-size: 0.95rem; 
    font-weight: bold; 
    transition: 0.3s;
}

.tag:hover { background-color: #f39c12; transform: scale(1.05); }

/* ==========================================================================
   6. CARRUSELES (CLIENTES Y PROVEEDORES)
   ========================================================================== */
.carousel-container { 
    overflow: hidden; 
    width: 100%; 
    max-width: 1100px; 
    margin: 0 auto; 
    position: relative; 
    padding: 40px 0; 
}

.carousel-track { 
    display: flex; 
    align-items: center; 
    width: max-content; 
    animation: scroll 35s linear infinite; 
}

.track-reverse { animation: scroll-reverse 35s linear infinite; }

.slide { 
    width: 220px; 
    height: 100px; 
    display: flex; 
    justify-content: center; 
    align-items: center;
    padding: 25px; 
}

.slide img { 
    max-width: 100%; 
    max-height: 80%; 
    object-fit: contain; 
    filter: grayscale(100%); 
    opacity: 0.5; 
    transition: 0.4s; 
}

.slide:hover img { filter: grayscale(0%); opacity: 1; transform: scale(1.1); }

/* ==========================================================================
   7. FOOTER Y WHATSAPP
   ========================================================================== */
footer { background-color: #1a252f; color: #ecf0f1; text-align: center; padding: 60px 5% 20px; }

.footer-content h3 { color: #f39c12; margin-bottom: 20px; font-size: 1.8rem; }

.footer-bottom { 
    margin-top: 40px; 
    font-size: 0.85rem; 
    border-top: 1px solid rgba(255,255,255,0.1); 
    padding-top: 25px; 
    color: #bdc3c7;
}

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: 0.3s ease;
}

.whatsapp-float:hover { transform: scale(1.1); background-color: #128c7e; }

/* ==========================================================================
   8. ANIMACIONES (KEYFRAMES)
   ========================================================================== */
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes scroll-reverse { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }

/* Animación FADE optimizada para 5 fotos */
@keyframes sliderFondoSuave {
    0%, 16% { background-image: url('../img/fondo/trabajo1.png'); opacity: 1; }
    18% { opacity: 0.7; }
    20%, 36% { background-image: url('../img/fondo/trabajo2.jpeg'); opacity: 1; }
    38% { opacity: 0.7; }
    40%, 56% { background-image: url('../img/fondo/trabajo3.jpg'); opacity: 1; }
    58% { opacity: 0.7; }
    60%, 76% { background-image: url('../img/fondo/trabajo4.jpg'); opacity: 1; }
    78% { opacity: 0.7; }
    80%, 96% { background-image: url('../img/fondo/trabajo5.jpg'); opacity: 1; }
    98% { opacity: 0.7; }
    100% { background-image: url('../img/fondo/trabajo1.png'); opacity: 1; }
}

/* ==========================================================================
   9. RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    header { flex-direction: column; padding: 20px; }
    .nav-links { margin-top: 20px; gap: 10px; font-size: 0.85rem; flex-wrap: wrap; justify-content: center; }
    .hero h2 { font-size: 2.2rem; }
    .hero p { font-size: 1.1rem; }
    .hero-small { height: 30vh; }
    .section { padding: 60px 5%; }
}