/* ==========================================================================
   ESTILOS DE LA GRILLA DE PROYECTOS (DESKTOP + MÓVIL Y ETAPA ARRIBA)
   ========================================================================== */

.section-proyectos-grid {
    width: 100%;
    position: relative;
    box-sizing: border-box;
    background-color: #ffffff; 
    padding: 120px 0 0 0; 
    margin-top: 0; 
    content-visibility: auto;
    contain-intrinsic-size: 1200px; 
    overflow: hidden;
    z-index: 2;
}

/* Flecha gigante animada de fondo */
.parallax-giant-arrow-bg {
    position: absolute;
    width: 65%;
    height: 100%;
    top: 0; 
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background-image: url('../images/flecha-gigante.webp');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: contain;
    pointer-events: none;
    z-index: 1;
    will-change: transform;
    transition: transform 0.08s ease-out; 
}

/* Contenedor Grid (3 columnas en Desktop) */
.proyectos-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 10px; 
    position: relative;
    z-index: 3;
}

/* Tarjeta Base de Proyecto */
.proyecto-card {
    position: relative;
    width: 100%;
    height: 620px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    cursor: pointer;
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* Transición cruzada a Fachada 2 en Hover */
.proyecto-secondary-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;                        
    transform: scale(1);                
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
}

.proyecto-card:hover .proyecto-secondary-bg {
    opacity: 1;
    transform: scale(1.04);
}

/* ==========================================================================
   ETAPA DEL PROYECTO (FIJA EN LA CABECERA SUPERIOR PARA TODOS LOS DISPOSITIVOS)
   ========================================================================== */
.proyecto-hover-status {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 10 !important;
    background-color: rgba(140, 21, 39, 0.9) !important; 
    color: #ffffff !important;
    font-family: 'Exo', sans-serif;
    font-weight: 700;
    font-size: 0.85rem !important;
    text-transform: uppercase;
    text-align: center;
    padding: 12px 10px !important;
    letter-spacing: 1.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    box-sizing: border-box;
}

/* Contenedor de contenido sobrepuesto abajo */
.proyecto-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 3;
}

/* LOGO SIEMPRE VISIBLE */
.proyecto-logo-always-visible {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    min-height: 100px;
    box-sizing: border-box;
    transition: background-color 0.4s ease;
}

.proyecto-logo-always-visible img {
    max-height: 50px !important;
    max-width: 80% !important;
    width: auto !important;
    object-fit: contain !important;
}

