/* --- VARIABLES DE COLOR --- */
:root {
    --color-blue: #003366; 
    --color-red: #E3001C;   
    --color-green: #38761D; 
    --color-black: #000000; 
    --color-white: #FFFFFF;
    --color-light-gray: #F7F7F7; 
    --color-dark-gray: #333333;
    --color-medium-gray: #666666;
    --color-light-blue: #E8F0F8; 
    --color-light-green: #F0FFF0; 
    
    --color-header-bg-transparent: rgba(245, 245, 245, 0.9); 
    --color-header-hover-bg: rgba(220, 220, 220, 0.95); 
    --bg-elegant-gray: #EEEEEE; 
    
    --font-family: 'Poppins', sans-serif;
}

/* --- RESET BÁSICO Y TIPOGRAFÍA GENERAL --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--color-dark-gray); 
    background-color: var(--color-white); 
    text-align: left; 
}

/* FONDO PÁGINA HOME */
body.home-page-background {
    background-image: url('img/constructor-bg-full.png'); 
    background-size: cover; 
    background-repeat: no-repeat; 
    background-position: center center; 
    background-attachment: fixed; 
    background-color: #003366; 
}

/* CAMBIO 3: FONDO PÁGINA CONTACTO (Personalizable) */
/* Solo pon una imagen llamada 'fondocontacto.jpg' en tu carpeta img */
body.contact-page-background {
    background-image: url('img/fondocontacto.jpg'); 
    background-size: cover; 
    background-repeat: no-repeat; 
    background-position: center center; 
    background-attachment: fixed;
    background-color: #f0f0f0; /* Color de respaldo si no hay imagen */
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- CLASES DE COLOR Y FONDO --- */
.black-text { color: var(--color-black); } 
.blue-text { color: var(--color-blue); }
.red-text { color: var(--color-red); }
.green-text { color: var(--color-green); }
.bg-light-blue { 
    background-color: var(--color-light-blue); 
    background-image: none !important;
}
.bg-light-green { 
    background-color: var(--color-light-green); 
    background-image: none !important;
}
.bg-white-pattern {
    background-color: var(--color-white);
    background-image: radial-gradient(rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}
.bg-elegant-gray {
    background-color: var(--bg-elegant-gray);
    background-image: none !important;
}

/* FONDO DE RÍO PARA TÍTULOS DE PÁGINAS INTERNAS */
.bg-river-hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('img/Rios_Laja_y_Biobío.jpg'); 
    background-size: cover;
    background-position: center;
    color: var(--color-white) !important; 
}
.bg-river-hero .section-title,
.bg-river-hero .section-subtitle {
    color: var(--color-white) !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7); 
}

/* --- HEADER Y NAVEGACIÓN --- */
.header {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 10px 5%; 
    background-color: var(--color-header-bg-transparent); 
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); 
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000; 
    height: 90px; 
}
.logo-image {
    height: 75px !important; 
    width: auto;
    display: block;
}
.nav-menu {
    display: flex;
    gap: 0; 
}
.nav-item {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--color-dark-gray);
    position: relative;
    padding: 10px 15px; 
    transition: background-color 0.3s, color 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nav-item:hover, .nav-item.active {
    color: var(--color-blue);
    background-color: var(--color-header-hover-bg); 
}
.nav-item::after {
    content: none;
}

