/* =========================================
   VARIABLES DE MARCA (CELAYA INGENIERÍA)
   ========================================= */
:root {
    --color-primary: #F1BE3B; /* Amarillo/Dorado */
    --color-secondary: #00C2D1; /* Cian/Turquesa */
    --color-dark: #000000;
    --font-heading: 'Nunito', 'Tsukushi A Round Gothic', sans-serif;
    --font-body: 'PT Sans', sans-serif;
}

/* =========================================
   RESET BÁSICO
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 140px; /* Compensa la altura del header fixed con el logo completo */
}

html, body {
    width: 100%;
    height: 100%;
    font-family: var(--font-body);
    background-color: var(--color-dark);
}

/* =========================================
   CONTENEDOR PRINCIPAL Y FONDO
   ========================================= */
.background-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    /* Usando la imagen IA como solicitaste */
    background-image: url('fondo_ai.jpg'); 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
}

/* Capa oscura superpuesta (Overlay) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65); /* Oscurecido al 65% para contraste */
    z-index: 1; 
}

/* =========================================
   BARRA DE NAVEGACIÓN (HEADER)
   ========================================= */
.navbar {
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 3;
}

.logo-container .logo {
    height: 50px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.logo-container .logo-main {
    height: 100px; /* Tamaño mayor para el logo vertical completo */
}

.logo-container .logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-secondary);
}

/* =========================================
   CONTENIDO CENTRAL (HERO)
   ========================================= */
.content {
    position: relative;
    z-index: 2;
    color: #ffffff;
    text-align: center;
    flex-grow: 1; /* Ocupa el espacio restante */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.content h1 {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    line-height: 1.2;
}

.content p {
    font-size: 1.2rem;
    max-width: 100%;
    margin-bottom: 40px;
    line-height: 1.6;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    white-space: nowrap;
}

/* =========================================
   BOTONES DE LLAMADA A LA ACCIÓN
   ========================================= */
.cta-buttons {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 15px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--color-primary); /* Amarillo */
    color: var(--color-dark);
    border: 2px solid var(--color-primary);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--color-primary);
}

.btn-secondary {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.btn-secondary:hover {
    background-color: #ffffff;
    color: var(--color-dark);
}

/* =========================================
   SECCIÓN DE SERVICIOS
   ========================================= */
.services-section {
    position: relative;
    width: 100%;
    padding: 80px 20px;
    background-image: url('bg_servicios_light.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Efecto parallax suave */
    color: #ffffff;
}

.services-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(25, 25, 25, 0.50); /* Opacidad reducida al 50% */
    z-index: 1;
}

.services-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.services-header {
    text-align: center;
    margin-bottom: 60px;
}

.logo-original {
    height: 120px;
    margin-bottom: 20px;
}

.services-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffffff;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.service-card {
    background-color: rgba(35, 35, 35, 0.90); /* Tarjetas oscuras translúcidas */
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.4s ease;
    border-bottom: 3px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    border-bottom: 3px solid var(--color-primary); /* Amarillo de marca */
    box-shadow: 0 15px 40px rgba(0,0,0,0.7);
}

.service-card .icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.service-card:hover .icon {
    transform: scale(1.1);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #ffffff;
    font-family: var(--font-heading);
}

.service-card p {
    font-size: 1rem;
    color: #cccccc;
    line-height: 1.6;
}

/* =========================================
   PROYECTOS DESTACADOS
   ========================================= */
.projects-section {
    background-color: #111111;
    padding: 80px 20px;
    color: #ffffff;
}

.projects-container {
    max-width: 1200px;
    margin: 0 auto;
}

.projects-section h2 {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 50px;
    letter-spacing: 2px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.project-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.project-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover img {
    transform: scale(1.1);
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: #fff;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.project-card:hover .project-info {
    transform: translateY(0);
    opacity: 1;
}

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

.project-info p {
    font-size: 0.9rem;
    color: #ddd;
}

.cta-container-center {
    text-align: center;
}

/* =========================================
   SOBRE NOSOTROS (TEMA CLARO)
   ========================================= */
.about-section {
    background-color: #ffffff;
    color: #222222;
    padding: 100px 20px;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-text {
    flex: 1;
}

.about-text h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #111111;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555555;
    margin-bottom: 30px;
}

.values-list {
    list-style: none;
    padding: 0;
}

.values-list li {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #333;
}

.values-list strong {
    color: #111;
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-logo {
    max-width: 400px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.05));
}

/* =========================================
   TEASER CELAYA LAB (INDEX)
   ========================================= */
.lab-teaser {
    background-color: #111111;
    background-image: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    text-align: center;
    padding: 70px 20px;
    border-top: 1px solid #333;
}

.teaser-container {
    max-width: 800px;
    margin: 0 auto;
}

.lab-teaser h2 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.lab-teaser p {
    color: #cccccc;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* =========================================
   CELAYA LAB (SUBPÁGINA)
   ========================================= */
.lab-section {
    background-color: #000000;
    color: #ffffff;
    padding: 100px 20px;
    position: relative;
    overflow: hidden;
}

.lab-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 194, 209, 0.25) 0%, transparent 60%),
        radial-gradient(circle at 90% 80%, rgba(241, 190, 59, 0.15) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.lab-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.lab-header {
    text-align: center;
    margin-bottom: 60px;
}

.lab-header h2 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(0, 194, 209, 0.3);
}