/* BLOQUE INTERACTIVO QUE SE DESLIZA EN HOVER (DESKTOP) */
.proyecto-specs-hover {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(20px);
    transition: max-height 0.5s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 0.4s ease, 
                transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.proyecto-card:hover .proyecto-specs-hover {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
}

/* Especificaciones Blancas */
.proyecto-hover-specs {
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    padding: 15px 10px;
    align-items: center;
    justify-content: space-around;
}

.hover-spec-col {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Exo', sans-serif;
    font-size: 0.85rem;
    color: #333333;
}

.hover-spec-col img {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    object-fit: contain !important;
}

.hover-spec-divider {
    width: 1px;
    height: 25px;
    background-color: #ccc;
}

/* ==========================================================================
   TARJETAS CORPORATIVAS ESTÁTICAS Y LÓGICA DE RELLENO SIMÉTRICO
   ========================================================================== */
.corporativo-card {
    width: 100%;
    height: 620px;
    display: none; /* Ocultas por defecto */
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    box-sizing: border-box;
}

.frase-gris { background-color: #2C2825; }
.frase-guinda { background-color: #8C1527; }

.corp-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.corp-house-img {
    width: 48px !important;
    height: auto !important;
    display: block;
    margin-bottom: 25px;
}

.corp-text-main {
    font-family: 'Exo', sans-serif;
    font-weight: 300;
    font-size: 2rem;
    color: #ffffff;
    line-height: 1.25;
    margin: 0;
}

/* RELLENO EN ESCRITORIO (3 COLUMNAS) */
.count-desk-1 .corporativo-card.frase-gris,
.count-desk-1 .corporativo-card.frase-guinda {
    display: flex !important;
}

.count-desk-2 .corporativo-card.frase-gris {
    display: flex !important;
}

/* ==========================================================================
   TABLET RESPONSIVE (2 COLUMNAS)
   ========================================================================== */
@media screen and (min-width: 769px) and (max-width: 992px) {
    .proyectos-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .corporativo-card {
        display: none !important;
    }

    .count-tab-1 .corporativo-card.frase-gris {
        display: flex !important;
    }
}

/* ==========================================================================
   MÓVIL RESPONSIVE - SIN HOVER Y CON SPECS VISIBLES
   ========================================================================== */
@media screen and (max-width: 768px) {
    
    .parallax-giant-arrow-bg {
        display: none !important;
    }

    .section-proyectos-grid {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .proyectos-grid-container {
        grid-template-columns: 1fr;
        gap: 20px !important;
    }

    .proyecto-card {
        height: 640px !important;
        position: relative !important;
        overflow: hidden;
        border-radius: 4px; 
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
    }

    .proyecto-secondary-bg {
        display: none !important;
    }

    /* ESPECIFICACIONES (METRAJE Y CAMAS) SIEMPRE ABIERTAS ABAJO EN MÓVIL */
    .proyecto-specs-hover {
        max-height: none !important;
        opacity: 1 !important;
        transform: none !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .proyecto-hover-specs {
        background-color: rgba(255, 255, 255, 0.95);
        padding: 12px 10px;
        order: -1; /* Mantiene las specs sobre el logo */
    }

    .proyecto-logo-always-visible {
        min-height: 80px;
        padding: 15px;
    }

    .corporativo-card {
        display: none !important;
    }
}

/* ==========================================================================
   ESTILOS COMPLEMENTARIOS PARA LA PÁGINA CATÁLOGO (PORTADA Y FILTROS)
   ========================================================================== */

/* PORTADA HERO CON PARALLAX */
.section-proyectos-hero {
    position: relative;
    width: 100%;
    height: 65vh;
    min-height: 400px;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nosotros-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
}

.nosotros-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.nosotros-hero-title {
    font-family: 'Exo', sans-serif;
    font-size: 3.5rem;
    font-weight: 300;
    color: #ffffff;
    letter-spacing: 4px;
    margin: 0 0 15px 0;
    text-transform: uppercase;
}

.nosotros-breadcrumbs {
    font-family: 'Exo', sans-serif;
    font-size: 0.85rem;
    color: #ffffff;
    letter-spacing: 2px;
    font-weight: 600;
}

.nosotros-breadcrumbs a {
    color: #ffffff;
    text-decoration: none;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #ffffff;
}

.breadcrumb-current {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* BARRA DE FILTROS POR ETAPA */
.section-proyectos-filter {
    padding: 50px 20px 20px 20px;
    background-color: #ffffff;
    text-align: center;
}

.filter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
}

.filter-btn {
    background: transparent;
    border: none;
    padding: 10px 24px;
    font-family: 'Exo', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #333333;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: all 0.3s ease;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #8C1527;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.filter-btn:hover::after {
    width: 80%;
}

.filter-btn.active {
    background-color: #8C1527;
    color: #ffffff;
    border-radius: 2px;
}

.filter-btn.active::after {
    display: none;
}

/* ANIMACIÓN DE FILTRADO */
#catalog-proyectos-grid .proyecto-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* FRASE FINAL DESTACADA */
.section-proyectos-frase {
    padding: 80px 20px;
    background-color: #ffffff;
}

.proyectos-frase-text {
    font-family: 'Exo', sans-serif;
    font-size: 2.2rem;
    font-weight: 400;
    color: #333333;
    max-width: 850px;
    margin: 0 auto;
    line-height: 1.35;
    text-align: center;
}

.proyectos-frase-text .highlight-red {
    color: #8C1527;
    font-weight: 700;
}

/* RESPONSIVE */
@media screen and (max-width: 768px) {
    .nosotros-hero-title {
        font-size: 2.2rem;
    }
    .filter-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    .proyectos-frase-text {
        font-size: 1.5rem;
    }
}