/* ===== ESTILOS GENERALES ===== */
/* Body */
body {
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Tipografía */
.nunito-sans {
    font-family: "Nunito Sans", serif;
    font-optical-sizing: auto;
}
h1 {
    font-size: 2.5em;
    font-weight: bold;
}
.font-custom-1 {
    font-size: 2em;
}
.font-custom-2 {
    font-size: 1.5em;
}  
.font-custom-3 {
    font-size: 1em;
}

/* Texto y alineación */
.unwarp {
    word-wrap: break-word; 
    overflow-wrap: break-word; 
    text-align: justify;
}
.unwarp-2 {
    word-wrap: break-word; 
    overflow-wrap: break-word; 
    text-align: justify;
    text-justify: distribute;
}
.unwarp-3 {
    word-wrap: break-word; 
    overflow-wrap: break-word; 
    text-align: justify;
    text-overflow: ellipsis; 
}
.align-center {
    display: flex;
    align-items: center;
}

/* Colores de fondo */
.bg-primary {
    background-color: #4a5c84 !important;
}
.bg-secondary {
    background-color: #5178A6  !important;
}
.bg-gradient-light {
    background: rgb(69,69,69);
    background: linear-gradient(180deg, rgba(69,69,69,1) 0%, rgba(188,189,190,1) 8%, rgba(207,208,209,1) 16%, rgba(216,217,218,1) 24%, rgba(248,249,250,1) 32%, rgba(248,249,250,1) 68%, rgba(216,217,218,1) 76%, rgba(207,208,209,1) 84%, rgba(188,189,190,1) 92%, rgba(69,69,69,1) 100%);
}

/* Padding */
.padd-custom-1 {
    padding: 100px;
}

/* ===== COMPONENTES ===== */
/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 96px; /* Asegúrate de que este valor coincida con la altura real de tu header */
}
.nav-link {
    color: white;
    font-family: "Nunito Sans", serif;
    font-optical-sizing: auto;
    font-size: 1.2em;
    font-weight: bold;
}
.nav-link:hover, .nav-link:active {
    color: #4a5c84;
}
.brand-img {
    height: 80px;
    width: auto;
}

/* Botones */
.custom-button {
    color: aliceblue;
    font-family: "Nunito Sans", serif;
    font-optical-sizing: auto;
    font-size: 1.2em; 
    font-weight: bold;
}
.custom-button:hover,
.custom-button:active {
    color: #4a5c84;
}
.custom-button-2 {
    color: aliceblue;
    font-family: "Nunito Sans", serif;
    font-optical-sizing: auto;
    font-size: 2em; 
    font-weight: bold;
}
.custom-button-2:hover,
.custom-button-2:active {
    color: #4a5c84;
}
.custom-button-3 {
    background-color: #4a5c84;
    color: aliceblue;
}
.custom-button-3:hover,
.custom-button-3:active {
    background-color: #5178A6;
    color: aliceblue;
}

/* Floating Action Button (FAB) */
.fab-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}
.fab-button {
    background-color: #4a5c84;
    color: white;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}
.fab-button i {
    font-size: 1.7em;
    margin-top: -2px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}
