/* Base Variables & Theme */
:root {
    /* Dark Theme Default */
    --bg-base: #050505;
    --bg-surface: rgba(255, 255, 255, 0.03);
    --bg-surface-hover: rgba(255, 255, 255, 0.05);
    --text-primary: #f8f9fa;
    --text-secondary: #a1a1aa;
    --logo-filter: invert(1) opacity(0.5);
    --navbar-bg: rgba(5, 5, 5, 0.85);
    
    --brand-primary: #1d4ed8;
    --brand-secondary: #4f46e5;
    --brand-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    
    --wa-color: #25D366;
    --wa-color-dark: #128C7E;
    --wa-gradient: linear-gradient(135deg, #4FCE5D, #128C7E);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --blur-glass: blur(12px);
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --container-max: 1200px;
}

/* Light Theme Variables */
body.light-theme {
    --bg-base: #fafafa;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --logo-filter: grayscale(1) opacity(0.6);
    --navbar-bg: rgba(250, 250, 250, 0.85);
    
    --border-color: rgba(0, 0, 0, 0.08);
    --brand-gradient: linear-gradient(135deg, #2563eb, #6366f1);
}

/* Reset & Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Typography */
h1, h2, h3 {
    line-height: 1.2;
    font-weight: 700;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(2rem, 3vw, 3rem);
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.text-gradient {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.text-center {
    text-align: center;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 1rem 0;
    background: var(--navbar-bg);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Boton Theme Toggle */
.theme-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.theme-btn svg {
    width: 20px;
    height: 20px;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--brand-gradient);
    color: white; /* Always white inside primary CTA */
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
}

.nav-links .btn-primary-outline {
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-primary);
}

.nav-links .btn-primary-outline:hover {
    background: var(--bg-surface-hover);
    border-color: rgba(120, 120, 120, 0.3);
}

.btn-whatsapp-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    background: var(--wa-gradient);
    color: white; /* always white on whatsapp CTA */
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.25);
}

.btn-whatsapp-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.4);
}

/* Hero Section */
.hero {
    position: relative;
    padding: 12rem 0 6rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.05) 40%, transparent 70%);
    z-index: -1;
    border-radius: 50%;
    filter: blur(80px);
    transition: opacity 0.5s;
}

body.light-theme .hero-bg-glow {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 40%, transparent 70%);
}

.hero-content p {
    max-width: 700px;
    margin: 0 auto 2.5rem;
    font-size: 1.25rem;
}

.hero-trust {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.hero-trust span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Clients Marquee Section */
.clients {
    padding: 2rem 0 5rem;
}

.clients-title {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

.logo-ticker {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Gradientes para suavizar el marquee */
.logo-ticker::before, .logo-ticker::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
}

.logo-ticker::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-base) 0%, transparent 100%);
}

.logo-ticker::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-base) 0%, transparent 100%);
}

.logo-track {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: scroll_ticker 30s linear infinite;
}

.logo-track:hover {
    animation-play-state: paused;
}

.logo-box {
    filter: var(--logo-filter);
    transition: filter 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-box:hover {
    filter: grayscale(0) opacity(1);
    color: var(--brand-primary);
}

@keyframes scroll_ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 1.5rem)); }
}

/* Services and Swiper */
.services {
    padding: 6rem 0;
    position: relative;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.swiper {
    width: 100%;
    padding-bottom: 4rem !important; /* Space for pagination */
}

.service-card {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    padding: 3rem 2rem;
    border-radius: 20px;
    transition: var(--transition);
    position: relative;
    height: 100%; /* Important for swiper slides equality */
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--brand-primary);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.icon-container {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--brand-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.icon-container svg {
    width: 28px;
    height: 28px;
}

body.light-theme .service-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

body.light-theme .service-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.swiper-pagination-bullet {
    background: var(--brand-primary);
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    opacity: 1;
}

/* CTA Section */
.cta-section {
    padding: 6rem 0 8rem;
}

.cta-box {
    background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-box::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--wa-gradient);
    opacity: 0.8;
}

.cta-box h2 {
    margin-bottom: 1rem;
}

.cta-box p {
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    margin-top: 1rem;
    max-width: 350px;
    font-size: 1rem;
}

.footer-links ul {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Floating WhatsApp Button */
.floating-wa {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: var(--transition);
}

.floating-wa:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.6);
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links li:not(:nth-child(4)) { /* keep theme toggle alive but hide others minimally on very small screen */
        display: none; 
    }
    
    .nav-links {
        gap: 1rem;
    }

    .hero {
        padding: 10rem 0 4rem;
    }

    .hero-trust {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-whatsapp-large {
        width: 100%;
        padding: 1rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-brand p {
        margin: 1rem auto;
    }

    .footer-links ul {
        flex-direction: column;
        gap: 1rem;
    }
}
