/* ==========================================================================
   Tecnigrid — Hoja de estilos compartida para todo el sitio
   ========================================================================== */

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

:root {
    --primary-color: #00d4ff;
    --secondary-color: #ffa500;
    --dark-bg: #0a0a0a;
    --card-bg: rgba(10, 20, 40, 0.9);
    --text-light: #e0e0e0;
    --accent-glow: 0 0 20px rgba(0, 212, 255, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: var(--text-light);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Fondo de partículas animadas
   ========================================================================== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: var(--primary-color);
    width: 2px;
    height: 2px;
    border-radius: 50%;
    animation: float 20s infinite linear;
    opacity: 0.3;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Barra de navegación
   ========================================================================== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.8rem 5%;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 212, 255, 0.2);
}

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

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.nav-link:hover:before,
.nav-link.active:before {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Botón hamburguesa (móvil) */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 1.4rem;
    line-height: 1;
}

/* Contenedor principal
   ========================================================================== */
.main-container {
    position: relative;
    z-index: 2;
    padding-top: 72px;
    flex: 1;
}

/* Héroe (página de inicio)
   ========================================================================== */
.hero {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(2px);
}

.hero-content {
    text-align: center;
    padding: 2rem;
    max-width: 1200px;
    animation: fadeInUp 1s ease;
}

.hero-content .hero-logo {
    max-width: min(480px, 85vw);
    height: auto;
    margin-bottom: 1.5rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.hero p {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.grid-animation {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(0deg, rgba(0, 212, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

/* Héroe compacto (páginas internas)
   ========================================================================== */
.page-hero {
    text-align: center;
    padding: 4.5rem 5% 1rem;
    position: relative;
}

.page-hero h1 {
    font-size: 3rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
    padding-bottom: 0.8rem;
}

.page-hero h1:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    box-shadow: var(--accent-glow);
}

.page-hero p {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 1.2rem auto 0;
    opacity: 0.9;
}

/* Secciones
   ========================================================================== */
section {
    padding: 4rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    width: 100%;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    box-shadow: var(--accent-glow);
}

.section-intro {
    text-align: center;
    font-size: 1.2rem;
    max-width: 850px;
    margin: -1.5rem auto 3rem;
    opacity: 0.9;
    line-height: 1.7;
}

/* Tarjetas
   ========================================================================== */
.card {
    background: var(--card-bg);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.3);
}

.card:hover:before {
    opacity: 0.3;
}

.card h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.card p {
    line-height: 1.8;
    color: var(--text-light);
}

/* Grilla de accesos destacados (inicio)
   ========================================================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    display: block;
    text-decoration: none;
    background: var(--card-bg);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.3);
    border-color: var(--primary-color);
}

.feature-card .feature-icon {
    font-size: 2.6rem;
    display: block;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.98rem;
}

.feature-card .feature-more {
    display: inline-block;
    margin-top: 1.2rem;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Insignias de países
   ========================================================================== */
.country-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.5rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 25px;
    transition: all 0.3s ease;
}

.country-badge:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* Grilla de servicios
   ========================================================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-item {
    padding: 1.5rem;
    background: rgba(0, 212, 255, 0.05);
    border-left: 3px solid var(--primary-color);
    transition: all 0.3s ease;
}

.service-item:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateX(10px);
}

.service-item strong {
    display: block;
    font-size: 1.15rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.service-item p {
    line-height: 1.7;
}

/* Tarjetas de servicio ampliadas (página Servicios) */
.service-card {
    background: var(--card-bg);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.3);
    border-color: var(--primary-color);
}

.service-card .service-icon {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 1rem;
}

.service-card h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

.service-card p {
    line-height: 1.7;
}

/* Franja de estándares (OGC / CIM)
   ========================================================================== */
.standards-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 15px;
    padding: 1.5rem 2rem;
    margin-top: 2rem;
}

.standards-strip img {
    height: 70px;
    width: auto;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
}

.standards-strip p {
    max-width: 640px;
    line-height: 1.7;
}

/* Sección de video
   ========================================================================== */
.video-section {
    text-align: center;
}

.video-wrapper {
    max-width: 960px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.25);
    background: #000;
    line-height: 0;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}

.video-caption {
    margin-top: 1.2rem;
    font-size: 1.05rem;
    opacity: 0.8;
}

/* Grilla de clientes
   ========================================================================== */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 2rem;
}

.client-card {
    background: var(--card-bg);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.client-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.3);
    border-color: var(--primary-color);
}

.client-logo {
    background: #ffffff;
    border-radius: 10px;
    width: 100%;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
}

.client-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.client-card figcaption {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* Bloque de contacto
   ========================================================================== */
.contact {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(255, 165, 0, 0.1) 100%);
    border-radius: 20px;
    margin: 2rem auto;
}

.contact-email {
    font-size: 1.6rem;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
    padding: 1rem 2rem;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    transition: all 0.3s ease;
    word-break: break-all;
}

.contact-email:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    transform: scale(1.05);
}

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

/* Botones
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 0.9rem 2.2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    transform: scale(1.05);
}

.btn-secondary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-color);
    box-shadow: 0 0 30px rgba(255, 165, 0, 0.5);
}

.cta-row {
    text-align: center;
    margin-top: 2.5rem;
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Pie de página
   ========================================================================== */
footer {
    position: relative;
    z-index: 2;
    background: rgba(5, 5, 15, 0.95);
    border-top: 1px solid rgba(0, 212, 255, 0.3);
    padding: 3rem 5% 1.5rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2.5rem;
}

.footer-brand img {
    height: 36px;
    width: auto;
    margin-bottom: 1rem;
}

.footer-brand p {
    line-height: 1.7;
    opacity: 0.8;
    font-size: 0.95rem;
}

footer h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    opacity: 0.85;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    opacity: 1;
    padding-left: 5px;
}

.footer-contact a {
    color: var(--secondary-color);
    text-decoration: none;
}

.footer-contact a:hover {
    text-shadow: 0 0 10px rgba(255, 165, 0, 0.6);
}

.footer-contact p {
    line-height: 1.9;
    opacity: 0.85;
    font-size: 0.95rem;
}

.footer-bottom {
    max-width: 1400px;
    margin: 2.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(224, 224, 224, 0.15);
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Adaptación móvil
   ========================================================================== */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background: rgba(10, 10, 10, 0.98);
        padding: 1rem 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
        border-top: 1px solid rgba(0, 212, 255, 0.2);
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-link {
        display: block;
        padding: 0.9rem 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .page-hero h1 {
        font-size: 2.2rem;
    }

    .page-hero p {
        font-size: 1.1rem;
    }

    .contact-email {
        font-size: 1.2rem;
    }
}

/* Efecto glitch del logo */
@keyframes glitch {
    0%, 100% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
            -0.05em -0.025em 0 rgba(0, 255, 0, 0.75),
            0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    14% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
            -0.05em -0.025em 0 rgba(0, 255, 0, 0.75),
            0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    15% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
            0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
            -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    49% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
            0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
            -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    50% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
            0.05em 0 0 rgba(0, 255, 0, 0.75),
            0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    99% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
            0.05em 0 0 rgba(0, 255, 0, 0.75),
            0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
}
