/* ============================================
   FIXES COMPLETOS - PLANIFICA+
   Soluciona todos los problemas reportados
   ============================================ */

/* ============================================
   FIX 1: PREVENIR CONTENIDO SUPERPUESTO
   ============================================ */

/* Asegurar orden de apilamiento correcto */
.main-header {
    z-index: 1000 !important;
}

.hero {
    position: relative;
    z-index: 1;
}

/* Canvas de fondo siempre atrás */
#hero-canvas,
#section-canvas,
#footer-canvas,
canvas {
    position: absolute !important;
    z-index: 0 !important;
    pointer-events: none !important;
}

/* Contenido siempre encima de decoraciones */
.hero-content,
.section-content,
.container {
    position: relative;
    z-index: 2;
}

/* SVG decorativos atrás del contenido */
svg.decoration,
.decoration-svg,
.background-decoration {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   FIX 2: CURSOR DESAPARECE (pointer-events)
   ============================================ */

/* Asegurar que todos los elementos interactivos tengan cursor */
a, button, .btn, input, select, textarea {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Links específicos */
.nav-link,
.btn-primary,
.btn-secondary,
.btn-contact,
.magnetic {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Canvas NO debe capturar eventos */
canvas {
    pointer-events: none !important;
}

/* Secciones interactivas */
.service-card,
.pricing-card,
.feature-card {
    pointer-events: auto !important;
}

.service-card *,
.pricing-card *,
.feature-card * {
    pointer-events: auto !important;
}

/* ============================================
   FIX 3: ESPACIADO EXCESIVO EN DESKTOP
   ============================================ */

@media (min-width: 1200px) {
    /* Reducir padding en secciones */
    .section {
        padding: 6rem 0 !important;
    }
    
    /* Hero más compacto */
    .hero {
        padding: 8rem 0 6rem !important;
        min-height: 85vh !important;
    }
    
    /* Títulos con menos margen */
    .hero-title {
        margin-bottom: 1.5rem !important;
    }
    
    .hero-subtitle {
        margin-bottom: 1.5rem !important;
    }
    
    .hero-description {
        margin-bottom: 2.5rem !important;
        line-height: 1.7 !important;
    }
    
    /* Sección de servicios */
    .section-title {
        margin-bottom: 1rem !important;
    }
    
    .section-subtitle {
        margin-bottom: 3rem !important;
        line-height: 1.6 !important;
    }
    
    /* Cards con padding optimizado */
    .service-card,
    .pricing-card {
        padding: 2.5rem !important;
    }
    
    /* Grids con gap moderado */
    .services-grid,
    .pricing-grid {
        gap: 2rem !important;
    }
    
    /* Features sections */
    .features-section {
        margin-bottom: 1.5rem !important;
        padding: 1.5rem !important;
    }
    
    .features-list {
        gap: 1rem !important;
    }
    
    /* CTA section */
    .cta {
        padding: 6rem 0 !important;
    }
    
    .cta-title {
        margin-bottom: 1.5rem !important;
    }
    
    .cta-description {
        margin-bottom: 2.5rem !important;
        line-height: 1.6 !important;
    }
}

/* ============================================
   FIX 4: CONTENIDO CORTADO / DESBORDAMIENTO
   ============================================ */

/* Prevenir overflow horizontal */
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

html {
    overflow-x: hidden !important;
}

/* Containers nunca deben desbordar */
.container,
.hero-content,
.section-content {
    max-width: 100% !important;
    overflow: visible !important;
}

/* Hero title sin cortes */
.hero-title {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    max-width: 100% !important;
}

/* Decoraciones que no interfieran con texto */
.hero::before,
.hero::after,
.section::before,
.section::after {
    z-index: 0 !important;
    pointer-events: none !important;
}

/* ============================================
   FIX 5: BOTONES Y FORMULARIOS
   ============================================ */

/* Botones siempre visibles y clicables */
.btn,
.btn-primary,
.btn-secondary,
.btn-contact {
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Formularios encima de decoraciones */
.contact-form,
.contact-form-inline {
    position: relative;
    z-index: 10;
}

.form-input,
.form-select,
.form-textarea {
    pointer-events: auto !important;
    cursor: text !important;
}

/* ============================================
   FIX 6: NAVEGACIÓN MÓVIL
   ============================================ */

@media (max-width: 768px) {
    /* Header fijo en móvil */
    .main-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
    }
    
    /* Compensar espacio del header fijo */
    body {
        padding-top: 70px !important;
    }
    
    /* Menú hamburguesa */
    .nav-toggle {
        z-index: 1001 !important;
        cursor: pointer !important;
        pointer-events: auto !important;
    }
    
    /* Menú desplegable */
    .main-nav {
        z-index: 999 !important;
    }
    
    .main-nav.active {
        pointer-events: auto !important;
    }
    
    /* Overlay cuando menú abierto */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================================
   FIX 7: RESPONSIVE MEJORADO
   ============================================ */

@media (max-width: 768px) {
    /* Reducir espaciado general */
    .section {
        padding: 3rem 0 !important;
    }
    
    .hero {
        padding: 5rem 0 3rem !important;
    }
    
    /* Tipografía escalable */
    .hero-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-subtitle {
        font-size: clamp(0.9rem, 4vw, 1.1rem) !important;
        margin-bottom: 1rem !important;
    }
    
    .section-title {
        font-size: clamp(1.75rem, 7vw, 2.25rem) !important;
        line-height: 1.2 !important;
    }
    
    /* Cards en columna */
    .services-grid,
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Botones full width */
    .btn,
    .btn-primary,
    .btn-secondary {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }
}

/* ============================================
   FIX 8: ELEMENTOS ESPECÍFICOS
   ============================================ */

/* Service icons siempre visibles */
.service-icon {
    z-index: 2;
    position: relative;
}

/* Pricing cards */
.pricing-card {
    position: relative;
    z-index: 1;
}

.pricing-card .glow-border {
    z-index: 0;
}

.pricing-card .card-content {
    position: relative;
    z-index: 2;
}

/* Timeline */
.timeline-container {
    position: relative;
    z-index: 1;
}

.timeline-step {
    position: relative;
    z-index: 2;
}

/* Footer */
.site-footer {
    position: relative;
    z-index: 1;
}

.footer-content {
    position: relative;
    z-index: 2;
}

/* ============================================
   FIX 9: TABLAS RESPONSIVAS
   ============================================ */

@media (max-width: 768px) {
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 0 -1rem !important;
        padding: 0 1rem !important;
    }
    
    .comparison-table {
        min-width: 700px !important;
    }
}

/* ============================================
   FIX 10: PERFORMANCE Y ANIMACIONES
   ============================================ */

/* Reducir animaciones en móvil */
@media (max-width: 768px) {
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.2s !important;
    }
    
    /* Desactivar animaciones de decoración */
    .g-fade-up,
    .fade-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Ocultar canvas en móvil para mejor performance */
    #hero-canvas,
    #section-canvas,
    #footer-canvas {
        display: none !important;
    }
}

/* ============================================
   FIX 11: ACCESIBILIDAD
   ============================================ */

/* Focus visible */
*:focus-visible {
    outline: 2px solid var(--primary, #3f0cfe) !important;
    outline-offset: 2px !important;
}

/* Área de clic mínima */
a, button, .btn {
    min-height: 44px !important;
    min-width: 44px !important;
}

/* Texto legible */
p, li, span, div {
    line-height: 1.6 !important;
}

/* ============================================
   FIX 12: COMPATIBILIDAD NAVEGADORES
   ============================================ */

/* Safari iOS - prevenir zoom en inputs */
@supports (-webkit-touch-callout: none) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Firefox */
@-moz-document url-prefix() {
    .service-card,
    .pricing-card {
        transform: translateZ(0);
    }
}

/* ============================================
   FIX 13: Z-INDEX HIERARCHY
   ============================================ */

/* Jerarquía clara de z-index */
.nav-toggle { z-index: 1001 !important; }
.main-header { z-index: 1000 !important; }
.main-nav { z-index: 999 !important; }
.nav-overlay { z-index: 998 !important; }
.whatsapp-float { z-index: 9999 !important; }
.modal { z-index: 10000 !important; }

/* Contenido normal */
.hero-content,
.section-content,
.container { z-index: 2 !important; }

/* Decoraciones siempre atrás */
canvas,
.decoration,
.glow-border,
.background-decoration { z-index: 0 !important; }

/* ============================================
   FIX 14: IMÁGENES Y MEDIA
   ============================================ */

img, video, iframe {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* ============================================
   FIX 15: FORMS INLINE
   ============================================ */

@media (max-width: 768px) {
    .form-row {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .form-input,
    .form-select {
        width: 100% !important;
    }
}

/* ============================================
   FIX 16: TAMAÑOS DE LOGO
   ============================================ */

/* Logo del Header - Desktop */
.main-header .logo img,
.header-content .logo img {
    height: 40px !important;
    width: auto !important;
    max-width: 200px !important;
    display: block !important;
}

/* Logo del Header - Tablet */
@media (max-width: 1024px) {
    .main-header .logo img,
    .header-content .logo img {
        height: 35px !important;
        max-width: 180px !important;
    }
}

/* Logo del Header - Móvil */
@media (max-width: 768px) {
    .main-header .logo img,
    .header-content .logo img {
        height: 28px !important;
        max-width: 160px !important;
    }
}

/* Logo del Header - Móvil pequeño */
@media (max-width: 480px) {
    .main-header .logo img,
    .header-content .logo img {
        height: 24px !important;
        max-width: 140px !important;
    }
}

/* Logo del Footer - Desktop */
.site-footer .footer-logo,
.footer-brand .footer-logo {
    height: 45px !important;
    width: auto !important;
    max-width: 220px !important;
    display: block !important;
    margin-bottom: 1.5rem !important;
}

/* Logo del Footer - Tablet */
@media (max-width: 1024px) {
    .site-footer .footer-logo,
    .footer-brand .footer-logo {
        height: 38px !important;
        max-width: 200px !important;
    }
}

/* Logo del Footer - Móvil */
@media (max-width: 768px) {
    .site-footer .footer-logo,
    .footer-brand .footer-logo {
        height: 32px !important;
        max-width: 180px !important;
        margin: 0 auto 1.25rem !important;
    }
}

/* Logo del Footer - Móvil pequeño */
@media (max-width: 480px) {
    .site-footer .footer-logo,
    .footer-brand .footer-logo {
        height: 28px !important;
        max-width: 160px !important;
    }
}

/* Contenedor del logo */
.logo {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

.footer-brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

@media (max-width: 768px) {
    .footer-brand {
        align-items: center !important;
        text-align: center !important;
    }
}

/* Prevenir distorsión */
.logo img,
.footer-logo {
    object-fit: contain !important;
    object-position: center !important;
    transition: all 0.3s ease !important;
}

/* Hover effect */
.logo:hover img {
    opacity: 0.85 !important;
}

/* Prioridad máxima */
body .main-header .logo img,
body .header-content .logo img {
    height: 40px !important;
}

body .site-footer .footer-logo,
body .footer-brand .footer-logo {
    height: 45px !important;
}

@media (max-width: 768px) {
    body .main-header .logo img,
    body .header-content .logo img {
        height: 28px !important;
    }
    
    body .site-footer .footer-logo,
    body .footer-brand .footer-logo {
        height: 32px !important;
    }
}

/* ============================================
   NOTAS DE IMPLEMENTACIÓN
   ============================================ */

/*
IMPORTANTE: Este archivo debe cargarse DESPUÉS de tus estilos principales.

En el <head> de tu HTML:
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/fixes-completos.css">

Orden correcto:
1. Reset CSS
2. Variables CSS
3. Estilos principales (styles.css)
4. Este archivo de fixes (fixes-completos.css)
*/