.fab-container.active .fab-button i {
    transform: rotate(180deg);
}
.fab-options {
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 70px;
    right: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
.fab-container.active .fab-options {
    opacity: 1;
    visibility: visible;
}
.fab-option {
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out;
}
.fab-option i {
    transition: transform 0.3s ease-in-out;
}
.fab-option:hover i {
    transform: rotate(360deg);
}
.whatsapp {
    background-color: #25d366;
    font-size: 1.5em;
}
.phone {
    background-color: #3b5998;
    font-size: 1.5em;
}

/* Footer */
.footer {
    position: relative;
    bottom: 0;
    width: 100%;
    margin-top: auto;
}
.footer-social {
    max-height: 72px;
}

/* ===== ELEMENTOS VISUALES ===== */
/* Imágenes */
.img-fixed {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}
.img-fixed-us {
    max-width: 400px;
    max-height: 400px;
    object-fit: cover;
    aspect-ratio: 1/1;
    display: block;
    margin-left: auto;
    margin-right: auto;
    align-items: center;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    height: 100vh; 
    overflow: hidden;
    margin: 0;
    padding: 0;
}
.video-container::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}
.background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: 0;
}
.overlay-text {
    font-size: large;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);
    color: white;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    z-index: 2;
    max-width: 90%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.overlay-text h1 {
    font-size: 3rem;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.overlay-text p {
    font-size: 1.2rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Aspect Ratio */
.aspect-ratio-16-9 {
    position: relative;
    width: 100%;
    padding-top: 56.25%; 
    overflow: hidden;
}
.aspect-ratio-16-9 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== SECCIONES ESPECÍFICAS ===== */
/* Proyectos */
.proyecto-card {
    height: 300px;
    max-width: 680px;
    position: relative;
    overflow: hidden;
}
.proyecto-card img {
    height: 300px;
    max-width: 680px;
    transition: transform 0.5s ease;
}
.proyecto-card:hover img {
    transform: scale(1.1);
}
.proyecto-card .card-body {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}
.proyecto-card:hover .card-body {
    opacity: 1;
}
.proyecto-card .card-title {
    font-size: 1.5rem;
    color: white;
    text-align: center;
    margin: 0;
    text-shadow: 4px 4px 8px #000;
}
.proyecto-card .card-text {
    font-size: 1rem;
    color: white;
    text-align: center;
    padding: 10px;  
    opacity: 0;
    transition: ease-in-out 0.3s;
}
.proyecto-card:hover .card-text {
    opacity: 1;
}
.proyecto-card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    color: white;
    text-align: center;
    padding: 10px 0;
}
.proyecto-card .obra-id {
    font-size: 1.5rem;
    font-weight: bold;
}
.banner-proyecto {
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.banner-proyecto h1 {
    word-wrap: break-word;
    overflow-wrap: break-word; 
    text-align: center; 
    font-size: 2.5rem; 
    line-height: 1.2;
}

/* Noticias */
.noticia-card {
    height: 400px;
    max-width: 800px;
    position: relative;
    overflow: hidden;
}
.noticia-card img {
    height: 400px;
    max-width: 800px;
    object-fit: cover;
}
.noticia-card .card-body {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.noticia-card .card-title {
    font-size: 1.5rem;
    color: white;
    text-align: center;
    margin: 0;
}
.noticia-card .card-text {
    font-size: 1rem;
    color: white;
    text-align: center;
    padding: 10px;  
}

/* Galería */
.gallery-image {
    width: 100%;
    height: 0;
    padding-bottom: 80%; /* Relación de aspecto 5:4 */
    background-size: cover;
    background-position: center;
    margin-bottom: 15px;
}
.image-grid-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.image-grid {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
}
.image-grid.active {
    display: grid;
}
.image-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
}
.image-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}
.image-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.btn-nav-gallery {
    transition: ease-in-out 0.1s;
}
.btn-nav-gallery:hover {
    transform: scale(1.1);
}

/* US */
.us-container {
    max-width: 500px;
    height: 590px;
    margin: auto;
    overflow: hidden;
}

/* Modal */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
}
.modal-content {
    margin: auto;
    display: grid;
    max-width: 90vh;
    max-height: 100vh;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in-out;
}
.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}
.close:hover,
.close:focus {
    color: #bbb;
}

/* Video Embed */
.embed-responsive-16by9 {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    padding-top: 56.25%;
}
.embed-responsive-16by9 iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: black;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 992px) {
    .navbar {
        height: auto;
    }
    .gallery-image {
        width: calc(25% - 15px);
        margin-right: 15px;
    }
    .gallery-image:nth-child(4n) {
        margin-right: 0;
    }
    .img-fixed-us {
        width: 350px;
    }
}

@media (max-width: 1200px) {
    .image-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1007px) {
    .vertical-center {
        display: flex;
        flex-direction: column-reverse;
        justify-content: center;
        align-items: end;
    }
}

@media (max-width: 770px) {
    .custom-button-2 {
        font-size: 1.5em;
    }   
}

@media (max-width: 768px) {
    .font-custom-2 {
        font-size: 0.9em;
    }
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .overlay-text h1 {
        font-size: 2rem;
    }
    .overlay-text p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .font-custom-1 {
        font-size: 1em;
    }
    .padd-custom-1 {
        padding: 50px;
    }
    .embed-responsive-16by9 {
        padding-top: 75%; 
    }
    .image-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .banner-proyecto h1 {
        font-size: 1.5rem; 
    }
    .overlay-text h1 {
        font-size: 1.5rem; 
    }
    .overlay-text p {
        font-size: 0.9rem; 
    }
}

@media (max-width: 377px) {
    .img-fixed-us {
        width: 300px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.btn-primary {
    background-color: #4a5c84;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
}
.btn-primary:hover {
    background-color: #5178A6;
}
.btn-primary:active {
    background-color: #4a5c84;
}

/* Centrar el menú desplegable */
.dropdown-menu-center {
    left: 50% !important; /* Centra el menú */
    transform: translateX(-50%) !important; /* Ajusta para centrar completamente */
    right: auto !important; /* Asegúrate de que no se aplique el estilo de Bootstrap */
    top: 100% !important; /* Asegúrate de que esté justo debajo del botón */
}

/* Opciones del menú desplegable */
.dropdown-menu {
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-item.active {
    background-color: #0d6efd;
    color: #fff;
    font-weight: bold;
}