:root {
    --bg-dark: #000000; /* Negro puro para máximo contraste SaaS */
    --bg-card: rgba(255, 255, 255, 0.03); /* Tarjetas de cristal sutiles */
    --primary: #ffffff; /* Contraste moderno */
    --primary-hover: #e5e5e5;
    --secondary: rgba(255, 255, 255, 0.08);
    --text-main: #ededed;
    --text-muted: #a1a1aa;
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Fondo Animado Premium (Mesh Gradient) */
body::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(ellipse at top, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.05) 40%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Control global de imágenes para que NUNCA se vean gigantes */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4 {
    font-family: var(--font-main);
    color: #ffffff;
    letter-spacing: -0.03em;
}

a { text-decoration: none; color: inherit; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header - Glassmorphism Premium */
.main-header {
    position: fixed;
    width: 95%;
    max-width: 1200px;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(10, 10, 10, 0.65);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 12px 25px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s ease;
}
.logo:hover { transform: scale(1.03); }

.logo img { 
    height: 38px; 
    width: auto; 
    object-fit: contain; 
    border-radius: 50%;
}
.logo span {
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(to right, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 15px; 
    align-items: center;
}

.nav-separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 10px;
    align-self: center;
    display: block;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn-special {
    background: #ffffff;
    color: #000000 !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    font-weight: 700;
}
.nav-btn-special:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(255, 255, 255, 0.25); background: #e5e5e5; }

.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
}

/* Content Wrapper */
.content-wrapper {
    padding-top: 150px;
    min-height: calc(100vh - 100px);
}

/* Typography & Globals */
h2 {
    font-size: 3.2rem;
    font-weight: 800;
    text-align: center;
    color: #ffffff;
    letter-spacing: -0.03em;
    background: linear-gradient(to right, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.section-description {
    text-align: center;
    color: var(--text-muted);
    margin: 0 auto 50px auto;
    font-size: 1.15rem;
    max-width: 600px;
}

/* Buttons */
.btn {
    display: inline-block;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.25);
    background: #f4f4f5;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-link {
    color: var(--primary);
    font-weight: bold;
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-link::after { content: '→'; transition: transform 0.3s; }
.btn-link:hover { color: #fff; }
.btn-link:hover::after { transform: translateX(5px); }

/* HERO SECTION NUEVO */
.hero-section {
    animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    padding: 60px 0 100px;
    text-align: center;
}

.hero-bg-glow {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
}

.hero-section .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    gap: 60px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

.page-header {
    position: relative;
    padding: 60px 20px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.page-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.04em;
    font-weight: 900;
}

.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}
.badge-dot {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 12px #3b82f6;
}
.hero-title {
    font-size: 5.5rem;
    line-height: 1.05;
    margin-bottom: 25px;
    letter-spacing: -0.04em;
    font-weight: 900;
}
.text-gradient {
    background: linear-gradient(to right, #ffffff, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}
.hero-actions { display: flex; gap: 20px; justify-content: center; }
.btn-glow { box-shadow: 0 0 25px rgba(255, 255, 255, 0.2); }
.btn-glow:hover { box-shadow: 0 0 45px rgba(255, 255, 255, 0.4); }

/* Grids & Cards */
.service-grid, .education-grid, .demo-grid, .project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding-bottom: 50px;
}
@media (min-width: 1024px) {
    .demo-grid { grid-template-columns: repeat(3, 1fr); }
}

.service-item, .education-item, .project-item {
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.15); /* Resalte premium estilo Vercel */
    border-radius: 24px;
    padding: 40px 30px;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.service-item:hover, .education-item:hover, .project-item:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
/* Alinear botones de servicios y formación al fondo siempre */
.service-item .btn, .education-item .btn, .education-item .btn-link, .project-item .btn-link {
    margin-top: auto;
    align-self: flex-start;
}

/* Ajuste de Imágenes de Proyectos */
.project-item { height: 100%; }
.project-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: transform 0.5s ease;
}
.project-item:hover img { transform: scale(1.03); }

/* Tarjetas de Demo - Diseño Profesional */
.demo-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Fuerza a que todas midan lo mismo */
}

.demo-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.demo-image {
    position: relative;
    width: 100%;
    height: 240px; 
    overflow: hidden;
    border-bottom: 1px solid var(--glass-border);
}

.demo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.demo-card:hover .demo-image img {
    transform: scale(1.1);
}

.demo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
}

.demo-card:hover .demo-overlay {
    opacity: 1;
}

/* Botón de Demo Profesional */
.btn-demo {
    background: #ffffff;
    color: #000000;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-demo:hover {
    background: #e5e5e5;
    transform: scale(1.05);
}

.demo-info {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 30px 25px;
}

.demo-info h3 { margin-bottom: 10px; font-size: 1.4rem; font-weight: 700; }
.demo-info p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

/* Etiquetas Tecnológicas (Tech Tags) */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto; /* Empuja los tags al fondo de la tarjeta */
}

.tech-tag {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Animaciones de Scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Icon Wrapper Styling */
.icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: rgba(37, 99, 235, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
}

/* About Us Section Ajustes */
.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
    justify-content: space-between;
}
.about-content img {
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.15);
}

/* Contact Form */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    background: rgba(15, 23, 42, 0.4);
    padding: 40px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    transition: border 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.social-links { margin-top: 20px; display: flex; gap: 15px; }
