/* =================================================================
   MOBILE ROBUST v3.0.0 FINAL - Zero Desktop Regression
   Fecha: 2026-03-04
   
   RESTRICCIONES CUMPLIDAS:
   ✅ Todos los cambios de layout dentro de media queries específicas
   ✅ Desktop 100% preservado (sin cambios globales)
   ✅ iOS Safari fixes solo en @media (hover:none) and (pointer:coarse)
   ✅ Sin overflow-x:hidden global
   ✅ Sin resets globales * {} o html/body
   ✅ Sin tipografía clamp() global
   
   Compatible con:
   - iOS Safari 14+
   - Chrome Android 90+
   - Samsung Internet 14+
   - Firefox Android 90+
   
   Breakpoints:
   - Mobile: 320px - 767px
   - Tablet: 768px - 1023px
   - Desktop: 1024px+ (sin tocar)
   
   ================================================================= */

/* =================================================================
   SECTION 1: iOS SAFARI FIXES - BUTTON OVERLAYS
   SCOPE: Solo botones/CTAs afectados, sin globals
   ================================================================= */

/* iOS tap highlight removal - SOLO botones afectados */
.btn-primary,
.btn-cta,
.btn-secondary,
.vimeo-facade {
    -webkit-tap-highlight-color: transparent;
}

/* Desktop only: Keep hover effects for mouse users */
@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        background: linear-gradient(135deg, var(--color-dark-2) 0%, var(--color-dark-3) 100%);
        border-color: var(--gold-alpha-70);
        box-shadow: var(--shadow-gold-lg);
        transform: translateY(-3px);
    }
    
    .btn-primary:hover::before {
        left: 100%;
    }
    
    .btn-cta:hover {
        border-color: var(--gold-champagne);
        box-shadow: 0 12px 40px rgba(184, 148, 31, 0.5);
        transform: translateY(-5px);
    }
    
    .btn:hover i {
        transform: translateX(5px);
    }
    
    .vimeo-facade:hover {
        transform: scale(1.02);
        box-shadow: 0 8px 32px rgba(212, 175, 55, 0.4);
    }
    
    .vimeo-facade:hover .vimeo-play-button {
        color: #D4AF37;
        transform: translate(-50%, -50%) scale(1.15);
        text-shadow: 0 4px 16px rgba(212, 175, 55, 0.6);
    }
    
    .vimeo-facade:hover::before {
        background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(0, 0, 0, 0.2) 100%);
    }
}

/* Touch devices: Disable hover effects and problematic pseudo-elements */
@media (hover: none) and (pointer: coarse) {
    /* Disable button hover transform (prevents "stuck" animations) */
    .btn-primary:hover,
    .btn-cta:hover,
    .btn-secondary:hover {
        transform: none !important;
    }
    
    /* Hide ::before pseudo-element on touch (prevents overlay square) */
    .btn-primary::before {
        display: none !important;
    }
    
    /* Disable icon transform on tap */
    .btn:hover i {
        transform: none !important;
    }
    
    /* Disable vimeo-facade hover effects */
    .vimeo-facade:hover {
        transform: none !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    }
    
    .vimeo-facade:hover .vimeo-play-button {
        transform: translate(-50%, -50%) !important;
        color: rgba(255, 255, 255, 0.9) !important;
    }
    
    .vimeo-facade:hover::before {
        background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(0, 0, 0, 0.3) 100%) !important;
    }
    
    /* Enhanced tap feedback for buttons (subtle scale down) */
    .btn-primary:active,
    .btn-cta:active,
    .btn-secondary:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease !important;
    }
    
    /* Enhanced tap feedback for vimeo facade (subtle opacity) */
    .vimeo-facade:active {
        opacity: 0.95 !important;
        transition: opacity 0.1s ease !important;
    }
    
    /* Touch targets: Minimum 44x44px (iOS guideline) */
    .btn,
    .btn-cta,
    .btn-primary,
    .btn-secondary,
    a[class*="btn"] {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    .accordion-header,
    .metodo-accordion-header {
        min-height: 60px !important;
    }
    
    .vimeo-play-button {
        min-width: 60px !important;
        min-height: 60px !important;
    }
}

