/**
 * CONECTA MULTISERVICIOS - CSS MÓVIL NATIVO
 * Optimización para experiencia mobile-first tipo app nativa
 */

/* ============================================
   MOBILE-ONLY OPTIMIZATIONS
   ============================================ */

/* Detección automática de dispositivos móviles */
.is-mobile body,
.is-touch body {
    -webkit-tap-highlight-color: rgba(156, 30, 19, 0.2);
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

/* ============================================
   SAFE AREA & NOTCH SUPPORT (iPhone X+)
   ============================================ */
.is-mobile .navbar,
.is-mobile .hero,
.is-mobile .footer {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.is-mobile .navbar {
    padding-top: env(safe-area-inset-top);
}

.is-mobile .footer {
    padding-bottom: env(safe-area-inset-bottom);
}

/* ============================================
   MOBILE NAVIGATION - PREMIUM LIGHT STYLE
   ============================================ */
.is-mobile .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 9999;
}

.is-mobile .nav-wrapper {
    height: 60px;
    padding: 0 16px;
}

.is-mobile .logo {
    font-size: 18px;
    color: var(--black);
    font-weight: 800;
}

.is-mobile .logo span {
    color: var(--black);
}

.is-mobile .logo-img {
    height: 36px;
    filter: none; /* Logo en color original */
}

/* Mobile Menu - Full Screen Overlay PREMIUM LIGHT */
.is-mobile .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    flex-direction: column;
    justify-content: flex-start;
    padding: 80px 24px 40px;
    padding-top: calc(80px + env(safe-area-inset-top));
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    gap: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.05);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.35s;
    z-index: 9998;
}

.is-mobile .nav-menu.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.is-mobile .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-bottom: 32px;
}

.is-mobile .nav-link {
    width: 100%;
    padding: 20px 24px;
    font-size: 18px;
    font-weight: 600;
    text-align: left;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    margin-bottom: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.2px;
    color: var(--gray-800);
}

.is-mobile .nav-link::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 13px;
    color: var(--gray-400);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
}

.is-mobile .nav-link:active {
    background: rgba(156, 30, 19, 0.08);
    border-color: rgba(156, 30, 19, 0.15);
    transform: scale(0.96);
}

.is-mobile .nav-link.active {
    background: linear-gradient(135deg, rgba(156,30,19,0.08) 0%, rgba(197,36,25,0.08) 100%);
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 12px rgba(156, 30, 19, 0.12);
}

.is-mobile .nav-link.active::after {
    color: var(--primary);
    opacity: 1;
    transform: translateX(2px);
}

/* Link especial de promoción en móvil */
.is-mobile .nav-link-promo {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.12) 0%, rgba(22, 91, 51, 0.12) 100%);
    border: 2px solid #c41e3a;
    color: #c41e3a !important;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(196, 30, 58, 0.2);
    animation: pulsePromo 2s ease-in-out infinite;
}

.is-mobile .nav-link-promo::after {
    content: '🎁';
    font-family: inherit;
    color: #c41e3a;
}

@keyframes pulsePromo {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(196, 30, 58, 0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(196, 30, 58, 0.3);
    }
}

.is-mobile .nav-menu .btn-primary {
    width: 100%;
    padding: 18px 28px;
    font-size: 17px;
    font-weight: 700;
    border-radius: 14px;
    margin-top: auto;
    box-shadow: 0 6px 24px rgba(156, 30, 19, 0.3);
    letter-spacing: -0.2px;
}

.is-mobile .nav-menu .btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 4px 16px rgba(156, 30, 19, 0.4);
}

/* Hamburger Icon - Premium Light Style */
.is-mobile .hamburger {
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    padding: 10px;
    -webkit-tap-highlight-color: transparent;
}

