/* --- RESET Y CONFIGURACIÓN GLOBAL --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #2d3748;
    color: #E2E8F0;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* --- FONDO DINÁMICO (CON VERDE) --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 15% 25%, rgba(59, 130, 246, 0.25), transparent 45%),
                radial-gradient(circle at 85% 75%, rgba(99, 102, 241, 0.25), transparent 45%),
                radial-gradient(circle at 50% 50%, rgba(74, 222, 128, 0.2), transparent 50%);
    z-index: -1;
    animation: aurora-flow 22s ease-in-out infinite;
}

@keyframes aurora-flow {
    0% { transform: rotate(0deg) scale(1.5); opacity: 0.8; }
    50% { transform: rotate(180deg) scale(1.8); opacity: 1; }
    100% { transform: rotate(360deg) scale(1.5); opacity: 0.8; }
}


/* --- UTILIDADES --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: #FFFFFF;
}

.text-center {
    text-align: center;
}

.mt-12 {
    margin-top: 3rem;
}

/* --- HEADER Y NAVEGACIÓN --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.4s ease, padding 0.4s ease;
    padding: 20px 0;
}

.header.scrolled {
    background-color: rgba(45, 55, 72, 0.85);
    backdrop-filter: blur(10px);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
    transition: height 0.4s ease;
}

.header.scrolled .logo img {
    height: 40px;
}

.right-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    color: #CBD5E0;
    text-decoration: none;
    font-weight: 600;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3B82F6;
    transition: width 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: #FFFFFF;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.lang-switcher button {
    background: none;
    border: none;
    color: #CBD5E0;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s;
    padding: 5px;
}

.lang-switcher button.active {
    color: #3B82F6;
}

/* --- SOLUCIÓN AL SOLAPAMIENTO DEL MENÚ --- */
main#main-content {
    padding-top: 90px; /* Altura aproximada del header */
}

/* --- HERO SECTION --- */
.hero-section {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
    margin-top: -90px; /* Compensa el padding-top del main */
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    z-index: 0;
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.hero-text-container h1 {
    font-size: 2.2rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 20px;
}

.trabinox-logo-container .hero-logo {
    max-width: 450px;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.1rem;
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- BOTONES --- */
.cta-button, .cta-button-secondary {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 30px;
    border: 2px solid transparent;
    cursor: pointer;
}

.cta-button {
    background-color: #3B82F6;
    color: #FFFFFF;
    border-color: #3B82F6;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.cta-button-secondary {
    background-color: #FFFFFF;
    color: #1E3A8A; /* Azul oscuro para el texto */
    border-color: #FFFFFF;
}

.cta-button-secondary:hover {
     background-color: transparent;
     color: #FFFFFF;
}

/* --- AREAS GRID (TARJETAS CON ENLACE) --- */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

a.area-card {
    background-color: rgba(45, 55, 72, 0.5);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none; /* Quita el subrayado del enlace */
    color: #E2E8F0; /* Establece el color de texto por defecto */
}

a.area-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.area-card-image {
    height: 200px;
    width: 100%;
}

.area-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra sin deformarse */
}

.area-card-content {
    padding: 25px;
}

.area-card h3 {
    font-size: 1.5rem;
    color: #FFFFFF;
    margin-bottom: 10px;
}

/* --- CTA Section --- */
.section-cta {
    position: relative;
    padding: 100px 0;
    color: #FFFFFF;
    text-align: center;
    overflow: hidden;
}

.cta-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -2;
    filter: brightness(0.5);
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

/* --- FOOTER --- */
.footer {
    background-color: #1a2c42;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- PÁGINAS INTERIORES (NOSOTROS, SERVICIOS, ETC) --- */
.page-header {
    padding: 80px 0;
    position: relative;
    text-align: center;
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-header .page-title {
    font-size: 3rem;
    font-weight: 800;
}

.page-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
    z-index: -1;
}

/* --- SECCIONES DE CONTENIDO (NOSOTROS) --- */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.content-grid.reverse-grid {
    direction: rtl;
}
.content-grid.reverse-grid > * {
    direction: ltr;
}

.content-text p {
    margin-bottom: 1rem;
}

.content-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}


/* --- SECCIÓN CONTADOR --- */
.counter-section {
    position: relative;
    padding: 100px 0;
    text-align: center;
    color: #fff;
}
.counter-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Efecto Parallax */
    filter: brightness(0.4);
    z-index: -1;
}

