/* =========================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================= */
:root {
    /* PALETA DE COLORES */
    --mediterranean: #004e92;
    --amarillo: #FFD700;
    --turquesa: #00e5ff;
    
    /* TONOS DE FONDO */
    --dark-bg: #121212;
    --grafito: #2C2C2C;
    --grafito-light: #3A3A3A;
    
    /* FUENTES */
    --font-heading: 'Kanit', sans-serif;
    --font-body: 'Roboto', sans-serif;
    
    --text-main: #e0e0e0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    background-color: var(--dark-bg); 
    color: var(--text-main); 
    font-family: var(--font-body); 
    overflow-x: hidden; /* Evita scroll horizontal */
}

/* SCROLL PERSONALIZADO */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--dark-bg); }
::-webkit-scrollbar-thumb { 
    background: var(--amarillo); border-radius: 2px;
    border: 3px solid var(--dark-bg); 
}

/* =========================================
   2. ANIMACIONES
   ========================================= */
@keyframes entradaTriunfal {
    0% { opacity: 0; transform: scale(1.3); filter: blur(5px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

.fade-in { opacity: 0; transition: opacity 1s; }
.slide-up { opacity: 0; transform: translateY(40px); transition: all 0.6s ease-out; }
.visible { opacity: 1; transform: translateY(0); }
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }

/* =========================================
   3. HEADER
   ========================================= */
.header {
    background: rgba(18, 18, 18, 0.95);
    border-bottom: 3px solid var(--mediterranean);
    padding: 10px 0;
    position: fixed; width: 100%; z-index: 1000;
}

.header__container {
    max-width: 1200px; margin: 0 auto; display: flex;
    justify-content: space-between; align-items: center; padding: 0 20px;
}

.logo-img { height: 60px; width: auto; display: block; }
.navbar ul { display: flex; list-style: none; gap: 30px; }
.navbar a {
    color: #fff; text-decoration: none; font-weight: 700;
    font-family: var(--font-heading); transition: color 0.3s;
    letter-spacing: 1px; text-transform: uppercase;
}
.navbar a:hover { color: var(--amarillo); }
#menu-toggle, .menu-icon { display: none; }

/* =========================================
   4. HERO (INICIO)
   ========================================= */
.hero-split {
    position: relative; height: 100vh; width: 100%;
    overflow: hidden; display: flex; align-items: center; justify-content: center;
    background-color: var(--dark-bg);
}

.split-side { position: absolute; top: 0; height: 100%; width: 60%; overflow: hidden; z-index: 1; }
.split-side img { width: 100%; height: 100%; object-fit: cover; transition: transform 3s ease; }
.hero-split:hover .split-side img { transform: scale(1.05); }

.left-side { left: 0; clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%); border-right: 5px solid var(--amarillo); }
.right-side { right: 0; clip-path: polygon(15% 0, 100% 0, 100% 100%, 0% 100%); z-index: 0; }
.overlay-gradient { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }

.hero-content-split {
    position: relative; z-index: 10; text-align: center; max-width: 800px; padding: 40px;
    background: rgba(18, 18, 18, 0.9); border: 1px solid var(--grafito-light);
    border-top: 5px solid var(--mediterranean); box-shadow: 0 0 50px rgba(0,0,0,0.8);
    animation: entradaTriunfal 1s ease-out forwards; opacity: 0;
}

.hero-content-split h1 {
    font-family: var(--font-heading); font-weight: 900; font-size: 5rem;
    line-height: 0.9; margin: 0; color: #fff; text-transform: uppercase; letter-spacing: -2px;
}
.text-blue { color: var(--mediterranean); }
.hero-content-split .subtitle {
    font-family: var(--font-heading); font-size: 2rem; color: #fff;
    margin: 10px 0 20px 0; letter-spacing: 5px;
}
.text-outline { -webkit-text-stroke: 1px var(--amarillo); color: transparent; font-weight: 900; }
.hero-content-split p { font-size: 1.1rem; color: #ccc; margin-bottom: 30px; font-weight: 300; }

.industrial-bar {
    width: 80px; height: 8px;
    background: repeating-linear-gradient(45deg, var(--amarillo), var(--amarillo) 10px, #000 10px, #000 20px);
    margin: 0 auto 20px auto;
}

.btn-industrial-solid {
    display: inline-block; padding: 15px 40px; background: var(--amarillo);
    color: #000; font-family: var(--font-heading); font-weight: 900;
    text-decoration: none; font-size: 1.2rem;
    clip-path: polygon(10% 0, 100% 0, 100% 80%, 90% 100%, 0 100%, 0 20%);
    transition: transform 0.3s, box-shadow 0.3s;
}
.btn-industrial-solid:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(255, 215, 0, 0.6); background: #fff; }

/* =========================================
   5. SECCIONES GENERALES
   ========================================= */
.section { padding: 80px 20px; }
.container { max-width: 1200px; margin: 0 auto; }
.dark-bg { background-color: var(--dark-bg); }
.concrete-bg { background-color: var(--grafito); }
.section-title { 
    font-size: 2.8rem; margin-bottom: 40px; color: #fff; 
    font-family: var(--font-heading); font-weight: 900;
    border-left: 8px solid var(--mediterranean); padding-left: 15px;
}
.highlight { color: var(--amarillo); }

/* =========================================
   6. NOSOTROS (GRID 4 & ICONOS)
   ========================================= */
.nosotros-intro {
    max-width: 900px; margin: 0 auto 50px auto; text-align: center;
    border-left: 5px solid var(--amarillo); padding: 20px;
    background: rgba(255, 255, 255, 0.05);
}
.nosotros-intro p { font-size: 1.4rem; color: #e0e0e0; line-height: 1.6; font-weight: 300; }
.nosotros-intro strong { color: var(--amarillo); font-weight: 700; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.technical-bg {
    background-color: var(--dark-bg);
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.card { 
    background: var(--grafito); border-top: 4px solid var(--mediterranean);
    padding: 20px; transition: transform 0.3s; box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-10px); border-top-color: var(--amarillo); }

/* Tarjetas de Iconos */
.icon-card { align-items: center; text-align: center; padding: 30px 20px; height: 100%; }
.card-icon {
    font-size: 3rem; color: var(--amarillo); margin-bottom: 20px;
    background: rgba(255, 215, 0, 0.1); width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid var(--amarillo); transition: all 0.4s ease;
}
.icon-card:hover .card-icon { background: var(--amarillo); color: #000; transform: rotateY(180deg); }

.card-header-center {
    font-family: var(--font-heading); font-size: 1.6rem; color: #fff;
    margin-bottom: 15px; border-bottom: 2px solid var(--mediterranean);
    padding-bottom: 10px; width: 100%;
}
.card-body-center p { font-size: 1.1rem; color: #ccc; line-height: 1.6; }
.clean-list { list-style: none; padding: 0; text-align: left; display: inline-block; }
.clean-list li { font-size: 1.1rem; margin-bottom: 8px; color: #ccc; }
.clean-list li i { color: var(--amarillo); margin-right: 10px; }

/* =========================================
   7. ESTADÍSTICAS
   ========================================= */
.stats-section {
    background-color: var(--amarillo); padding: 50px 20px;
    border-top: 10px solid var(--mediterranean); border-bottom: 10px solid var(--mediterranean);
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; text-align: center; }
.stat-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0 20px; border-right: 2px solid rgba(0, 78, 146, 0.3);
}
.stat-item:last-child { border-right: none; }
.stat-icon { font-size: 2.5rem; color: var(--mediterranean); margin-bottom: 15px; opacity: 0.8; }
.stat-number {
    font-family: var(--font-heading); font-size: 3.5rem; font-weight: 900;
    color: #000; line-height: 1;
}
.stat-label {
    font-family: var(--font-heading); font-size: 0.9rem; color: var(--mediterranean);
    font-weight: 800; margin-top: 5px; text-transform: uppercase;
}

/* =========================================
   8. SERVICIOS
   ========================================= */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.service-item {
    background: var(--dark-bg); border: 1px solid #444;
    text-align: center; transition: 0.3s; overflow: hidden; display: flex; flex-direction: column;
}
.service-item:hover { background: var(--grafito-light); border-color: var(--amarillo); }
.service-icon { width: 100%; height: 180px; object-fit: cover; margin-bottom: 15px; border-bottom: 3px solid var(--mediterranean); }
.service-item h3 { font-size: 1.2rem; padding: 0 10px; margin-bottom: 10px; color: var(--amarillo); font-family: var(--font-heading); font-weight: 700; }
.service-item p { padding: 0 10px 20px 10px; font-size: 0.9rem; color: #ccc; }

/* =========================================
   9. PROCESO DE TRABAJO
   ========================================= */
.process-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 40px; }
.process-step { background: var(--grafito); padding: 40px 30px; position: relative; border: 1px solid #444; transition: transform 0.3s; }
.process-step:hover { transform: translateY(-5px); border-color: var(--amarillo); }
.step-number { font-family: var(--font-heading); font-size: 4rem; color: rgba(255, 255, 255, 0.05); position: absolute; top: 10px; right: 20px; font-weight: 900; }
.process-step h3 { color: var(--amarillo); font-family: var(--font-heading); font-size: 1.4rem; margin-bottom: 15px; position: relative; z-index: 2; }
.process-step p { color: #ccc; position: relative; z-index: 2; }
.process-step:not(:last-child)::after { content: "➔"; position: absolute; right: -30px; top: 50%; transform: translateY(-50%); font-size: 2rem; color: var(--amarillo); opacity: 0.5; }

/* =========================================
   MASTER CODE: SECCIÓN PROYECTOS (FINAL)
   ========================================= */

/* 1. LA REJILLA (GRID) */
#proyectos .grid-3 {
    display: grid;
    /* Columnas verticales que se adaptan al espacio */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
}

/* 2. LA TARJETA (CONTENEDOR PRINCIPAL) */
.project-card {
    background-color: var(--grafito); /* Fondo gris oscuro */
    border-top: 4px solid var(--mediterranean); /* Línea azul arriba */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Asegura que nada se salga */
    transition: transform 0.3s ease;
    padding: 0 !important; /* Reseteamos padding para que la foto toque bordes */
    max-width: 100%;
}

.project-card:hover {
    transform: translateY(-5px); /* Se levanta un poco al pasar el mouse */
    border-top-color: var(--amarillo); /* Cambia a amarillo */
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

/* 3. EL MARCO DE LAS FOTOS (CARRUSEL) */
.carousel-container {
    position: relative;
    width: 100%;
    height: 350px !important; /* ALTURA FIJA: Garantiza que sean cuadrados */
    overflow: hidden !important; /* Oculta las fotos extra */
    border-bottom: 4px solid var(--amarillo);
    background: #000; /* Fondo negro de seguridad */
}

/* 4. LA PISTA DESLIZANTE */
.carousel-track {
    display: flex !important; /* Pone las fotos en fila india */
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out; /* La magia del deslizamiento suave */
}

/* 5. LAS FOTOS (AJUSTE PERFECTO) */
.carousel-track img {
    min-width: 100% !important; /* Ancho total del marco */
    height: 100% !important;    /* Alto total del marco */
    object-fit: cover !important; /* Recorta sin deformar */
    display: block;
}

/* 6. BOTONES DEL CARRUSEL (FLECHAS) */
/* Aseguramos que los botones estén siempre ENCIMA de la imagen */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px; /* Un poco más grandes para dedos gordos */
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 20; /* IMPORTANTE: Asegura que esté encima de todo */
    display: flex; align-items: center; justify-content: center;
    /* Quita el comportamiento de toque azul en celulares al picar */
    -webkit-tap-highlight-color: transparent; 
}

.carousel-btn:hover {
    background: var(--amarillo);
    color: #000;
    border-color: var(--amarillo);
}

.prev-btn { left: 15px; }
.next-btn { right: 15px; }

/* 7. EL ÁREA DE TEXTO (LO QUE SE HABÍA PERDIDO) */
.project-card .card-content {
    padding: 25px;
    text-align: left;
    background: linear-gradient(to bottom, var(--grafito), #222);
}

/* 8. EL TÍTULO DEL PROYECTO */
.project-card .card-header {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

/* 9. EL TEXTO DESCRIPTIVO (OBRA, UBICACIÓN) */
.project-card .card-body p {
    font-size: 1rem;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 8px;
}

.project-card .card-body strong {
    color: var(--amarillo); /* Las palabras "OBRA:" y "UBICACIÓN:" en amarillo */
    font-weight: 700;
    margin-right: 5px;
}

/* =========================================
   11. CTA PARALLAX & CONTACTO
   ========================================= */
.cta-parallax {
    background-attachment: fixed; background-position: center; background-repeat: no-repeat;
    background-size: cover; padding: 120px 20px; position: relative; text-align: center;
}
.cta-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); }
.cta-content { position: relative; z-index: 2; max-width: 800px; margin: 0 auto; }
.cta-content h2 { font-family: var(--font-heading); font-size: 3.5rem; color: #fff; margin-bottom: 20px; }

/* Contacto */
.contact-section { text-align: left; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: stretch; }
.contact-info-box { background: var(--grafito); padding: 40px; border-left: 5px solid var(--amarillo); border-top: 1px solid #444; }
.contact-heading { font-family: var(--font-heading); color: var(--mediterranean); font-size: 1.8rem; margin-bottom: 30px; border-bottom: 1px solid #444; padding-bottom: 15px; }
.info-item { display: flex; align-items: flex-start; margin-bottom: 25px; }
.info-item .icon { font-size: 1.8rem; margin-right: 20px; }
.info-text strong { color: var(--amarillo); font-family: var(--font-heading); margin-bottom: 5px; display: block; }
.contact-link { color: #fff; text-decoration: none; border-bottom: 1px dotted var(--amarillo); }
.full-width-btn { width: 100%; text-align: center; margin-top: 20px; }
.contact-map iframe { width: 100%; height: 100%; min-height: 400px; filter: grayscale(100%) invert(90%) contrast(120%); }

/* Footer */
.footer {
    padding: 80px 20px 40px 20px; text-align: center; color: #fff;
    background: linear-gradient(to top, rgba(0, 78, 146, 0.9) 0%, var(--dark-bg) 90%);
}
.footer-logo { width: 150px; height: auto; filter: drop-shadow(0 0 15px rgba(0, 229, 255, 0.5)); display: block; margin-bottom: 10px; }
.footer-content { display: flex; flex-direction: column; align-items: center; }

/* WhatsApp */
.float-whatsapp {
    position: fixed; width: 60px; height: 60px; bottom: 30px; right: 30px;
    background-color: #25d366; color: #FFF; border-radius: 50%;
    text-align: center; font-size: 35px; box-shadow: 2px 2px 3px rgba(0,0,0,0.5);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff; text-decoration: none; transition: transform 0.3s;
}
.float-whatsapp:hover { transform: scale(1.1); }

/* =========================================
   12. RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
    .stat-item { border-right: none; border-bottom: 2px solid rgba(0, 78, 146, 0.2); padding-bottom: 20px; }
    .process-grid { grid-template-columns: 1fr; gap: 20px; }
    .process-step:not(:last-child)::after { content: "⬇"; right: 50%; top: auto; bottom: -35px; transform: translateX(50%); }
}

@media (max-width: 768px) {
    /* Textos */
    .hero-titles h1, .hero-content-split h1 { font-size: 2.2rem !important; }
    .section-title { font-size: 2rem !important; text-align: center; border-left: none; border-bottom: 5px solid var(--mediterranean); padding-left: 0; }
    
    /* Layouts en columna */
    .grid-4, .grid-3, .services-grid, .contact-grid, .stats-grid, .process-grid, .hero-images-grid {
        grid-template-columns: 1fr !important; gap: 40px !important;
    }

    /* Menú */
    .header__container { padding: 0 15px; }
    .menu-icon { display: block; cursor: pointer; color: #fff; }
    .bar { width: 30px; height: 3px; background: #fff; margin: 6px 0; }
    .navbar {
        position: fixed; top: 70px; right: -100%; height: calc(100vh - 70px);
        width: 100%; background: #000; flex-direction: column;
        justify-content: center; transition: 0.4s; border-left: 3px solid var(--amarillo);
    }
    .navbar ul { flex-direction: column; text-align: center; }
    #menu-toggle:checked ~ .navbar { right: 0; }
    
    /* Hero */
    .hero-split { flex-direction: column; }
    .split-side { position: relative; width: 100%; height: 50%; clip-path: none; border: none; }
    .hero-content-split { position: absolute; width: 90%; padding: 20px; }
    
    /* Proyectos Móvil */
    #proyectos .grid-3 { padding: 0 10px; }
    #proyectos .carousel-container { height: 300px; }
    
    .contact-map iframe { height: 300px !important; }
}

/* =========================================
   🚨 CORRECCIÓN DE EMERGENCIA (ANTI-GIGANTES)
   Pegar esto al final de tu style.css
   ========================================= */

/* 1. Esto obliga a las imágenes a respetar el ancho de la tarjeta */
.carousel-track img {
    width: 100% !important; /* El !important fuerza el cambio */
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* 2. Esto asegura que el marco recorte lo que sobra */
.carousel-container {
    width: 100% !important;
    height: 350px !important; /* Altura fija cuadrada */
    overflow: hidden !important; /* CLAVE: Esto es lo que recorta la foto */
    position: relative !important;
    border-bottom: 5px solid var(--amarillo) !important;
    background: #000;
}

/* 3. Esto acomoda las fotos en fila */
.carousel-track {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    transition: transform 0.5s ease-in-out;
}

/* 4. Evita que la tarjeta crezca infinito */
.project-card {
    max-width: 100% !important;
    overflow: hidden !important; /* Doble seguridad */
}