/* --- SECCIONES GENERALES --- */
.section {
    padding: 100px 10%; 
    margin: 0 auto;
    max-width: 1200px;
    text-align: center;
    background-color: var(--color-white);
    background-image: radial-gradient(rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    margin-bottom: 30px; 
}
.section:last-of-type {
    margin-bottom: 0;
}

/* HERO HOME */
.hero-section {
    padding-top: 90px; 
    height: 100vh; 
    width: 100%;
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('img/Rios_Laja_y_Biobío.jpg'); 
    background-size: cover;
    background-position: center center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.hero-title {
    font-size: 3em;
    color: var(--color-white); 
    font-weight: 700;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}
.hero-subtitle {
    font-size: 1.5em;
    color: var(--color-white); 
    font-weight: 300;
}

/* CABECERA PÁGINAS INTERNAS */
.page-hero-title {
    padding-top: 120px; 
    padding-bottom: 50px; 
    text-align: center; 
    margin-bottom: 0; 
}
.page-hero-title .section-title {
    text-align: center;
}
.page-hero-title .section-title::after {
    content: none; 
}
.section-subtitle {
    font-size: 1.1em;
    color: var(--color-medium-gray);
    max-width: 800px;
    margin: 0 auto;
}

/* SOBRE NOSOTROS (Home) */
.about-summary {
    padding-top: 70px !important; 
    padding-bottom: 100px !important; 
}
.section-title {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 30px;
    padding-bottom: 10px;
    position: relative;
    text-transform: uppercase;
    color: var(--color-black); 
}
.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 80px;
    height: 4px;
    background-color: var(--color-red);
    border-radius: 2px;
}

/* BOTONES */
.btn {
    display: inline-block;
    padding: 12px 30px;
    margin-top: 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}
.primary-btn {
    background-color: var(--color-blue);
    color: var(--color-white);
}
.primary-btn:hover {
    background-color: #004488; 
    transform: translateY(-2px);
}
.secondary-btn {
    background-color: var(--color-red);
    color: var(--color-white);
}
.secondary-btn:hover {
    background-color: #A30015; 
    transform: translateY(-2px);
}

/* SERVICIOS */
.services-summary .section-title {
    margin-bottom: 50px;
}
.services-cards-container {
    display: flex;
    justify-content: space-evenly;
    gap: 30px;
    margin-top: 30px;
}
.service-card {
    flex-basis: 30%;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
    background-color: var(--color-white);
    transition: transform 0.3s, box-shadow 0.3s;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}
.service-card .icon-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background-color: var(--color-light-gray); 
    border: 2px solid var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.service-card:hover .icon-circle {
    transform: scale(1.05);
    background-color: var(--color-blue); 
    border-color: var(--color-red);
}
.service-card .icon-placeholder {
    font-size: 2.5em;
    color: var(--color-blue);
    transition: color 0.3s;
}
.service-card:hover .icon-placeholder {
    color: var(--color-white);
}

/* CLIENTES */
.client-layout-container {
    display: flex;
    justify-content: space-evenly; 
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
}
.client-column {
    flex-basis: 30%;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
.client-logo-box {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--color-light-gray);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    padding: 10px; 
    display: flex;
    align-items: center;
    justify-content: center;
}
.client-logo-box:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}
.client-logo-box.rectangular {
    border-radius: 15px; 
    width: 250px;
    min-height: 120px;
}
.client-logo-box.circular {
    border-radius: 50%; 
    width: 120px;
    height: 120px;
    min-height: auto;
}
.client-logo-box.circular:hover {
    transform: scale(1.1);
}
.client-logo-img {
    max-width: 90%;
    max-height: 80px;
    height: auto;
    display: block;
}
.client-logo-img.small-muni {
    max-height: 70px; 
    max-width: 90%;
}
.pyramid-top {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px; 
}
.pyramid-bottom {
    display: flex;
    justify-content: center; 
}

/* PROYECTOS */
.carousel-container {
    overflow: hidden;
    position: relative;
    width: 80%; 
    max-width: 900px;
    margin: 40px auto; 
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}
.project-carousel {
    display: flex;
    transition: transform 0.5s ease-in-out; 
}
.project-slide {
    width: 100%; 
    height: 400px; 
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: var(--color-white);
    font-style: italic;
    background-color: var(--color-blue); 
    background-size: cover; 
    background-position: center;
}

/* ESTILOS COMPARTIDOS */
.content-block {
    padding: 60px 10%; 
    text-align: left; 
    border-bottom: 1px solid var(--color-light-gray);
    max-width: 1000px;
    margin: 0 auto;
}
.block-title {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    text-transform: uppercase;
}
.content-block .block-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 60px;
    height: 4px;
    background-color: var(--color-red); 
    border-radius: 2px;
}
.content-block p {
    font-size: 1.1em;
    color: var(--color-medium-gray);
    text-indent: 40px; 
    margin-top: 20px;
    line-height: 1.8;
}
.rut-info {
    text-indent: 0 !important;
    font-weight: 600;
    color: var(--color-red);
}
.intro-description-wrapper {
    text-align: left;
    max-width: 750px; 
    margin: 0 auto;
    padding-top: 80px; 
}

/* PROYECTOS BLOCK */
.project-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 60px 0;
    border-bottom: 1px solid var(--color-light-gray);
    text-align: left;
}
.project-block:last-child {
    border-bottom: none;
}
.project-info {
    flex-basis: 45%;
    padding: 20px;
}
.project-carousel-container {
    flex-basis: 45%;
    height: 200px; 
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}
.project-block.layout-right {
    flex-direction: row-reverse;
}
.project-carousel-container .project-carousel {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}
.project-carousel-container .project-carousel-slide {
    width: 100%; 
    height: 100%;
    flex-shrink: 0;
    object-fit: cover; 
    cursor: pointer; 
}