/* =================================================================
   SECTION 2: VIMEO FACADE CLICKABILITY (iOS)
   Ensures facades work with click/touch/keyboard
   ================================================================= */

.vimeo-facade {
    pointer-events: auto !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
}

.vimeo-play-button {
    pointer-events: none !important;
}

.vimeo-facade::before,
.vimeo-facade::after {
    pointer-events: none !important;
}

.video-testimonial-player {
    position: relative !important;
    width: 100% !important;
}

.video-testimonial-card[hidden],
.video-testimonial-card.authorization-pending {
    display: none;
}

/* Accessibility: Focus states preserved (all devices) */
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-cta:focus-visible,
.vimeo-facade:focus-visible {
    outline: 3px solid var(--gold-primary) !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 4px rgba(184, 148, 31, 0.25) !important;
}

/* =================================================================
   SECTION 3: MOBILE BREAKPOINT (320px - 767px)
   FIX: 5 Errores Críticos Responsive
   TODOS los cambios de layout encapsulados aquí
   ================================================================= */

@media (max-width: 767px) {
    /* ===== FIX 1: PAIN CARDS - 1 columna ===== */
    .pain-points-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .pain-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    .pain-card-icon {
        font-size: 2rem !important;
    }

    .pain-card-title {
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
    }

    .pain-card-description {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }

    /* ===== FIX 2: STATS SECTION - Stack vertical ===== */
    .stats-section {
        padding: 40px 20px !important;
    }

    .stats-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 32px !important;
        align-items: center !important;
    }

    .stat-item {
        width: 100% !important;
        max-width: 280px !important;
        text-align: center !important;
    }

    .stat-number {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }

    .stat-label {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
        margin-top: 8px !important;
    }

    /* ===== FIX 3: MÉTODO 5L TIMELINE - 1 columna ===== */
    .metodo-5l-timeline-visual {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .metodo-5l-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .metodo-5l-card-content {
        padding: 24px 20px !important;
    }

    .metodo-5l-card-title {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }

    .metodo-5l-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.8rem !important;
    }

    /* ===== FIX 4: VIDEO TESTIMONIALS - Layout fluido ===== */
    .video-testimonials-section {
        padding: 60px 20px !important;
    }

    .video-testimonials-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 32px !important;
        width: 100% !important;
    }

    .video-testimonial-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .video-testimonial-player {
        width: 100% !important;
        aspect-ratio: 16 / 9 !important;
    }

    .vimeo-facade {
        width: 100% !important;
        height: 100% !important;
    }

    .video-testimonial-info {
        padding: 20px !important;
    }

    .video-testimonial-quote {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }

    .video-testimonial-author {
        font-size: 1rem !important;
    }

    .video-testimonial-role {
        font-size: 0.85rem !important;
    }

    /* ===== FIX 5: GUARANTEE CARDS - Padding adaptativo ===== */
    .guarantees-luxury-section {
        padding: 60px 20px !important;
    }

    .guarantees-grid,
    .grid.aos-init.aos-animate {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px !important;
        width: 100% !important;
    }

    .guarantee-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 32px 24px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .guarantee-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.8rem !important;
        margin-bottom: 16px !important;
    }

    .guarantee-title {
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
    }

    .guarantee-description {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }

    .guarantee-badge {
        font-size: 0.75rem !important;
        padding: 6px 12px !important;
    }

    /* ===== FIX 6: ACCORDION RESULT - Full width ===== */
    .accordion-result {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 16px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        display: block !important;
    }

    .accordion-result strong {
        display: block !important;
        width: 100% !important;
        margin-bottom: 8px !important;
    }

    /* ===== SPACING - Solo dentro de mobile query ===== */
    section[class*="-section"],
    .section {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }

    .hero-premium,
    .hero-section {
        padding-top: 100px !important;
        padding-bottom: 80px !important;
    }
}

