/* ESTRUCTURA GENERAL */
.diseno-page {
    width: 100%;
    font-family: 'Roboto', sans-serif;
    background-color: #001A51;
}

/* ==========================================
   SECCIÓN 1: HERO DIVIDIDO CON GIF
   ========================================== */
.diseno-hero {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 5% 60px 5%;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* El degradado que oscurece el GIF un poco a la izquierda para que el texto resalte */
.hero-overlay-split {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 26, 81, 0.85) 0%, rgba(0, 26, 81, 0.3) 100%);
    z-index: 1;
}

.diseno-hero-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 2; 
}

/* Lado izquierdo (Texto) */
.diseno-hero-texto {
    flex: 1;
    color: #ffffff;
}

.diseno-hero-texto h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.1;
}

.diseno-hero-texto h2 {
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 30px;
    color: #f49d00; /* Acento amarillo */
}

.diseno-hero-texto p {
    font-size: 16px;
    line-height: 1.7;
    font-weight: 300;
    margin-bottom: 20px;
    color: #e0e0e0;
}

.cta-text {
    font-weight: 500 !important;
    margin-top: 30px;
    color: #ffffff !important;
}

.btn-asesoria {
    display: inline-block;
    margin-top: 10px;
    padding: 15px 30px;
    background-color: transparent;
    color: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-asesoria:hover {
    background-color: #ffffff;
    color: #001A51;
}

/* Lado derecho (Imagen Revit/3D) */
.diseno-hero-imagen {
    flex: 1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.diseno-hero-imagen img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    /* Un ligero filtro azulado para integrarlo al diseño tecnológico */
    filter: sepia(20%) hue-rotate(190deg) brightness(95%);
    transition: transform 0.6s ease;
}

.diseno-hero-imagen:hover img {
    transform: scale(1.05);
}

/* Efecto de líneas de construcción (Blueprint) sobre la imagen */
.tech-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 2;
}

/* ==========================================
   SECCIÓN 3: CARACTERÍSTICAS BIM (Galería Asimétrica)
   ========================================== */
.diseno-galeria-features {
    background-color: #f8f9fa; 
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 5% 40px 5%;
    box-sizing: border-box;
}

.features-header {
    text-align: center;
    margin-bottom: 30px;
}

.features-header h2 {
    color: #001A51;
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 5px;
}

.features-header p {
    color: #555555;
    font-size: 17px;
}

/* Cuadrícula Asimétrica CSS Grid */
.masonry-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: clamp(180px, 22vh, 250px); 
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Tarjetas Base */
.masonry-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 26, 81, 0.1);
    cursor: pointer;
}

.masonry-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.masonry-card:hover img {
    transform: scale(1.08); /* Zoom lento y elegante */
}

/* Tamaños Especiales para romper la monotonía */
.item-grande {
    grid-column: span 2;
    grid-row: span 2; /* Ocupa 2x2 cuadros (La más grande) */
}

.item-ancho {
    grid-column: span 2; /* Ocupa 2 cuadros de ancho (Horizontal) */
}

/* Capa Oscura (Overlay) con Textos */
.masonry-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 26, 81, 0.95) 0%, rgba(0, 26, 81, 0.4) 60%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Texto abajo */
    padding: 30px;
    opacity: 0.9; /* Siempre un poco visible para leer el título */
    transition: background 0.4s ease;
}

.masonry-card:hover .masonry-overlay {
    background: rgba(0, 26, 81, 0.9); /* Se oscurece más al pasar el mouse */
}

.masonry-text {
    transform: translateY(30px); /* Oculta el párrafo desplazándolo hacia abajo */
    transition: transform 0.4s ease;
}

.masonry-card:hover .masonry-text {
    transform: translateY(0); /* Al hacer hover, el texto sube y se muestra completo */
}

.masonry-text h3 {
    color: #f49d00; /* Acento amarillo */
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    margin-top: 0;
}

/* El texto secundario (párrafo) estará medio oculto inicialmente */
.masonry-text p {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.masonry-card:hover .masonry-text p {
    opacity: 1; /* Aparece el texto descriptivo */
}

/* Ajustes específicos de texto según tamaño de tarjeta */
.item-grande .masonry-text h3 { font-size: 28px; }
.item-grande .masonry-text p { font-size: 16px; }

/* Animación de entrada general */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    /* El Hero Dividido pasa a estar apilado en tablets */
    .diseno-hero-container {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }
    .diseno-hero-imagen { width: 100%; }
    
    /* La galería pasa a 2 columnas */
    .masonry-features-grid { grid-template-columns: repeat(2, 1fr); }
    .item-ancho { grid-column: span 2; }
}

