/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header y Nav */
header {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

nav h1 {
    
    font-size: 1.8rem;
}

.nav-container > ul {
    display: flex;
    gap: 2rem;
}

nav a {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
}

nav a:hover,
nav a.active {
    background: #3498db;
}

/* AGREGADO: Logo Nav (feedback usuario) */
.nav-logo {
    
    height: 80px;
    width: auto;
    margin-right: 0;
    margin-left: 30px;
    border-radius: 4px;
}

/* AGREGADO: Estilos para menús desplegables (modernos, accesibles, responsive) */
nav > .nav-container > ul {
    position: relative;
}

nav li {
    position: relative;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #34495e;
    min-width: 240px;
    display: none;
    flex-direction: column; /* Apila enlaces verticalmente */
    align-items: stretch;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    list-style: none;
    padding: 0.5rem 0;
    z-index: 1000;
    gap: 0; /* Espaciado uniforme */
    width: max-content;
}

.dropdown li {
    padding: 0;
    display: block;
}

.dropdown a {
    display: block;
    padding: 0.8rem 1.5rem;
    border-radius: 0;
    font-size: 0.95rem;
    color: #fff;
}

.dropdown a:hover {
    background: #3498db;
    color: #fff;
    visibility: visible;
    transform: translateY(0);
}

nav .nav-container > ul > li:hover > .dropdown,
nav .nav-container > ul > li:focus-within > .dropdown {
    display: flex;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile: Click toggle (JS manejará clases) */
@media (max-width: 768px) {
    .dropdown {
        position: static;
        display: none;
        flex-direction: column;
        align-items: stretch;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        box-shadow: none;
        background: #2c3e50;
    }

    .dropdown.active {
        display: block !important;
        opacity: 1;
        visibility: visible;
        max-height: 1000px;
    }
}

.hero-content,
.nosotros-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h2,
.nosotros-hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Grid y Cards */
.obras-recientes,
.maquinaria,
.mision-vision {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card img {
    width: 100%;
    height: 200px;
    max-width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* AGREGADO v2: Secciones de imágenes uniformes para obras/maquinaria (responsive, sombra) */


.image-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1000px;
    text-align: center;
}

.image-section img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-bottom: 1.5rem;
}

.image-section h4 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.image-section p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.7;
}


@media (max-width: 768px) {
    .image-section {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .image-section img {
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
}

/* Valores */
.valores {
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.valores h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.valores ul {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.valores li {
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
}

.valores li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

/* Formulario Contacto */
.contacto-hero {
    max-width: 600px;   /* igual que el formulario */
    margin: 0 auto;     /* centra horizontalmente */
    text-align: center; /* centra el texto */
    padding: 20px;      /* opcional, para darle aire */
}

.form-section {
    padding: 4rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input,
textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

button {
    background: #3498db;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

button:hover {
    background: #2980b9;
}

/* Contacto Info */
.contacto-info {
    padding: 2rem;
    max-width: 600px;
    margin: 2rem auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

/* Mensajes de éxito/error (Requisito 6) */
.message {
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
}

.success-msg {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-msg {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
}
/* estilos de la pagina agradecimiento*/
.hero.gracias {
  text-align: center;
  padding: 80px 20px;
}

.hero.gracias h2 {
  font-size: 2rem;
  color: #004080; /* azul corporativo */
  margin-bottom: 20px;
}

.hero.gracias p {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #333;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

/* Responsive */
.menu-toggle {
    display: none;
    background: #3498db;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.menu-toggle:hover {
    background: #2980b9;
}

.menu-toggle[aria-expanded="true"] {
    background: #e74c3c;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
    }

    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        position: relative;
    }

    /* Oculta el menú en móvil SOLO cuando JS está presente (clase `js-enabled` añadida por script.js).
       Así, si el JS externo no carga en el host, el menú seguirá accesible en móvil. */
    body.js-enabled nav ul {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, padding 0.4s ease;
        background: #34495e;
        border-radius: 5px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.3);
        padding: 0;
        margin: 0;
    }

    body.js-enabled nav ul.active {
        display: flex;
        max-height: 1000px; /* Ajustable */
        overflow: visible;
        padding: 1rem 0;
        z-index: 1001;
    }

    nav li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    nav li:last-child {
        border-bottom: none;
    }

    nav a {
        display: block;
        padding: 1rem 2rem;
        width: 100%;
    }

    /* Dropdowns dentro menú colapsado */
    .dropdown {
        position: static;
        display: none;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        background: #2c3e50;
        box-shadow: none;
        margin: 0;
    }

    .dropdown.active {
        display: block;
        max-height: 1000px;
        opacity: 1;
        visibility: visible;
    }

    /* Overlay para cerrar */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 50;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s;
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}
/* === Estilos Carrusel Bootstrap === */

#carouselExample img {
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  object-fit: cover;
  max-height: 500px;
}

#carouselExample .carousel-caption {
  background: rgba(0,0,0,0.5);
  padding: 1rem;
  border-radius: 5px;
}
header nav a {
  background: none;       /* quita fondo azul de Bootstrap */
  color: white;           /* tu color original */
  padding: 0.5rem 1rem;   /* tus valores */
  border-radius: 5px;
  transition: background 0.3s;
}

header nav a:hover,
header nav a.active {
  background: #3498db;    /* tu hover original */
  color: white;
}
.btn {
  background: #3498db;
  color: white;
  border-radius: 5px;
  padding: 0.8rem 1.5rem;
}
#carouselExample .carousel-control-prev-icon,
#carouselExample .carousel-control-next-icon {
  filter: invert(1); /* iconos blancos */
}

/* Márgenes laterales para historia y línea de tiempo */
.hero-content, .timeline {
    max-width: 1000px;   /* controla el ancho máximo del bloque */
    margin: 0 auto;      /* centra el contenido */
    padding: 0 2rem;     /* agrega espacio interno a izquierda y derecha */
    text-align: justify; /* opcional: justifica el texto */
}

.timeline ul {
    padding-left: 1rem;  /* separa la lista del borde */
    padding-right: 1rem;
}
/* Ajustes de estilo para Historia y Línea de Tiempo */
.hero-content, .timeline {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: justify;
}

/* Paleta de colores corporativos */
body {
    background-color: #eef2f7; /* gris azulado suave */
    color: #333;
}

header {
    background: #004080; /* azul corporativo */
    color: white;
}

nav a:hover,
nav a.active {
    background: #1abc9c; /* verde agua */
    color: white;
}

.timeline {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 2rem;
    margin: 2rem auto;
}

.timeline h3 {
    color: #004080;
}

.timeline li {
    border-left: 4px solid #1abc9c;
    padding-left: 1rem;
    margin-bottom: 2rem;
}

footer {
    background: #004080;
    color: #fdfdfd;
}
/* Estilos exclusivos para la lista de obras */
.obra-lista {
    list-style-type: none;   /* quita viñetas */
    padding: 0;
    margin: 2rem auto;
    max-width: 900px;
}

.obra-lista li {
    background: #f9f9f9;
    border-left: 4px solid #004080; /* azul corporativo */
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.obra-lista h4 {
    color: #004080;
    margin-bottom: 0.5rem;
}

.obra-lista p {
    margin: 0;
    text-align: justify;
}