/* =================================================================
   SECTION 4: TABLET BREAKPOINT (768px - 1023px)
   ================================================================= */

@media (min-width: 768px) and (max-width: 1023px) {
    /* Pain Cards: 2 columnas */
    .pain-points-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
    }

    /* Stats: 2 columnas */
    .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 40px !important;
    }

    /* Método 5L Timeline: 2 columnas */
    .metodo-5l-timeline-visual {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
    }

    /* Card 5 ocupa ancho completo */
    .metodo-5l-card:nth-child(5) {
        grid-column: 1 / -1 !important;
        max-width: 50% !important;
        margin: 0 auto !important;
    }

    /* Video Testimonials: 2 columnas */
    .video-testimonials-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 32px !important;
    }

    /* Guarantee Cards: 2 columnas */
    .guarantees-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 32px !important;
    }

    .guarantee-card {
        padding: 40px 32px !important;
    }
}

/* =================================================================
   SECTION 5: FOOTER LINKS - Políticas y Recursos
   ================================================================= */

/* Footer Links Container */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

/* Footer Link Styles */
.footer-link {
    color: var(--text-on-dark-muted, rgba(255, 255, 255, 0.7));
    text-decoration: none;
    font-size: var(--font-size-small, 14px);
    transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-link:hover,
.footer-link:focus {
    color: var(--gold-champagne, #D4AF37);
    opacity: 1;
}

.footer-link:focus-visible {
    outline: 2px solid var(--gold-champagne, #D4AF37);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Footer Separator */
.footer-separator {
    color: var(--text-on-dark-muted, rgba(255, 255, 255, 0.4));
    font-size: var(--font-size-small, 14px);
    user-select: none;
}

/* Mobile: Stack links vertically on very small screens */
@media (max-width: 480px) {
    .footer-links {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-separator {
        display: none;
    }
}

/* =================================================================
   SECTION 6: NAVBAR CTA TEXTO ADAPTATIVO
   Muestra texto completo en desktop grande, acorta en resoluciones medias
   ================================================================= */

/* Por defecto: mostrar texto completo, ocultar texto corto */
.navbar-cta-text-full {
  display: inline;
}

.navbar-cta-text-short {
  display: none;
}

/* Resoluciones intermedias (1024px - 1400px): cambiar a texto corto */
@media (max-width: 1400px) and (min-width: 1025px) {
  .navbar-cta-text-full {
    display: none;
  }
  
  .navbar-cta-text-short {
    display: inline;
  }

  /* Ajustar gap del navbar para estas resoluciones */
  .navbar-nav {
    gap: 24px !important;
  }

  .navbar-cta {
    padding: 11px 24px !important;
    font-size: 13px !important;
    white-space: nowrap;
  }
}

/* Resoluciones muy ajustadas (1024px - 1280px): más compacto */
@media (max-width: 1280px) and (min-width: 1025px) {
  .navbar-nav {
    gap: 20px !important;
  }

  .navbar-cta {
    padding: 10px 20px !important;
    font-size: 13px !important;
  }

  .nav-link {
    font-size: 14px !important;
  }
}

/* Mobile/Tablet (<1024px): usar texto corto también */
@media (max-width: 1024px) {
  .navbar-cta-text-full {
    display: none;
  }
  
  .navbar-cta-text-short {
    display: inline;
  }
}

/* =================================================================
   SECTION 7: DESKTOP (1024px+)
   NO SE TOCA - Mantiene diseño original 100%
   ================================================================= */

/* Desktop mantiene CSS original de 5-sections.css y 7-responsive.css */
/* No hay cambios, no hay overrides, diseño original preservado */

/* =================================================================
   END OF MOBILE ROBUST v3.0.0 FINAL
   ================================================================= */
