/* ==========================================
   PALETA DE COLORES Y FONDOS
   ========================================== */
:root {
    --bg-color: #f8fafc;
    --bg-pattern: radial-gradient(circle at 50% 10%, rgba(6, 182, 212, 0.10), transparent 60%),
                 url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l25.98 15v30L30 60 4.02 45v-30z' fill='none' stroke='%231558d6' stroke-opacity='0.06' stroke-width='1'/%3E%3C/svg%3E");
    --text-color: #0f172a;
    --text-muted: #475569;
    --nav-bg: rgba(255, 255, 255, 0.88);
    --card-bg: rgba(255, 255, 255, 0.82);
    --border-color: rgba(203, 213, 225, 0.7);
    --primary-blue: #1558d6;
    --primary-cyan: #06b6d4;
    --hover-bg: rgba(241, 245, 249, 0.9);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --logo-filter: drop-shadow(0 8px 16px rgba(21, 88, 214, 0.15));
}

body.dark-theme {
    --bg-color: #080d1a;
    --bg-pattern: radial-gradient(circle at 50% 10%, rgba(6, 182, 212, 0.15), transparent 65%),
                 url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l25.98 15v30L30 60 4.02 45v-30z' fill='none' stroke='%2306b6d4' stroke-opacity='0.12' stroke-width='1'/%3E%3C/svg%3E");
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --nav-bg: rgba(15, 23, 42, 0.88);
    --card-bg: rgba(30, 41, 59, 0.75);
    --border-color: rgba(51, 65, 85, 0.8);
    --hover-bg: rgba(51, 65, 85, 0.9);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --logo-filter: drop-shadow(0 8px 24px rgba(6, 182, 212, 0.3));
}

/* ==========================================
   ESTILOS GENERALES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-pattern);
    background-repeat: repeat;
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==========================================
   NAVEGACIÓN SUPERIOR
   ========================================== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
}

.logo-container img { height: 42px; width: auto; display: block; }

.nav-buttons-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-links a:hover { color: var(--primary-cyan); }

.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg);
    backdrop-filter: blur(12px);
    min-width: 210px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0;
    list-style: none;
    margin-top: 0.5rem;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a {
    padding: 0.7rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
}
.dropdown-menu li a:hover {
    background-color: var(--hover-bg);
    color: var(--primary-blue);
}
.icon-arrow { font-size: 0.75rem; margin-left: 0.2rem; }

.theme-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.theme-btn:hover {
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
}

/* Botón Hamburguesa oculto por defecto en PC */
.menu-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
}
.menu-btn:hover {
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
}

/* ==========================================
   HERO / BANNER
   ========================================== */
.hero {
    padding: 5rem 2rem 4rem;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-logo-wrapper { margin-bottom: 2rem; }
.hero-center-logo {
    width: 190px;
    height: auto;
    display: block;
    filter: var(--logo-filter);
    transition: transform 0.4s ease, filter 0.4s ease;
}
.hero-center-logo:hover { transform: scale(1.03); }

.hero-badge {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.8rem;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-cyan);
    margin-bottom: 1.8rem;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.18;
    letter-spacing: -0.5px;
    margin-bottom: 1.2rem;
}
.gradient-text {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 720px;
    margin-bottom: 2.5rem;
    font-weight: 500;
}
.hero-buttons { display: flex; gap: 1.2rem; }
.btn {
    padding: 0.85rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
    color: white;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.35);
}
.btn-secondary {
    background-color: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}
.btn:hover { transform: translateY(-2px); }

/* ==========================================
   SERVICIOS
   ========================================== */
.servicios {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}
.section-title h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.section-title p {
    color: var(--text-muted);
    font-size: 1rem;
}
.grid-servicios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.8rem;
}
.servicio-card {
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.servicio-icon {
    font-size: 2.2rem;
    color: var(--primary-cyan);
    margin-bottom: 1rem;
}
.servicio-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.6rem;
}
.servicio-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* ==========================================
   STACK TECNOLÓGICO AGRUPADO
   ========================================== */
