/* =======================================================
   ESTILOS ESPECÍFICOS PARA PÁGINAS DE PROYECTO DETALLE
   ======================================================= */

/* HERO CON CARRUSEL DE FONDO */
.project-hero {
    position: relative;
    height: 85vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-carousel {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.hero-carousel-item {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-carousel-item.active { opacity: 1; }

.hero-carousel-item img {
    width: 100%; height: 100%; object-fit: cover;
}

.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 2;
}

.hero-content {
    position: relative; z-index: 3; max-width: 800px; padding: 20px;
}

.hero-content h1 {
    font-size: 3.5rem; margin-bottom: 10px; text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 1.5rem; margin-bottom: 30px; font-weight: 300;
}

.btn-outline-white {
    border: 2px solid white; color: white; padding: 10px 25px;
    text-decoration: none; font-weight: bold; transition: all 0.3s;
    margin: 5px; display: inline-block;
}

.btn-outline-white:hover { background: white; color: #183592; }

/* SECCIONES DE CONTENIDO */
.project-section { padding: 80px 5%; }
.project-intro { text-align: center; max-width: 900px; margin: 0 auto; }
.project-intro h2 { color: #183592; font-size: 2.5rem; margin-bottom: 20px; }
.project-intro p { font-size: 1.1rem; color: #555; line-height: 1.8; margin-bottom: 20px; }

/* GALERÍA GRID MODERNIZADA */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.gallery-item {
    position: relative; height: 250px; overflow: hidden; border-radius: 8px; cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.gallery-item img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s;
}

.gallery-item:hover img { transform: scale(1.1); }

.image-caption {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white; padding: 10px; font-size: 0.9rem; opacity: 0; transition: 0.3s;
}

.gallery-item:hover .image-caption { opacity: 1; }

/* FICHA TÉCNICA */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.spec-item {
    background: #f9f9f9; padding: 25px; border-radius: 10px; text-align: center;
    border-bottom: 3px solid #D3AA52; transition: transform 0.3s;
}

.spec-item:hover { transform: translateY(-5px); }
.spec-item i { font-size: 2rem; color: #183592; margin-bottom: 15px; }
.spec-item h3 { font-size: 1.1rem; margin-bottom: 10px; color: #333; }
.spec-item p { font-size: 0.95rem; color: #666; margin: 0; }

/* VIDEO */
.video-responsive {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.video-responsive iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* NAVEGACIÓN ENTRE PROYECTOS */
.nav-proyecto {
    position: fixed; top: 50%; transform: translateY(-50%);
    background: rgba(24, 53, 146, 0.8); color: white;
    padding: 15px 10px; z-index: 100; text-decoration: none;
    transition: 0.3s;
}

.nav-proyecto:hover { background: #D3AA52; }
.nav-prev { left: 0; border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
.nav-next { right: 0; border-top-left-radius: 5px; border-bottom-left-radius: 5px; }

.nav-content { display: flex; flex-direction: column; align-items: center; font-size: 0.8rem; }
.flecha { font-size: 1.5rem; margin-bottom: 5px; }

/* LIGHTBOX */
/* =========================================
   LIGHTBOX (Visor de imágenes Arreglado)
   ========================================= */
.lightbox {
    display: none; 
    position: fixed; 
    z-index: 99999; /* Le ponemos un número altísimo para que pase por encima del menú */
    padding-top: 5vh; /* Le damos un margen relativo arriba para que respire */
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.95); /* Fondo un pelín más oscuro para resaltar la foto */
}

.lightbox-content { 
    margin: auto; 
    display: block; 
    width: 90%; 
    max-width: 1000px; 
    max-height: 80vh; /* Obligamos a que la altura máxima sea el 80% de la pantalla */
    object-fit: contain; /* Esto hace la magia: ajusta la foto sin cortarla ni deformarla */
    border-radius: 5px; /* Un bordecito redondeado para darle estilo premium */
}

.close-lightbox { 
    position: absolute; 
    top: 20px; 
    right: 40px; 
    color: #f1f1f1; 
    font-size: 40px; 
    font-weight: bold; 
    cursor: pointer; 
    z-index: 100000;
}

/* Ocultar elementos de la galería que sobran */
.hidden-gallery-item {
    display: none;
}

/* =========================================
   FLECHAS DE NAVEGACIÓN DEL VISOR (LIGHTBOX)
   ========================================= */
.prev-lightbox, .next-lightbox {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 50px; /* Tamaño grande para que se vean bien */
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    z-index: 100000; /* Aseguramos que estén por encima de la foto */
    transition: background-color 0.3s, transform 0.2s;
    user-select: none; /* Evita que se seleccione el texto si haces doble clic rápido */
    text-decoration: none;
}

.prev-lightbox {
    left: 20px;
    border-radius: 0 8px 8px 0;
}

.next-lightbox {
    right: 20px;
    border-radius: 8px 0 0 8px;
}

/* Efecto hover con tu azul corporativo */
.prev-lightbox:hover, .next-lightbox:hover {
    background-color: rgba(24, 53, 146, 0.8);
    transform: translateY(-50%) scale(1.1); /* Efecto chulo: se hacen un 10% más grandes al pasar el ratón */
}

/* Ajuste para móviles: flechas un poco más pequeñas y pegadas a los bordes */
@media (max-width: 768px) {
    .prev-lightbox, .next-lightbox {
        font-size: 35px;
        padding: 10px 15px;
    }
    .prev-lightbox { left: 0; }
    .next-lightbox { right: 0; }
}










/* ADAPTACIÓN PARA MÓVILES (SOLUCIÓN FLECHAS) */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.5rem; }
    
    /* En lugar de ocultar los botones (display:none), los hacemos pequeñitos */
    .nav-proyecto {
        padding: 10px 8px;
    }
    
    /* Ocultamos el texto "Anterior/Siguiente" en móvil para que no estorbe, dejamos solo la flecha */
    .nav-content span:not(.flecha) {
        display: none; 
    }
    
    .flecha {
        font-size: 1.2rem;
        margin-bottom: 0;
    }
}