/* ==========================================================================
           1. VARIABLES Y BASE (REDUCCIÓN DE REFLOWS/REPAINTS)
           ========================================================================== */
        :root {
            --primary: #2E3192;
            --primary-dark: #1a1c5c;
            --slate-50: #f8fafc;
            --slate-100: #f1f5f9;
            --slate-200: #e2e8f0;
            --slate-300: #cbd5e1;
            --slate-400: #94a3b8;
            --slate-600: #64748b;
            --slate-700: #334155;
            --slate-800: #1e293b;
            --slate-900: #0f172a;
        }

        *, *::before, *::after { box-sizing: border-box; }
        html { scroll-behavior: smooth; }
        body { font-family: 'Inter', sans-serif; background-color: var(--slate-50); color: var(--slate-800); margin: 0; padding: 0; overflow-x: hidden; }
        h1, h2, h3, h4, h5, h6 { font-family: 'Montserrat', sans-serif; }
        .material-symbols-outlined { vertical-align: middle; }
        a { text-decoration: none; color: inherit; transition: color 0.2s ease, transform 0.2s ease; }

        /* Accesibilidad: Focus Visibles para Teclado */
        a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
            outline: 3px solid var(--primary);
            outline-offset: 2px;
        }

        /* Accesibilidad: enlace "Saltar al contenido" visible solo al navegar con teclado */
        .skip-link {
            position: absolute;
            top: -3rem;
            left: 0.5rem;
            z-index: 100;
            background: var(--primary);
            color: #ffffff;
            padding: 0.75rem 1.25rem;
            border-radius: 0 0 0.5rem 0.5rem;
            font-weight: 700;
            font-size: 0.875rem;
            transition: top 0.2s ease;
        }
        .skip-link:focus {
            top: 0;
        }

        /* ==========================================================================
           2. UTILIDADES Y LAYOUT (DESKTOP / MOBILE FIRST)
           ========================================================================== */
        .container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
        .hero-bg { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); }
        .brand-primary { color: var(--primary); }

        .flex { display: flex; }
        .flex-col { flex-direction: column; }
        .items-center { align-items: center; }
        .justify-between { justify-content: space-between; }
        .justify-center { justify-content: center; }
        .flex-wrap { flex-wrap: wrap; }
        .gap-1 { gap: 0.25rem; }
        .gap-2 { gap: 0.5rem; }
        .gap-3 { gap: 0.75rem; }
        .gap-4 { gap: 1rem; }
        .gap-6 { gap: 1.5rem; }
        .gap-8 { gap: 2rem; }
        .gap-12 { gap: 3rem; }

        .grid { display: grid; }
        .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

        /* IMPORTANTE: .block/.hidden deben declararse ANTES que los breakpoints
           (sm:/md:/lg:) para que estos últimos puedan sobrescribirlos en cascada.
           Antes estaban declarados después (más abajo en el archivo) y por eso
           el menú, el horario y otros elementos "hidden md:flex" / "hidden lg:flex"
           quedaban ocultos siempre, sin importar el ancho de pantalla. */
        .block { display: block; }
        .hidden { display: none; }

        @media(min-width: 640px) {
            .sm\:flex-row { flex-direction: row; }
            .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
            .sm\:block { display: block; }
            .sm\:text-left { text-align: left; }
        }
        @media(min-width: 768px) {
            .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
            .md\:flex { display: flex; }
            .md\:hidden { display: none; }
        }
        @media(min-width: 1024px) {
            .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
            .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
            .lg\:col-span-5 { grid-column: span 5 / span 5; }
            .lg\:col-span-7 { grid-column: span 7 / span 7; }
            .lg\:flex { display: flex; }
            .lg\:hidden { display: none !important; }
            .lg\:py-28 { padding-top: 7rem; padding-bottom: 7rem; }
        }

        /* ==========================================================================
           3. BOTONES CON ANIMACIONES GPU (TRANSFORM & OPACITY)
           ========================================================================== */
        .btn-primary, .btn-white, .btn-outline-white, .btn-outline-primary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            font-weight: 700;
            padding: 1rem 2rem;
            border-radius: 0.75rem;
            cursor: pointer;
            will-change: transform;
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, box-shadow 0.3s ease;
        }
        .btn-primary {
            background-color: var(--primary);
            color: #ffffff;
            border: none;
            box-shadow: 0 10px 15px -3px rgba(46, 49, 146, 0.3);
        }
        .btn-primary:hover {
            background-color: var(--primary-dark);
            transform: translate3d(0, -3px, 0) scale(1.02);
            box-shadow: 0 15px 25px -5px rgba(46, 49, 146, 0.4);
        }
        .btn-white {
            background-color: #ffffff;
            color: var(--primary);
            border: none;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }
        .btn-white:hover {
            background-color: var(--slate-100);
            transform: translate3d(0, -3px, 0) scale(1.02);
            box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.15);
        }
        .btn-outline-white {
            background-color: rgba(255, 255, 255, 0.1);
            color: #ffffff;
            border: 1px solid rgba(255, 255, 255, 0.4);
        }
        .btn-outline-white:hover {
            background-color: rgba(255, 255, 255, 0.2);
            transform: translate3d(0, -3px, 0);
        }
        .btn-outline-primary {
            background-color: transparent;
            color: var(--primary);
            border: 2px solid var(--primary);
        }
        .btn-outline-primary:hover {
            background-color: var(--primary);
            color: #ffffff;
            transform: translate3d(0, -3px, 0);
        }

        /* ==========================================================================
           4. HEADER INTELIGENTE Y MENÚ RESPONSIVE
           ========================================================================== */
        header.sticky {
            position: sticky;
            top: 0;
            z-index: 50;
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-bottom: 1px solid var(--slate-200);
            will-change: padding, background-color, box-shadow;
            transition: padding 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
        }
        header.sticky .header-inner {
            height: 5rem;
            transition: height 0.3s ease;
        }
        header.sticky .logo-img {
            height: 2.5rem;
            width: auto;
            transition: height 0.3s ease;
        }
        header.sticky.scrolled {
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
            background: rgba(255, 255, 255, 0.98);
        }
        header.sticky.scrolled .header-inner {
            height: 3.8rem;
        }
        header.sticky.scrolled .logo-img {
            height: 2rem;
        }

        /* Botón Hamburguesa Animado */
        .hamburger-btn {
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            width: 2rem;
            height: 2rem;
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 0;
            z-index: 60;
        }
        .hamburger-btn span {
            width: 2rem;
            height: 0.2rem;
            background: var(--primary);
            border-radius: 10px;
            transition: all 0.3s linear;
            position: relative;
            transform-origin: 1px;
        }
        .hamburger-btn.is-active span:nth-child(1) { transform: rotate(45deg); }
        .hamburger-btn.is-active span:nth-child(2) { opacity: 0; transform: translateX(20px); }
        .hamburger-btn.is-active span:nth-child(3) { transform: rotate(-45deg); }

        /* Menú Lateral Desplegable Mobile */
        .mobile-nav-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100vh;
            background: rgba(15, 23, 42, 0.6);
            backdrop-filter: blur(4px);
            z-index: 52;
            opacity: 0;
            visibility: hidden;
            will-change: opacity;
            transition: opacity 0.3s ease, visibility 0.3s ease;
        }
        .mobile-nav-overlay.is-active {
            opacity: 1;
            visibility: visible;
        }
        .mobile-nav {
            position: fixed;
            top: 0; right: 0;
            width: 280px; height: 100vh;
            background: #ffffff;
            z-index: 55;
            padding: 6rem 2rem 2rem 2rem;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            box-shadow: -10px 0 25px rgba(0,0,0,0.1);
            transform: translate3d(100%, 0, 0);
            will-change: transform;
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .mobile-nav.is-active {
            transform: translate3d(0, 0, 0);
        }
        .mobile-nav a {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--slate-700);
            border-bottom: 1px solid var(--slate-100);
            padding-bottom: 0.75rem;
        }
        .mobile-nav a:hover { color: var(--primary); }
        body.no-scroll { overflow: hidden; }

        /* ==========================================================================
           5. HERO, TARJETAS Y COMPONENTES
           ========================================================================== */
        .hero-title-gradient {
            background: linear-gradient(135deg, #ffffff 35%, #c7d2fe 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .service-card, .tech-card, .interactive-box {
            will-change: transform, box-shadow;
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .service-card:hover, .tech-card:hover {
            transform: translate3d(0, -8px, 0);
            box-shadow: 0 20px 30px -10px rgba(46, 49, 146, 0.12), 0 10px 15px -5px rgba(0, 0, 0, 0.05);
        }

        /* ==========================================================================
           6. BOTÓN FLOTANTE DE WHATSAPP MEJORADO CON TOOLTIP
           ========================================================================== */
        @keyframes pulse-whatsapp {
            0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
            70% { box-shadow: 0 0 0 18px rgba(34, 197, 94, 0); }
            100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
        }
        .whatsapp-float-container {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            z-index: 9999;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        .whatsapp-float {
            width: 60px;
            height: 60px;
            background-color: #25D366;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 10px 25px rgba(0,0,0,0.2);
            animation: pulse-whatsapp 2s infinite;
            will-change: transform;
            transition: transform 0.3s ease;
        }
        .whatsapp-float:hover {
            transform: scale(1.1) rotate(5deg);
        }
        .whatsapp-tooltip {
            background: #ffffff;
            color: var(--slate-800);
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            font-size: 0.85rem;
            font-weight: 600;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            pointer-events: none;
            opacity: 0;
            transform: translate3d(10px, 0, 0);
            transition: opacity 0.3s ease, transform 0.3s ease;
        }
        .whatsapp-float-container:hover .whatsapp-tooltip {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }

        /* ==========================================================================
           7. CARRUSEL DE GALERÍA ANTES Y DESPUÉS
           ========================================================================== */
        .gallery-carousel {
            position: relative;
            overflow: hidden;
            width: 100%;
        }
        .gallery-slides {
            display: flex;
            will-change: transform;
            transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .gallery-slide {
            min-width: 100%;
            box-sizing: border-box;
        }
        .carousel-nav-btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(255,255,255,0.9);
            color: var(--slate-900);
            border: none;
            width: 44px;
            height: 44px;
            border-radius: 50%;
            cursor: pointer;
            z-index: 20;
            box-shadow: 0 4px 10px rgba(0,0,0,0.15);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s ease, transform 0.2s ease;
        }
        .carousel-nav-btn:hover { background: #ffffff; transform: translateY(-50%) scale(1.1); }
        .carousel-prev { left: 1rem; }
        .carousel-next { right: 1rem; }
        .carousel-indicators {
            display: flex;
            justify-content: center;
            gap: 0.5rem;
            margin-top: 1.5rem;
        }
        .indicator-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: var(--slate-300);
            cursor: pointer;
            transition: background 0.3s ease, transform 0.3s ease;
            border: none;
            padding: 0;
            display: inline-block;
        }
        .indicator-dot.active {
            background: var(--primary);
            transform: scale(1.2);
        }

        .img-comparision-container {
            position: relative;
            width: 100%;
            max-width: 750px;
            height: 480px;
            margin: 0 auto;
            overflow: hidden;
            border-radius: 1.5rem;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            user-select: none;
            touch-action: pan-y;
        }
        .img-comp-img {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            overflow: hidden;
        }
        .img-comp-img picture, .img-comp-img img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
            pointer-events: none;
        }
        .img-comp-slider {
            position: absolute;
            z-index: 9;
            cursor: ew-resize;
            width: 48px; height: 48px;
            background-color: var(--primary);
            border: 4px solid #ffffff;
            border-radius: 50%;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            box-shadow: 0 0 20px rgba(0,0,0,0.4);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
        }
        .img-comp-bar {
            position: absolute;
            top: 0; bottom: 0; left: 50%;
            width: 4px;
            background: #ffffff;
            z-index: 8;
            box-shadow: 0 0 12px rgba(0,0,0,0.5);
            transform: translateX(-50%);
        }
        .img-comp-badge {
            position: absolute;
            top: 24px;
            padding: 8px 16px;
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border-radius: 9999px;
            z-index: 10;
            backdrop-filter: blur(6px);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
        .badge-before { left: 24px; background: rgba(15, 23, 42, 0.8); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.4); }
        .badge-after { right: 24px; background: rgba(46, 49, 146, 0.9); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.4); }

        /* ==========================================================================
           8. ANIMACIONES CSS UNIFICADAS (SCROLL REVEAL CON OBSERVER)
           ========================================================================== */
        .reveal {
            opacity: 0;
            will-change: opacity, transform;
            transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .reveal-up { transform: translate3d(0, 35px, 0); }
        .reveal-left { transform: translate3d(-35px, 0, 0); }
        .reveal-right { transform: translate3d(35px, 0, 0); }
        .reveal-scale { transform: scale(0.92); }

        .reveal.active {
            opacity: 1;
            transform: translate3d(0, 0, 0) scale(1);
        }

        /* ==========================================================================
           9. CLASES UTILITARIAS GENERALES
           ========================================================================== */
        .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
        .py-12 { padding-top: 3rem; padding-bottom: 3rem; }
        .py-20 { padding-top: 5rem; padding-bottom: 5rem; }
        .py-24 { padding-top: 6rem; padding-bottom: 6rem; }
        .px-4 { padding-left: 1rem; padding-right: 1rem; }
        .p-4 { padding: 1rem; }
        .p-6 { padding: 1.5rem; }
        .p-8 { padding: 2rem; }
        .mb-1 { margin-bottom: 0.25rem; }
        .mb-2 { margin-bottom: 0.5rem; }
        .mb-3 { margin-bottom: 0.75rem; }
        .mb-4 { margin-bottom: 1rem; }
        .mb-6 { margin-bottom: 1.5rem; }
        .mb-8 { margin-bottom: 2rem; }
        .mt-2 { margin-top: 0.5rem; }
        .mt-3 { margin-top: 0.75rem; }
        .mt-4 { margin-top: 1rem; }
        .mt-8 { margin-top: 2rem; }
        .mt-12 { margin-top: 3rem; }

        .text-xs { font-size: 0.75rem; line-height: 1rem; }
        .text-sm { font-size: 0.875rem; line-height: 1.25rem; }
        .text-base { font-size: 1rem; line-height: 1.5rem; }
        .text-lg { font-size: 1.125rem; line-height: 1.75rem; }
        .text-xl { font-size: 1.25rem; line-height: 1.75rem; }
        .text-2xl { font-size: 1.5rem; line-height: 2rem; }
        .text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
        .text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
        .text-5xl { font-size: 3rem; line-height: 1; }

        .font-bold { font-weight: 700; }
        .font-semibold { font-weight: 600; }
        .font-medium { font-weight: 500; }
        .font-extrabold { font-weight: 800; }

        .text-center { text-align: center; }
        .uppercase { text-transform: uppercase; }
        .tracking-wider { letter-spacing: 0.05em; }
        .tracking-widest { letter-spacing: 0.1em; }
        .tracking-tight { letter-spacing: -0.025em; }

        .rounded-xl { border-radius: 0.75rem; }
        .rounded-2xl { border-radius: 1rem; }
        .rounded-3xl { border-radius: 1.5rem; }
        .rounded-full { border-radius: 9999px; }

        .shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
        .shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
        .shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
        .shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

        .bg-black { background-color: #000000; }
        .bg-white { background-color: #ffffff; }
        .bg-slate-50 { background-color: var(--slate-50); }
        .bg-slate-100 { background-color: var(--slate-100); }
        .bg-slate-800 { background-color: var(--slate-800); }
        .bg-slate-900 { background-color: var(--slate-900); }

        .text-white { color: #ffffff; }
        .text-slate-200 { color: var(--slate-200); }
        .text-slate-300 { color: var(--slate-300); }
        .text-slate-400 { color: var(--slate-400); }
        .text-slate-600 { color: var(--slate-600); }
        .text-slate-700 { color: var(--slate-700); }
        .text-slate-800 { color: var(--slate-800); }
        .text-slate-900 { color: var(--slate-900); }
        .text-green-400 { color: #4ade80; }
        .text-indigo-300 { color: #a5b4fc; }
        .text-indigo-400 { color: #818cf8; }

        .border { border-width: 1px; border-style: solid; }
        .border-2 { border-width: 2px; border-style: solid; }
        .border-4 { border-width: 4px; border-style: solid; }
        .border-slate-100 { border-color: var(--slate-100); }
        .border-slate-200 { border-color: var(--slate-200); }
        .border-slate-300 { border-color: var(--slate-300); }
        .border-slate-700 { border-color: var(--slate-700); }
        .border-slate-800 { border-color: var(--slate-800); }
        .border-white { border-color: #ffffff; }

        .relative { position: relative; }
        .absolute { position: absolute; }
        .fixed { position: fixed; }
        .z-10 { z-index: 10; }
        .z-50 { z-index: 50; }

        .w-full { width: 100%; }
        .h-auto { height: auto; }
        .h-10 { height: 2.5rem; }
        .w-12 { width: 3rem; }
        .h-12 { height: 3rem; }
        .w-14 { width: 3.5rem; }
        .h-14 { height: 3.5rem; }
        .w-40 { width: 10rem; }
        .h-40 { height: 10rem; }
        .w-48 { width: 12rem; }
        .h-48 { height: 12rem; }

        .overflow-hidden { overflow: hidden; }
        .object-contain { object-fit: contain; }
        .object-cover { object-fit: cover; }
        .object-top { object-position: top; }

        .flex-shrink-0 { flex-shrink: 0; }
        .mx-auto { margin-left: auto; margin-right: auto; }
        .space-y-2 > * + * { margin-top: 0.5rem; }
        .space-y-3 > * + * { margin-top: 0.75rem; }
        .space-y-4 > * + * { margin-top: 1rem; }
        .space-y-12 > * + * { margin-top: 3rem; }

        .hover\:text-white:hover { color: #ffffff; }
        .hover\:underline:hover { text-decoration: underline; }
