/* Custom Properties para Light Theme / Corporativo */
:root {
    /* Fondos */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;

    /* Primary (Naranja Maple) */
    --primary-50: #FFF7ED;
    --primary-100: #FFEDD5;
    --primary-200: #FED7AA;
    --primary-300: #FDBA74;
    --primary-400: #FB923C;
    --primary-500: #F97316;
    --primary-600: #EA580C;
    --primary-rgb: 249, 115, 22;

    /* Textos (Grises) */
    --text-primary: #1F2937;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;

    /* Gradientes */
    --hero-gradient: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* Reset y Bases */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-primary);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.py-section {
    padding: 96px 0;
}

.mt-4 {
    margin-top: 1rem;
}

/* Tipografía */
h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

p {
    color: var(--text-secondary);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-500) 0%, #C2410C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 24px 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 16px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.logo-image {
    height: 130px;
    display: block;
    object-fit: contain;
    object-position: left center;
    mix-blend-mode: multiply;
    transform: translateX(-20px);
    /* Ajuste preventivo para compensar el "padding" blanco quemado de la imagen */
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-500);
}

/* Botones */
.btn-primary {
    display: inline-block;
    background: var(--primary-500);
    color: #FFFFFF;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: 12px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.3);
    transition: all 0.3s;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--primary-600);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

/* Hero Section */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding-top: 180px;
    background: var(--hero-gradient);
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-600);
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 24px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-500);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin: 24px 0 40px;
}

/* Animación de Nodos de Red (Canvas) */
#networkCanvas {
    width: 100%;
    height: 400px;
    /* Misma altura que la esfera anterior */
    display: block;
    border-radius: 24px;
    background: transparent;
    opacity: 0.8;
    /* Ligeramente transparente para integrarse mejor con el fondo */
    transition: opacity 0.5s ease;
}

#networkCanvas:hover {
    opacity: 1;
    /* Se hace más visible al pasar el mouse por la pantalla del dispositivo */
}

/* Glassmorphism */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: all 0.4s;
}

/* Clients Marquee */
.clients {
    text-align: center;
    background-color: var(--bg-tertiary);
    overflow: hidden;
}

.clients-title {
    font-size: 1.125rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 40px;
}

.clients-slider {
    position: relative;
    width: 100vw;
    max-width: 100%;
    overflow: hidden;
    padding: 20px 0;
}

/* Mask for fade effect on edges */
.clients-slider::before,
.clients-slider::after {
    content: "";
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 2;
}

.clients-slider::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-tertiary) 0%, transparent 100%);
}

.clients-slider::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-tertiary) 0%, transparent 100%);
}

.clients-track {
    display: flex;
    align-items: center;
    gap: 80px;
    width: max-content;
    animation: scroll-marquee 40s linear infinite;
}

.clients-track:hover {
    animation-play-state: paused;
}

.client-img {
    height: 48px;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.5);
    transition: all 0.3s ease;
}

.client-img.mabe-img {
    height: 72px;
    /* Mabe logo ajustado por ser png recortado */
}

.client-img:hover {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.05);
}

.client-img.acimsa-img {
    height: 72px;
    /* Logo de ACIMSA también ajustado por ser png */
}

@keyframes scroll-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 40px));
        /* -50% del track más la mitad del gap */
    }
}

/* Services */
.bg-secondary {
    background-color: var(--bg-secondary);
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 64px auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

/* Flip Cards */
.service-card-flip {
    perspective: 1000px;
    height: 320px;
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.service-card-flip:hover .service-card-inner {
    transform: rotateY(180deg);
}

.service-card-front,
.service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.service-card-front {
    background-color: var(--bg-primary);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 24px;
}

.service-card-back {
    transform: rotateY(180deg);
    background: var(--primary-500);
    color: white;
    padding: 32px;
}

/* Contact Forms */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: var(--bg-secondary);
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
    background: var(--bg-primary);
}

.full-width {
    width: 100%;
}

/* Animaciones */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(var(--primary-rgb), 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero-container,
    .contact-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    #networkCanvas {
        height: 280px;
        margin: 0 auto;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }
}