.lab-header h2 span {
    color: var(--color-secondary);
}

.lab-header p {
    font-size: 1.15rem;
    color: #e2e8f0;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

.lab-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.lab-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.4s ease;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
}

.lab-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 194, 209, 0.8);
    box-shadow: 0 15px 40px 0 rgba(0, 194, 209, 0.25);
}

.lab-icon {
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(0, 194, 209, 0.4));
}

.lab-svg {
    width: 48px;
    height: 48px;
    stroke: var(--color-secondary);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lab-card h3 {
    font-size: 1.4rem;
    font-family: var(--font-heading);
    margin-bottom: 15px;
    color: #ffffff;
}

.lab-card p {
    font-size: 1rem;
    color: #e2e8f0;
    line-height: 1.8;
    margin-bottom: 30px;
    flex-grow: 1;
}

.btn-lab {
    padding: 12px 20px;
    font-size: 1rem;
    width: 100%;
    background-color: transparent;
    border: 1px solid var(--color-secondary);
    color: var(--color-secondary);
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-lab:hover {
    background-color: var(--color-secondary);
    color: #000000;
    box-shadow: 0 0 20px rgba(0, 194, 209, 0.6);
}

.btn-lab-solid {
    background-color: var(--color-secondary);
    color: #000000;
    box-shadow: 0 0 20px rgba(0, 194, 209, 0.4);
}

.btn-lab-solid:hover {
    background-color: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
}

.lab-link {
    color: var(--color-primary) !important;
    font-weight: bold;
}

/* =========================================
   BIBLIOTECA DEL LAB (CONTENT FEED)
   ========================================= */
.library-section {
    background-color: #000000;
    padding: 20px 20px 100px;
    color: #ffffff;
}

.library-header {
    text-align: center;
    margin-bottom: 40px;
}

.cyan-divider {
    width: 60px;
    height: 3px;
    background-color: var(--color-secondary);
    border: none;
    margin: 0 auto 20px;
    border-radius: 2px;
}

.library-header h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.library-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 50px;
}

.filter-btn {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    padding: 10px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--color-secondary);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.filter-btn.active {
    background-color: rgba(0, 194, 209, 0.15);
    color: #ffffff;
    border-color: var(--color-secondary);
    box-shadow: 0 4px 15px rgba(0, 194, 209, 0.1);
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.content-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    border-color: rgba(0, 194, 209, 0.3);
}

.content-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #111;
    overflow: hidden;
}

.content-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.5s ease;
}

.content-card:hover .content-img-wrapper img {
    opacity: 1;
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.8);
    z-index: 2;
    transition: all 0.3s ease;
}

.play-overlay svg {
    fill: #ffffff;
    width: 20px;
    height: 20px;
    margin-left: 3px;
}

.content-card:hover .play-overlay {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    box-shadow: 0 0 15px rgba(0, 194, 209, 0.6);
}

.content-card:hover .play-overlay svg {
    fill: #000000;
}

.content-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.content-meta {
    font-size: 0.8rem;
    color: var(--color-secondary);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.content-title {
    font-size: 1.25rem;
    color: #ffffff;
    font-family: var(--font-heading);
    line-height: 1.4;
    margin: 0;
}

/* =========================================
   CONTACTO
   ========================================= */
.contact-section {
    background-color: #0a0a0a;
    color: #ffffff;
    padding: 80px 20px;
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 60px;
}

.contact-info, .contact-form {
    flex: 1;
}

.contact-info h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.contact-info p {
    color: #aaaaaa;
    margin-bottom: 30px;
}

.contact-details p {
    font-size: 1.1rem;
    color: #eeeeee;
    margin-bottom: 10px;
}

.map-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
}

.map-link:hover {
    text-decoration: underline;
}

.social-links {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #1a1a1a;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.social-links a:hover {
    background-color: var(--color-primary);
    color: #111;
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input, .contact-form select, .contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #333;
    background-color: #111111;
    color: #ffffff;
    border-radius: 5px;
    font-family: 'PT Sans', sans-serif;
    font-size: 1rem;
}

.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.btn-submit {
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
    color: #aaaaaa;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
}

/* =========================================
   RESPONSIVE (DISPOSITIVOS MÓVILES)
   ========================================= */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }

    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        align-items: center; /* Centrar elementos horizontalmente */
        padding: 20px 0;
        gap: 10px;
    }

    .nav-links a {
        padding: 15px; /* Área de toque más grande para celulares */
        font-size: 1.1rem; /* Texto ligeramente más grande */
        width: 100%; /* Ocupar todo el ancho para facilitar el clic */
        text-align: center;
    }

    .nav-links.active {
        display: flex;
    }

    .logo-container .logo {
        height: 100px;
    }

    .content h1 {
        font-size: 2.5rem;
    }
    
    .content p {
        font-size: 1rem;
        white-space: normal;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .btn {
        text-align: center;
    }

    /* Adaptar servicios a móviles */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .logo-original {
        height: 90px;
    }

    /* Adaptar Proyectos, Nosotros, Lab y Contacto a móviles */
    .projects-grid, .lab-grid {
        grid-template-columns: 1fr;
    }

    .about-container, .contact-container {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo-container .logo {
        height: 80px;
    }
    .content h1 {
        font-size: 1.8rem;
    }
    .content p {
        font-size: 0.9rem;
    }
}