.is-mobile .hamburger span {
    background: var(--black); /* Líneas negras sobre fondo blanco */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.is-mobile .hamburger:active span {
    background: var(--primary); /* Feedback visual al presionar */
}

/* ============================================
   HERO SECTION - MOBILE OPTIMIZED PREMIUM
   ============================================ */
.is-mobile .hero {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    padding: 100px 20px 60px;
    margin-top: 0;
    display: flex;
    align-items: center;
}

.is-mobile .hero .container {
    width: 100%;
}

.is-mobile .hero-logo {
    margin-bottom: 24px;
    animation: fadeInScale 0.8s ease-out;
}

.is-mobile .hero-logo img {
    height: 80px;
    margin-bottom: 0;
}

.is-mobile .hero-badge {
    font-size: 13px;
    padding: 10px 20px;
    margin-bottom: 20px;
}

.is-mobile .hero-title {
    font-size: 38px;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.is-mobile .hero-subtitle {
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 100%;
}

.is-mobile .hero-stats {
    gap: 24px;
    margin-bottom: 40px;
    padding: 0 10px;
}

.is-mobile .stat-number {
    font-size: 40px;
    line-height: 1;
}

.is-mobile .stat-label {
    font-size: 14px;
    margin-top: 4px;
}

.is-mobile .hero-cta {
    flex-direction: column;
    width: 100%;
    gap: 14px;
    padding: 0 10px;
}

.is-mobile .hero-cta .btn {
    width: 100%;
    padding: 17px 28px;
    font-size: 17px;
    font-weight: 600;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.is-mobile .hero-cta .btn-primary {
    box-shadow: 0 6px 20px rgba(156, 30, 19, 0.35);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   SECTIONS - MOBILE SPACING PREMIUM
   ============================================ */
.is-mobile section {
    padding: 70px 20px;
    scroll-margin-top: 60px; /* Para smooth scroll con navbar */
}

.is-mobile .container {
    padding: 0;
    max-width: 100%;
}

.is-mobile .section-header {
    margin-bottom: 48px;
    padding: 0 4px;
}

.is-mobile .section-badge {
    font-size: 13px;
    padding: 10px 18px;
}

.is-mobile .section-title {
    font-size: 34px;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.is-mobile .section-description {
    font-size: 17px;
    line-height: 1.6;
    max-width: 100%;
}

/* Espaciado entre cards */
.is-mobile .about-content,
.is-mobile .services-grid,
.is-mobile .values-grid,
.is-mobile .clients-grid {
    gap: 20px;
}

/* Scroll indicator - ocultar en móvil */
.is-mobile .scroll-indicator {
    display: none;
}

/* ============================================
   CARDS - TOUCH OPTIMIZED PREMIUM
   ============================================ */
.is-mobile .about-card,
.is-mobile .service-card,
.is-mobile .value-card,
.is-mobile .client-card,
.is-mobile .mv-card,
.is-mobile .benefit-item {
    padding: 24px 20px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effect más sutil - mejor para touch */
.is-mobile .about-card:active,
.is-mobile .service-card:active,
.is-mobile .value-card:active,
.is-mobile .client-card:active,
.is-mobile .mv-card:active {
    transform: scale(0.97);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Cards con contenido importante - más padding */
.is-mobile .service-card,
.is-mobile .mv-card {
    padding: 28px 24px;
}

/* Cards featured - destacar más */
.is-mobile .service-card.featured {
    box-shadow: 0 8px 24px rgba(156, 30, 19, 0.2);
}

/* ============================================
   FORMS - NATIVE INPUT STYLE
   ============================================ */
.is-mobile .form-group input,
.is-mobile .form-group select,
.is-mobile .form-group textarea {
    font-size: 16px; /* Previene zoom en iOS */
    padding: 16px;
    border-radius: 12px;
    -webkit-appearance: none;
    appearance: none;
}

.is-mobile .form-group input:focus,
.is-mobile .form-group select:focus,
.is-mobile .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(156,30,19,0.12);
}

.is-mobile .btn {
    font-size: 16px;
    padding: 16px 24px;
    border-radius: 12px;
    min-height: 48px; /* Touch target mínimo */
}

/* ============================================
   TIMELINE - MOBILE VERSION
   ============================================ */
.is-mobile .timeline-item {
    flex-direction: column;
    gap: 16px;
}

.is-mobile .timeline-dot {
    width: 32px;
    height: 32px;
}

/* ============================================
   FOOTER - MOBILE OPTIMIZED
   ============================================ */
.is-mobile .footer {
    padding: 48px 16px 32px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

.is-mobile .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
}

.is-mobile .footer-logo-img {
    height: 40px;
}

/* ============================================
   BACK TO TOP - MOBILE POSITION
   ============================================ */
.is-mobile .back-to-top {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 20px;
    width: 52px;
    height: 52px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.is-mobile .back-to-top:active {
    transform: scale(0.95);
}

/* ============================================
   SCROLL BEHAVIOR - PREMIUM SMOOTH
   ============================================ */
.is-mobile html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Espacio para navbar */
}

.is-mobile body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none; /* Previene bounce en iOS */
}

/* Mejorar smooth scroll en secciones */
.is-mobile section {
    scroll-snap-stop: normal;
}

/* Navbar premium con efectos sutiles al scrollear */
.is-mobile .navbar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scroll hacia abajo - oculta navbar */
html[data-scroll-direction="down"] .is-mobile .navbar {
    transform: translateY(-100%);
}

/* Scroll hacia arriba - muestra navbar con más sombra */
html[data-scroll-direction="up"] .is-mobile .navbar {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* ============================================
   TOUCH FEEDBACK - BUTTONS & LINKS
   ============================================ */
.is-mobile a,
.is-mobile button {
    -webkit-tap-highlight-color: rgba(156, 30, 19, 0.1);
    touch-action: manipulation;
}

.is-mobile .btn:active {
    transform: scale(0.97);
}

.is-mobile .social-link:active,
.is-mobile .footer-social a:active {
    transform: scale(0.9);
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading {
    overflow: hidden;
}

.loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 9999999;
}

/* ============================================
   OPTIMIZATIONS - PERFORMANCE
   ============================================ */
.is-mobile .hero-background,
.is-mobile .animated-shapes {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.is-mobile img {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Reduce motion para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .is-mobile * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   LANDSCAPE MODE - MOBILE
   ============================================ */
@media (max-width: 992px) and (orientation: landscape) {
    .is-mobile .hero {
        min-height: auto;
        padding: 60px 16px 40px;
    }
    
    .is-mobile .hero-logo img {
        height: 50px;
    }
    
    .is-mobile .hero-title {
        font-size: 28px;
    }
    
    .is-mobile .hero-stats {
        flex-direction: row;
        gap: 16px;
    }
}

/* ============================================
   SMALL SCREENS (<375px)
   ============================================ */
@media (max-width: 374px) {
    .is-mobile .hero-title {
        font-size: 30px;
    }
    
    .is-mobile .section-title {
        font-size: 28px;
    }
    
    .is-mobile .logo-img {
        height: 32px;
    }
    
    .is-mobile .hero-logo img {
        height: 60px;
    }
}

/* ============================================
   LARGE SCREENS (>768px) - Keep Mobile Feel on Tablets
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .is-tablet .hero-title {
        font-size: 48px;
    }
    
    .is-tablet .section-title {
        font-size: 40px;
    }
    
    .is-tablet .nav-menu {
        padding: 32px;
    }
}

/* ============================================
   OVERSCROLL PREVENTION - PREMIUM
   ============================================ */
.is-mobile html,
.is-mobile body {
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
}

/* Prevenir bounce en Safari iOS */
.is-mobile body {
    position: relative;
    overflow-x: hidden;
}

/* Mejor control de scroll */
.is-mobile {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Altura viewport real para móviles */
.is-mobile .hero {
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
}

/* ============================================
   DARK MODE SUPPORT (opcional - por defecto light)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Mantenemos el tema claro incluso en dark mode del sistema */
    /* Para experiencia consistente y mejor visibilidad del logo */
    .is-mobile .navbar {
        background: rgba(255, 255, 255, 0.95);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .is-mobile .nav-menu {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
    }
    
    /* Si se desea dark mode verdadero, descomentar: */
    /*
    .is-mobile .navbar {
        background: rgba(26, 26, 26, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .is-mobile .logo,
    .is-mobile .logo span {
        color: var(--white);
    }
    
    .is-mobile .hamburger span {
        background: var(--white);
    }
    
    .is-mobile .nav-menu {
        background: linear-gradient(180deg, rgba(26, 26, 26, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
    }
    
    .is-mobile .nav-link {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--white);
    }
    */
}

/* ============================================
   TOUCH GESTURES - SWIPE INDICATORS
   ============================================ */
.is-mobile .swipe-indicator {
    position: relative;
    overflow: hidden;
}

.is-mobile .swipe-indicator::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

/* ============================================
   MODAL & OVERLAY IMPROVEMENTS
   ============================================ */
.is-mobile .modal,
.is-mobile .overlay {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ============================================
   PRINT STYLES - HIDE ON MOBILE
   ============================================ */
@media print {
    .is-mobile .navbar,
    .is-mobile .hamburger,
    .is-mobile .back-to-top {
        display: none !important;
    }
}

/* ============================================
   CUSTOM SCROLLBAR - MOBILE
   ============================================ */
.is-mobile ::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
}

/* ============================================
   HIGH DPI SCREENS (Retina)
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .is-mobile img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ============================================
   FOCUS VISIBLE - ACCESSIBILITY
   ============================================ */
.is-mobile *:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   WEBKIT & TYPOGRAPHY OPTIMIZATIONS
   ============================================ */
.is-mobile {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

/* Tipografía premium para móvil */
.is-mobile body {
    font-size: 17px; /* Tamaño base iOS */
    line-height: 1.6;
    letter-spacing: -0.2px;
}

.is-mobile h1, 
.is-mobile h2, 
.is-mobile h3 {
    letter-spacing: -0.5px;
    font-weight: 700;
}

.is-mobile p {
    line-height: 1.65;
    color: var(--gray-700);
}

/* Mejorar contraste en móviles */
.is-mobile .hero-subtitle,
.is-mobile .section-description {
    color: rgba(255, 255, 255, 0.95);
}

.is-mobile .about-card p,
.is-mobile .service-card p,
.is-mobile .value-card p {
    color: var(--gray-700);
    line-height: 1.7;
}

/* Padding consistente en contenedores */
.is-mobile .about-text,
.is-mobile .about-visual,
.is-mobile .jobs-benefits,
.is-mobile .jobs-form,
.is-mobile .contact-info,
.is-mobile .contact-form-wrapper {
    padding: 0 4px;
}

/* Mejorar spacing en timeline */
.is-mobile .timeline {
    padding: 28px 24px;
}

.is-mobile .timeline-item {
    gap: 20px;
    margin-bottom: 24px;
}

/* Mission & Vision cards - más espacio */
.is-mobile .mission-vision {
    gap: 24px;
}

.is-mobile .mv-card {
    padding: 36px 28px;
}

/* Formularios - mejor UX */
.is-mobile .form-card,
.is-mobile .contact-form-wrapper {
    padding: 32px 24px;
    border-radius: 20px;
}

.is-mobile .form-group {
    margin-bottom: 20px;
}

.is-mobile .form-group label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--gray-800);
}

.is-mobile .form-group input,
.is-mobile .form-group select,
.is-mobile .form-group textarea {
    font-size: 17px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 2px solid var(--gray-200);
}

.is-mobile .form-group input:focus,
.is-mobile .form-group select:focus,
.is-mobile .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(156,30,19,0.08);
}