.counter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.counter-item span.counter-number {
    font-size: 4rem;
    font-weight: 800;
}
.counter-item p.counter-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #a0aec0;
}


/* --- PÁGINA DE CONTACTO --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    align-items: start;
}

.info-item {
    margin-bottom: 25px;
}

.info-item h3 {
    font-size: 1.2rem;
    color: #a0aec0;
}
.info-item p, .info-item a {
    font-size: 1.1rem;
    color: #63B3ED; /* Azul claro más brillante y legible */
    text-decoration: none;
}
.info-item a:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 20px;
}
.form-input {
    width: 100%;
    padding: 15px;
    background-color: rgba(45, 55, 72, 0.7);
    border: 1px solid #4A5568;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 1rem;
}
.form-input::placeholder {
    color: #a0aec0;
}
.form-input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

/* --- PÁGINA DE SERVICIOS --- */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.service-grid.grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
}

.service-card {
    background-color: rgba(45, 55, 72, 0.5);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.service-card-image {
    height: 220px;
    width: 100%;
}

.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.service-card:hover .service-card-image img {
    transform: scale(1.05);
}

.service-card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.service-card-content h3 {
    font-size: 1.5rem;
    color: #FFFFFF;
    margin-bottom: 20px;
}

.popup-button {
    align-self: flex-start;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #FFFFFF;
    background-color: #FFFFFF;
    color: #1E3A8A;
    cursor: pointer;
}

.popup-button:hover {
    background-color: transparent;
    color: #FFFFFF;
}

/* --- POP-UP STYLES --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background-color: #2d3748;
    padding: 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 2rem;
    cursor: pointer;
}

.popup-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #3B82F6;
}

.popup-content h3 {
    font-size: 1.2rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #a0aec0;
}

.popup-content p {
    margin-bottom: 15px;
}

.popup-content ul {
    list-style: none;
    padding-left: 0;
}

.popup-content ul li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 10px;
}

.popup-content ul li::before {
    content: '✓';
    color: #3B82F6;
    position: absolute;
    left: 0;
}

/* --- PÁGINA DE PROYECTOS --- */
.project-carousel {
    padding: 20px 0;
    position: relative;
}

.project-slide {
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.project-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-slide:hover img {
    transform: scale(1.1);
}

.project-slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.project-slide:hover .project-slide-overlay {
    transform: translateY(0);
}

.project-slide-overlay h3 {
    font-size: 1.5rem;
}

.swiper-pagination-bullet-active {
    background-color: #3B82F6 !important;
}

.swiper-navigation {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 20px;
}

.swiper-button-prev, .swiper-button-next {
    position: static;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    transition: background-color 0.3s ease;
}
.swiper-button-prev:hover, .swiper-button-next:hover {
    background-color: #3B82F6;
}
.swiper-button-prev::after, .swiper-button-next::after {
    font-size: 1.2rem;
    font-weight: bold;
}


/* --- RESPONSIVE --- */
.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #FFFFFF;
    transition: all 0.3s ease-in-out;
}

@media (max-width: 768px) {
    .section-title, .page-header .page-title { font-size: 2rem; }
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        justify-content: center;
        background-color: #2d3748;
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: left 0.3s ease-in-out;
        gap: 20px;
        padding-top: 70px;
    }
    .nav-menu.active { left: 0; }
    .hamburger { display: block; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    .hero-text-container h1 { font-size: 1.8rem; }
    .trabinox-logo-container .hero-logo { max-width: 300px; }
    .content-grid, .content-grid.reverse-grid {
        grid-template-columns: 1fr;
        direction: ltr;
    }
    .content-grid > *:first-child {
        margin-bottom: 30px;
    }
    .counter-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    .contact-grid { grid-template-columns: 1fr; }
    .service-grid.grid-2x2 {
        grid-template-columns: 1fr;
    }
}