.tecnologias {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 4rem 2rem;
    backdrop-filter: blur(10px);
}
.tech-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 3rem;
}
.tech-text {
    flex: 1;
    min-width: 300px;
}
.tech-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}
.tech-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
}
.tech-grid-grouped {
    flex: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}
.tech-group h3 {
    font-size: 1.1rem;
    color: var(--primary-cyan);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.tech-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    color: var(--text-color);
}
.tech-item i {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}
.tech-item span {
    font-size: 0.8rem;
    font-weight: 600;
}
.tech-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-cyan);
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.15);
}

/* ==========================================
   PRODUCTOS
   ========================================== */
.productos {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
}
.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}
.card {
    background-color: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease;
}
.card:hover { border-color: var(--primary-cyan); }

.card-with-image {
    padding: 0;
    overflow: hidden;
}
.card-img-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}
.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.5s ease;
}
.card-with-image:hover .card-img {
    transform: scale(1.05);
}
.card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.card-content h3 { font-size: 1.4rem; margin-bottom: 0.8rem; }
.card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.8rem;
    flex-grow: 1;
}
.card-link {
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-link:hover { color: var(--primary-cyan); }

/* ==========================================
   METODOLOGÍA / PROCESO
   ========================================== */
.proceso {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 1rem;
}
.grid-proceso {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}
.proceso-step {
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    transition: transform 0.3s ease;
}
.proceso-step:hover {
    transform: translateY(-5px);
    border-color: var(--primary-cyan);
}
.step-number {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0 auto 1.2rem auto;
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3);
}
.proceso-step h3 {
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
}
.proceso-step p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* ==========================================
   CTA BANNER
   ========================================== */
.cta-banner {
    max-width: 1000px;
    margin: 4rem auto 5rem;
    padding: 3.5rem 2rem;
    background: linear-gradient(135deg, rgba(21, 88, 214, 0.05), rgba(6, 182, 212, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}
.cta-banner h2 { font-size: 2.2rem; margin-bottom: 1rem; }
.cta-banner p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    padding: 4rem 2rem 1.5rem;
}
.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}
.footer-col h3 {
    font-size: 1.5rem;
    color: var(--primary-cyan);
    margin-bottom: 1rem;
}
.footer-col h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 0.5rem;
}
.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-cyan);
}
.footer-col p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.8rem; }
.footer-col ul a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.3s ease;
}
.footer-col ul a:hover { color: var(--primary-cyan); }
.contact-info li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.contact-info i {
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}
.social-icons a {
    color: var(--text-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}
.social-icons a:hover {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================
   BOTÓN VOLVER ARRIBA
   ========================================== */
.btn-scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}
.btn-scroll-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.btn-scroll-top:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(21, 88, 214, 0.6);
}

/* ==========================================
   AJUSTES DE CONTRASTE PARA MODO OSCURO
   ========================================== */
body.dark-theme .card-link {
    color: #66b2ff; 
    transition: color 0.3s ease, transform 0.3s ease; 
}
body.dark-theme .card-link:hover {
    color: #99ccff; 
}
body.dark-theme .contact-info i {
    color: var(--primary-cyan);
    transition: color 0.3s ease;
}

/* ==========================================
   DISEÑO RESPONSIVO (MÓVILES Y TABLETS)
   ========================================== */
@media (max-width: 768px) {
    .menu-btn {
        display: flex; /* Muestra el botón de hamburguesa en pantallas pequeñas */
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--nav-bg);
        backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        box-shadow: var(--shadow);
        display: none; /* Oculto por defecto */
        border-top: 1px solid var(--border-color);
        z-index: 1000;
    }

    .nav-links.active {
        display: flex; /* Se muestra al alternar en JS */
    }

    .nav-links li {
        width: 100%;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links li a {
        display: block;
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background-color: transparent;
        margin-top: 0.5rem;
        padding-left: 1rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }
}