/* --- ESTILOS DE PÁGINA CONTACTO (ACTUALIZADO) --- */

.contact-section {
    padding: 60px 5%;
    /* FONDO TRANSPARENTE PARA VER IMAGEN DE FONDO 'fondocontacto.jpg' */
    background-color: transparent; 
}

/* Contenedor FLEX: Tarjeta Blanca */
.contact-container-flex {
    display: flex;
    flex-direction: row; 
    align-items: stretch; 
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto;
    background-color: #fff; /* La tarjeta se mantiene blanca */
    box-shadow: 0 10px 30px rgba(0,0,0,0.25); 
    border-radius: 12px;
    overflow: hidden; 
}

/* COLUMNA IZQUIERDA: TEXTO */
.contact-text-box {
    width: 50%; 
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    background-color: var(--color-white);
    box-sizing: border-box;
}

.contact-title {
    color: var(--color-red);
    font-size: 1.8em;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--color-blue);
    display: inline-block;
    padding-bottom: 10px;
    font-weight: 700;
}

.data-item {
    margin-bottom: 25px;
    text-align: left;
}

.data-item .label {
    display: block;
    font-weight: 700;
    font-size: 0.85em;
    color: var(--color-medium-gray);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.data-item p, .data-item a {
    font-size: 1.1em;
    color: var(--color-dark-gray);
    font-weight: 500;
    margin: 0;
    text-decoration: none;
}

/* ESTILOS REDES SOCIALES */
.social-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.social-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 700;
    text-decoration: none;
    color: white;
    transition: opacity 0.3s;
}
.social-btn:hover {
    opacity: 0.9;
    color: white;
}
.social-btn.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.social-btn.facebook {
    background-color: #1877F2;
}

/* COLUMNA DERECHA: MAPA */
.contact-map-box {
    width: 50%; 
    position: relative;
    min-height: 450px; 
    box-sizing: border-box;
}

.contact-map-box iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .contact-container-flex {
        flex-direction: column; 
    }
    .contact-text-box {
        width: 100%;
        padding: 30px 20px;
        text-align: center;
    }
    .data-item {
        text-align: center;
    }
    .social-links {
        justify-content: center;
    }
    .contact-map-box {
        width: 100%;
        height: 350px; 
        min-height: 350px;
    }
}


/* SCROLL REVEAL */
.reveal-item {
    opacity: 0; 
    transform: translateY(40px); 
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
}
.reveal-item.active {
    opacity: 1; 
    transform: translateY(0); 
}

/* FOOTER */
.main-footer {
    background-color: #2c3e50; 
    color: #ecf0f1; 
    padding: 60px 5%; 
    font-size: 0.9em;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 30px; 
    max-width: 1200px;
    margin: 0 auto;
}

.footer-column {
    flex: 1;
    min-width: 200px; 
    max-width: 300px;
    text-align: left;
}

.footer-column h4 {
    color: #e0e0e0; 
    font-size: 1.2em;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column h4.red-text {
    color: #e0e0e0 !important; 
}

.footer-column p, .footer-column li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column a {
    color: #9bd0e5; 
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-column a:hover {
    color: #E53935; 
}

.footer-column.legal {
    text-align: left; 
}
@media (min-width: 769px) {
    .footer-column.legal {
        text-align: right; 
    }
}

/* LIGHTBOX */
.lightbox {
    display: none; 
    position: fixed;
    z-index: 9999;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}
.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    animation: zoom 0.6s;
}
@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}
.lightbox-close {
    position: absolute;
    top: 35px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}
.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
/* IMAGEN EXTRA */
.image-section {
    width: 100%;
    overflow: hidden; 
    margin-top: -30px; 
    margin-bottom: 50px; 
    padding: 0;
}
.image-section .full-width-image {
    width: 100%;
    height: auto; 
    display: block; 
    object-fit: cover; 
    max-height: 500px; 
}
/* VALORES LISTA */
.value-list {
    list-style: none; 
    padding-left: 0;
    margin-top: 20px;
}
.value-list li {
    font-size: 1.1em;
    color: var(--color-medium-gray);
    margin-bottom: 10px;
    padding-left: 25px; 
    position: relative;
    text-indent: 0; 
}
.value-list li::before {
    content: "✓"; 
    color: var(--color-blue); 
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}