.social-links a {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 1px solid var(--glass-border);
    transition: 0.3s;
}
.social-links a:hover { background: var(--primary); color: #000; }

/* =========================================
   CARRITO DE COMPRAS (SIDEBAR)
   ========================================= */
.cart-badge {
    background: #ef4444; /* Rojo vibrante para notificaciones */
    color: #ffffff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    margin-left: 5px;
    font-weight: 900;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: rgba(10, 15, 28, 0.95);
    backdrop-filter: blur(15px);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}

.cart-sidebar.active { right: 0; }

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.close-cart { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; transition: 0.3s; }
.close-cart:hover { color: #ff4757; }

.cart-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-info h4 { font-size: 0.9rem; margin-bottom: 5px; }
.cart-item-price { color: var(--primary); font-weight: bold; }
.remove-item { color: #ff4757; background: none; border: none; cursor: pointer; }

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-dark);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

/* =========================================
   MODAL DE AUTENTICACIÓN (LOGIN/REGISTER)
   ========================================= */
.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 999999; /* Máxima prioridad para Pasarela y Modales */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.auth-modal.active {
    opacity: 1;
    pointer-events: all;
}

.auth-content {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    transform: translateY(-30px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.3);
    position: relative;
}

.auth-modal.active .auth-content { transform: translateY(0); }

.auth-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

/* Estilos para los campos del modal (Premium Input) */
.modal-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    margin-top: 5px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}
.modal-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

/* =========================================
   FOOTER PREMIUM
   ========================================= */
.main-footer {
    border-top: 1px solid var(--glass-border);
    padding: 40px 0;
    margin-top: 60px;
    background: var(--bg-dark);
    position: relative;
    z-index: 10;
}
.main-footer .container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    text-align: center;
}
.main-footer p { color: var(--text-muted); font-size: 0.9rem; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center;}
.footer-links a { color: var(--text-muted); font-size: 0.85rem; transition: color 0.3s; }
.footer-links a:hover { color: #fff; }

/* =========================================
   PERFIL DE USUARIO AVANZADO
   ========================================= */
.profile-avatar-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 15px auto;
}
.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    background: rgba(255, 255, 255, 0.1);
}
.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: -5px;
    background: #ffffff;
    color: #000000;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    border: 2px solid var(--bg-dark);
    transition: transform 0.3s;
}
.avatar-edit-btn:hover { transform: scale(1.1); }
.user-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 25px; }
.user-action-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); color: var(--text-main); padding: 12px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: 0.3s; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.user-action-btn i { font-size: 1.2rem; color: var(--text-muted); transition: 0.3s; }
.user-action-btn:hover { background: rgba(255,255,255,0.1); border-color: #fff; color: #fff; }
.user-action-btn:hover i { color: #fff; }

/* Configuracion de perfil */
.profile-settings-form { background: rgba(255,255,255,0.03); padding: 20px; border-radius: 15px; text-align: left; margin-bottom: 20px; border: 1px solid var(--glass-border); }
.profile-settings-form label { color: #94a3b8; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 5px; }
.profile-settings-form input { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: #fff; border-radius: 8px; padding: 10px; width: 100%; margin-bottom: 15px; font-size: 0.85rem; outline: none; transition: 0.3s; }
.profile-settings-form input:focus { border-color: var(--primary); }

/* =========================================
   ESTILOS DE IMPRESIÓN (VOUCHER)
   ========================================= */
@media print {
    body * { visibility: hidden !important; }
    #comprobante-impresion, #comprobante-impresion * { visibility: visible !important; }
    #comprobante-impresion { position: absolute; left: 0; top: 0; width: 100%; max-width: 100%; margin: 0; padding: 20px; background: white; color: black; box-shadow: none; border: none; }
    .no-print { display: none !important; }
    .main-header, .main-footer, .cart-sidebar, .auth-modal { display: none !important; }
    body { background: white; }
    #comprobante-impresion h2 { color: #000 !important; background: none !important; -webkit-text-fill-color: #000 !important; }
    #comprobante-impresion .text-gradient { -webkit-text-fill-color: #000 !important; }
}

/* =========================================
   DISEÑO RESPONSIVO (MÓVILES)
   ========================================= */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}
.nav-toggle span {
    width: 28px; height: 3px; background: #fff; transition: 0.3s; border-radius: 3px;
}

@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .main-header { width: 100%; border-radius: 0; top: 0; }
    .nav-separator { display: none; }
    
    .main-nav ul {
        position: absolute; top: 100%; left: 0; width: 100%;
        background: rgba(0, 0, 0, 0.98); backdrop-filter: blur(20px);
        flex-direction: column; padding: 20px; gap: 15px;
        transform: translateY(-150%); opacity: 0; pointer-events: none;
        transition: all 0.4s ease; border-bottom: 1px solid var(--glass-border);
        z-index: 999;
    }
    .main-nav.active ul { transform: translateY(0); opacity: 1; pointer-events: all; }
    
    /* Animación del menú hamburguesa a 'X' */
    .nav-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .nav-toggle.active span:nth-child(2) { opacity: 0; }
    .nav-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    .hero-section .container { flex-direction: column; text-align: center; padding-top: 40px; }
    .hero-title { font-size: 3rem; }
    .page-title { font-size: 2.8rem; }
    .hero-actions { justify-content: center; flex-wrap: wrap; }
    .contact-grid, .about-content { grid-template-columns: 1fr; flex-direction: column; }
    .about-content img { width: 100%; max-width: 400px; margin-bottom: 20px; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--glass-border); }
    .cart-sidebar { width: 100%; right: -100%; border-left: none; }
}