@media (max-width: 768px) {
    .diseno-hero-texto h1 { font-size: 32px; }
    .diseno-hero { padding-top: 100px; }
    
    /* La galería pasa a 1 sola columna en celulares */
    .masonry-features-grid { grid-template-columns: 1fr; grid-auto-rows: 300px; }
    .item-grande, .item-ancho {
        grid-column: span 1;
        grid-row: span 1;
    }
    /* En móviles siempre mostramos el texto completo */
    .masonry-text { transform: translateY(0); }
    .masonry-text p { opacity: 1; }
    .masonry-overlay { background: rgba(0, 26, 81, 0.85); }
}

/* ==========================================
   SECCIÓN 2
   ========================================== */
.diseno-alternativa-curva {
    position: relative;
    background-color: #ffffff;
    width: 100%;
    min-height: 100vh; /* 1. REGLA ESTRICTA DE PANTALLA COMPLETA */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centrado vertical exacto */
    padding: 30px 0; /* Padding mínimo para no generar scroll */
    box-sizing: border-box;
    overflow: hidden;
}

.curva-container {
    max-width: 100%; 
    margin: 0 auto;
    position: relative;
    z-index: 2;
    width: 100%;
}

.curva-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 15px auto;
    padding: 0 20px;
}

.curva-header h2 {
    color: #001A51;
    font-size: 32px; /* Un poco más compacto */
    font-weight: 700;
    margin-bottom: 5px;
}

.curva-header p {
    color: #555555;
    font-size: 16px;
}

/* 
   EFECTO LENTE INFALIBLE (SIN MÁSCARAS)
   Usa dos formas blancas curvas superpuestas 
*/
.lente-wrapper {
    position: relative;
    width: 100%;
    /* Altura dinámica: se achica en laptops para no pasarse, máximo 450px */
    height: clamp(320px, 50vh, 550px); 
    overflow: hidden;
    margin-bottom: 20px;
}

/* Óvalo Blanco Superior que tapa las fotos creando la curva */
.lente-wrapper::before {
    content: "";
    position: absolute;
    top: -100px; 
    left: -5%;
    width: 110%;
    height: 140px;
    background-color: #ffffff;
    border-radius: 50%; /* Forma la curva */
    z-index: 5;
}

/* Óvalo Blanco Inferior que tapa las fotos creando la curva */
.lente-wrapper::after {
    content: "";
    position: absolute;
    bottom: -100px; 
    left: -5%;
    width: 110%;
    height: 140px;
    background-color: #ffffff;
    border-radius: 50%;
    z-index: 5;
}

/* Cuadrícula unida sin espacios */
.curva-grid {
    display: flex;
    gap: 5px; 
    width: 100%;
    height: 100%; /* Toma la altura del lente-wrapper */
}

/* Tarjetas individuales pegadas */
.curva-card {
    position: relative;
    flex: 1; 
    height: 100%;
    overflow: hidden;
    border-radius: 0; 
}

.curva-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.curva-card:hover img {
    transform: scale(1.05);
}

/* El recubrimiento azul semitransparente con texto */
.curva-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 26, 81, 0) 30%, rgba(0, 26, 81, 0.95) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Padding inferior más grande para que la curva blanca no tape el texto */
    padding: 30px 25px 60px 25px; 
    transition: background 0.4s ease;
    z-index: 2;
}

.curva-card:hover .curva-overlay {
    background: rgba(0, 26, 81, 0.85);
}

.curva-overlay h3 {
    color: #f49d00;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    margin-top: 0;
}

.curva-overlay p {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.curva-card:hover .curva-overlay p {
    opacity: 1;
    transform: translateY(0);
}

/* Textos y Botones Inferiores */
.curva-footer-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.curva-footer-text p {
    color: #333333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
}

.curva-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-curva-dark {
    background-color: #001A51;
    color: #ffffff;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-curva-dark:hover { background-color: #f49d00; }

.btn-curva-light {
    background-color: transparent;
    color: #001A51;
    border: 1px solid #c0c0c0;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}
.btn-curva-light:hover {
    border-color: #001A51;
    background-color: #f8f9fa;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .curva-grid { flex-wrap: wrap; }
    .curva-card { flex: 1 1 50%; height: 250px; } 
    .lente-wrapper {
        height: auto;
    }
    .lente-wrapper::before, .lente-wrapper::after {
        display: none; 
    }
    .curva-overlay { padding-bottom: 30px; }
}

@media (max-width: 768px) {
    .curva-card { flex: 1 1 100%; } 
    .curva-buttons { flex-direction: column; }
}