/* Variables y Resets */
:root {
    --color-primary: #007aff; /* Azul Apple */
    --color-dark: #1c1c1e; /* Fondo oscuro moderno */
    --color-light: #f5f5f7; /* Blanco roto */
    --color-text: #ffffff; /* Texto principal */
    --font-family: 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-dark);
    color: var(--color-text);
    scroll-behavior: smooth;
    overflow-x: hidden; /* Evitar scroll horizontal */
}

/* ------------------------------------------------------------------- */
/* Barra de Navegación */
/* ------------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 1000;
    background-color: rgba(28, 28, 30, 0.9); 
    backdrop-filter: blur(10px); 
    transition: all 0.3s ease-in-out;
}

.logo {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--color-light);
}

.navbar nav a {
    color: var(--color-light);
    text-decoration: none;
    margin-left: 30px;
    font-size: 0.95em;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.navbar nav a:hover {
    opacity: 1;
}

/* Estilo para el botón de hamburguesa (oculto por defecto en desktop) */
.menu-toggle {
    display: none; 
    cursor: pointer;
    font-size: 1.8em;
    color: var(--color-light);
}

/* ------------------------------------------------------------------- */
/* Secciones de Pantalla Completa (Full-Screen) */
/* ------------------------------------------------------------------- */
.full-screen {
    min-height: 100vh; /* Usamos min-height para evitar cortes de contenido en mobile */
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 100px 20px; /* Padding general para mejor espaciado */
    transition: opacity 1.5s ease-out, transform 1s ease-out;
}

.hidden {
    opacity: 0;
    transform: translateY(50px); 
    pointer-events: none;
}

.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Contenido dentro de las Secciones */
.content-wrapper {
    max-width: 900px;
    padding: 40px;
    width: 100%;
}

.full-screen h1, .full-screen h2 {
    font-size: 3.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

.full-screen p {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.8;
}

/* Botón de Llamada a la Acción (CTA) */
.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--color-primary);
    color: var(--color-dark); 
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
}

.cta-button:hover {
    background-color: #005bb5;
    transform: scale(1.05);
}

/* ------------------------------------------------------------------- */
/* Estilos Específicos de las Secciones */
/* ------------------------------------------------------------------- */

/* Historia */
.stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 40px;
}
.stats span {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--color-primary);
}

/* Proyectos */
.gallery {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap; /* Permite que las imágenes se apilen en mobile */
}
.gallery img {
    width: 45%;
    max-width: 350px;
    height: auto; /* Ajuste automático para mobile */
    min-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Maquinaria */
.machine-list {
    list-style: none;
    padding: 0;
    font-size: 1.1em;
    line-height: 2;
}

/* Contacto (Formulario) */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.contact-form input, 
.contact-form textarea {
    padding: 15px;
    border: none;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
    font-size: 1em;
}

.contact-form button {
    cursor: pointer;
    background-color: var(--color-primary);
    color: var(--color-dark);
    font-weight: 600;
    border: none;
    padding: 15px;
    border-radius: 50px;
    transition: background-color 0.3s;
}

/* ------------------------------------------------------------------- */
/* MEDIA QUERIES (RESPONSIVE DESIGN) */
/* ------------------------------------------------------------------- */
@media (max-width: 768px) {
    
    /* Adaptación de la Barra de Navegación */
    .navbar {
        padding: 15px 25px;
    }

    .navbar nav {
        /* Oculta el menú por defecto en mobile */
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 60px; /* Debajo de la barra */
        left: 0;
        width: 100%;
        background-color: rgba(28, 28, 30, 0.95);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 10px 0;
    }
    
    .navbar nav.active {
        /* Muestra el menú cuando el toggle está activo (clase añadida por JS) */
        display: flex; 
    }

    .navbar nav a {
        margin: 0;
        padding: 15px 25px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        text-align: left;
    }
    
    /* Muestra el botón de hamburguesa */
    .menu-toggle {
        display: block;
    }
    
    /* Adaptación del Contenido de las Secciones */
    .full-screen {
        padding: 80px 15px;
        /* Aseguramos que las secciones de contenido no sean 100vh para evitar desbordamiento */
        min-height: auto; 
    }

    .full-screen h1 {
        font-size: 2.5em;
    }
    
    .full-screen h2 {
        font-size: 2em;
    }

    .full-screen p {
        font-size: 1em;
    }

    /* Ajuste de elementos específicos */
    .stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .gallery img {
        width: 90%; /* Las imágenes ocupan casi todo el ancho */
        min-height: 180px;
    }

}
/* =================================================================== */
/* NUEVOS ESTILOS A PARTIR DE LAS MODIFICACIONES */
/* =================================================================== */

/* ------------------------------------------------------------------- */
/* SECCIÓN INICIO (VIDEO) */
/* ------------------------------------------------------------------- */
#inicio {
    overflow: hidden; /* Asegura que el video no se desborde */
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Coloca el video detrás del contenido */
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(28, 28, 30, 0.6); /* Capa oscura para legibilidad del texto */
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que el video cubra todo el espacio */
}

/* ------------------------------------------------------------------- */
/* SECCIÓN HISTORIA (MOSAICO) */
/* ------------------------------------------------------------------- */
.photo-mosaic {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    grid-auto-rows: 150px;
    gap: 10px;
    margin-top: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.mosaic-item {
    overflow: hidden;
    border-radius: 8px;
}

.mosaic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.mosaic-item:hover img {
    transform: scale(1.1);
}

/* Tamaños diferentes para un efecto de mosaico más dinámico */
.mosaic-item:nth-child(3n+1) {
    grid-column: span 2;
    grid-row: span 1;
}
.mosaic-item:nth-child(4n+2) {
    grid-column: span 1;
    grid-row: span 2;
}


/* ------------------------------------------------------------------- */
/* SECCIÓN PROYECTOS (GALERÍA 4 COLUMNAS) */
/* ------------------------------------------------------------------- */
.gallery-proyectos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-top: 40px;
}

.project-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
    transition: transform 0.3s ease;
}

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

.project-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.project-card figcaption {
    padding: 20px;
}

.project-card h3 {
    margin-bottom: 5px;
    color: var(--color-light);
}

.project-card p {
    font-size: 0.9em;
    opacity: 0.7;
    margin: 0;
}


/* ------------------------------------------------------------------- */
/* SECCIÓN MAQUINARIA (TARJETAS) */
/* ------------------------------------------------------------------- */
.machinery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.machinery-card {
    background-color: #2c2c2e; /* Un poco más claro que el fondo */
    border-radius: 12px;
    overflow: hidden;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.machinery-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.machinery-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.machinery-title h3 {
    font-size: 1.2em;
    margin: 0;
}

.machinery-title input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.machinery-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.info-polaroid {
    background: var(--color-light);
    color: var(--color-dark);
    padding: 10px;
    border-radius: 4px;
    font-size: 0.85em;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.info-polaroid strong {
    display: block;
    font-size: 0.9em;
    opacity: 0.7;
}

/* ------------------------------------------------------------------- */
/* MEDIA QUERIES (AJUSTES ADICIONALES) */
/* ------------------------------------------------------------------- */
@media (max-width: 768px) {
    .gallery-proyectos {
        grid-template-columns: 1fr; /* Una columna en móvil */
    }
}
