/* ===================================
   MOBILE RESPONSIVE FIXES - ULTRA COMPLETO
   Gabriel Rojas Coach Website
   Optimizado 100% para móviles
   Cada botón, enlace, imagen y detalle perfecto
=================================== */

/* VARIABLES */
:root {
    --mobile-padding: 1.5rem;
    --mobile-gap: 1rem;
}

/* ===================================
   NAV-TOGGLE FORZADO GLOBALMENTE
   (Sobrescribe style.css en todas las resoluciones)
   =================================== */

.nav-toggle {
    display: none !important; /* Oculto por defecto */
}

@media (max-width: 968px) {
    .nav-toggle {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        position: fixed !important;
        top: 1rem !important;
        right: 1rem !important;
        background: rgba(26, 26, 26, 0.95) !important;
        border: 2px solid var(--beige) !important;
        color: var(--beige) !important;
        cursor: pointer !important;
        padding: 0.8rem 1rem !important;
        z-index: 1001 !important;
        border-radius: 8px !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
    }
    
    .nav-toggle span {
        display: block !important;
        width: 25px !important;
        height: 3px !important;
        background-color: var(--beige) !important;
        transition: all 0.3s ease !important;
        border-radius: 3px !important;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px) !important;
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0 !important;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px) !important;
    }
    
    .nav-toggle:hover {
        background: var(--green) !important;
        transform: scale(1.05) !important;
    }
    
    .nav-toggle:active {
        transform: scale(0.95) !important;
    }
}

/* ===================================
   NAVEGACIÓN MOBILE
   =================================== */

@media (max-width: 968px) {
    /* Navbar mobile */
    .navbar {
        padding: 1rem 1.5rem;
    }
    
    /* Menu desplegable desde la izquierda */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background: linear-gradient(135deg, rgba(26, 26, 26, 0.98) 0%, rgba(40, 40, 40, 0.98) 100%);
        width: 85%;
        max-width: 350px;
        height: 100vh;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 40px rgba(0,0,0,0.7);
        padding: 6rem 2rem 2rem;
        gap: 0;
        z-index: 1000;
        overflow-y: auto;
        border-right: 2px solid var(--beige);
        display: flex !important; /* Siempre visible para la transición */
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid rgba(226, 210, 186, 0.1);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu li a {
        font-size: 1.1rem;
        padding: 1.2rem 1.5rem;
        display: block;
        width: 100%;
        color: var(--beige);
        transition: all 0.3s ease;
        position: relative;
        font-weight: 500;
    }
    
    .nav-menu li a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 0;
        background: var(--green);
        transition: height 0.3s ease;
    }
    
    .nav-menu li a:hover,
    .nav-menu li a:active {
        background: rgba(122, 155, 118, 0.15);
        color: var(--green);
        padding-left: 2rem;
    }
    
    .nav-menu li a:hover::before,
    .nav-menu li a:active::before {
        height: 100%;
    }
    
    .logo-image {
        height: 65px !important;
        width: 65px !important;
    }
}

/* ===================================
   HERO SECTIONS - MOBILE
   =================================== */

@media (max-width: 768px) {
    /* TODAS LAS TARJETAS REDONDAS EN MÓVIL */
    .servicio-card,
    .video-card,
    .caso-card,
    .testimonial-card,
    .methodology-step,
    .program-card,
    .course-card,
    .masterclass-card,
    .community-card,
    [class*="-card"] {
        border-radius: 30px !important;
    }
    
    /* Hero general */
    .hero {
        padding: 15rem 1.5rem 4rem !important;
        min-height: auto !important;
    }
    
    /* Hero de inicio - menos padding en móvil */
    .hero#inicio {
        padding-top: 12rem !important;
    }
    
    /* PÁGINAS INTERNAS - ESPACIADO EXTRA EN MÓVIL */
    .servicios-hero,
    .blog-hero,
    .testimonios-hero,
    .about-hero {
        padding-top: 15rem !important;
    }
    
    .hero-container {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem) !important;
        line-height: 1.2 !important;
    }
    
    .hero-badge {
        font-size: 0.85rem !important;
        padding: 0.7rem 1.2rem !important;
    }
    
    .hero-content {
        text-align: center !important;
    }
    
    .hero-image {
        max-width: 280px !important;
        margin: 0 auto !important;
    }
    
    .hero-image img {
        max-width: 100% !important;
    }
    
    /* Contact hero */
    .contact-hero {
        padding: 12rem 1.5rem 4rem !important;
    }
    
    /* Academy hero */
    .academy-hero {
        padding: 12rem 1.5rem 4rem !important;
    }
    
    .academy-hero-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .academy-hero-logo {
        order: -1 !important;
        margin-top: 3rem !important;
    }
    
    .academy-hero-logo img {
        max-width: 200px !important;
    }
}

/* ===================================
   BOTONES Y CTAs - MOBILE
   =================================== */

@media (max-width: 768px) {
    .btn {
        width: 100% !important;
        text-align: center !important;
        padding: 1rem 2rem !important;
        font-size: 1rem !important;
    }
    
    .hero-cta,
    .cta-buttons {
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    
    .btn-primary,
    .btn-outline,
    .btn-submit {
        width: 100% !important;
    }
}

/* ===================================
   STATS SECTION - MOBILE
   =================================== */

@media (max-width: 768px) {
    .stats-section {
        padding: 3rem 1.5rem !important;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
        padding: 2rem 1rem !important;
    }
    
    .stat-item {
        padding: 1rem !important;
    }
    
    .stat-number {
        font-size: 2.5rem !important;
    }
    
    .stat-label {
        font-size: 0.75rem !important;
    }
}

/* ===================================
   SERVICIOS GRID - MOBILE
   =================================== */

@media (max-width: 768px) {
    .servicios {
        padding: 4rem 1.5rem !important;
    }
    
    .servicios-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .servicio-card {
        padding: 2rem 1.5rem !important;
    }
    
    .servicio-icon {
        font-size: 2.5rem !important;
    }
    
    .servicio-card h3 {
        font-size: 1.3rem !important;
    }
    
    .servicio-card p {
        font-size: 0.95rem !important;
    }
}

/* ===================================
   VIDEO SECTIONS - MOBILE
   =================================== */

@media (max-width: 768px) {
    .videos-section {
        padding: 4rem 1.5rem !important;
    }
    
    .videos-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .video-card {
        max-width: 100% !important;
    }
    
    .video-wrapper {
        height: 220px !important;
    }
    
    .videos-grid.pyramid .video-row-top,
    .videos-grid.pyramid .video-row-bottom {
        grid-template-columns: 1fr !important;
    }
    
    .category-title {
        font-size: 2rem !important;
    }
}

/* ===================================
   COMMUNITY SECTION - MOBILE
   =================================== */

@media (max-width: 768px) {
    .community-section {
        padding: 4rem 1.5rem !important;
    }
    
    .community-grid-three {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .community-card {
        padding: 2rem 1.5rem !important;
    }
    
    .community-stat {
        font-size: 2.5rem !important;
    }
    
    .community-button {
        padding: 1rem 2rem !important;
        font-size: 1rem !important;
        width: 100% !important;
    }
}

/* ===================================
   FORMULARIO CONTACTO - MOBILE
   =================================== */

@media (max-width: 768px) {
    .contact-form-section {
        padding: 4rem 1.5rem !important;
    }
    
    .contact-layout {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
    }
    
    .form-container {
        padding: 2rem 1.5rem !important;
    }
    
    .form-row {
        grid-template-columns: 1fr !important;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px !important; /* Previene zoom en iOS */
    }
    
    .btn-submit {
        width: 100% !important;
        padding: 1rem !important;
    }
    
    .map-wrapper {
        height: 300px !important;
    }
}

/* ===================================
   REDES SOCIALES GRID - MOBILE
   =================================== */

@media (max-width: 768px) {
    .social-networks-section {
        padding: 4rem 1.5rem !important;
    }
    
    .social-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .social-card {
        padding: 2rem 1.5rem !important;
    }
    
    .social-icon svg {
        width: 40px !important;
        height: 40px !important;
    }
    
    .social-title {
        font-size: 1.3rem !important;
    }
}

/* ===================================
   INSTAGRAM FEED - MOBILE
   =================================== */

@media (max-width: 768px) {
    .instagram-feed-section {
        padding: 4rem 1.5rem !important;
    }
    
    .instagram-feed-container {
        padding: 1rem !important;
    }
    
    .snapwidget-widget {
        height: 500px !important;
    }
    
    .instagram-follow-btn {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.95rem !important;
        width: 100% !important;
        max-width: 300px !important;
    }
}

/* ===================================
   FOOTER - MOBILE
   =================================== */

@media (max-width: 768px) {
    .footer {
        padding: 4rem 1.5rem 2rem !important;
    }
    
    .footer-container {
        grid-template-columns: 1fr 1fr !important;
        gap: 2rem !important;
        padding: 0 1rem !important;
    }
    
    .footer-col {
        text-align: left !important;
    }
    
    .footer-col h4 {
        font-size: 0.85rem !important;
    }
    
    .footer-col ul li a,
    .footer-contact li {
        font-size: 0.75rem !important;
    }
    
    .footer-logo {
        justify-content: center !important;
    }
    
    .footer-logo-center img {
        width: 85px !important;
        height: 85px !important;
    }
    
    .footer-social {
        justify-content: flex-start !important;
        gap: 0.5rem !important;
    }
    
    .footer-social a {
        width: 28px !important;
        height: 28px !important;
    }
    
    .footer-social a svg {
        width: 16px !important;
        height: 16px !important;
    }
    
    .footer-bottom {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1.5rem !important;
    }
    
    .legal-links {
        flex-direction: column !important;
        gap: 1rem !important;
    }
}

/* ===================================
   ACADEMY - MOBILE
   =================================== */

@media (max-width: 768px) {
    .courses-section,
    .programs-section,
    .masterclass-section {
        padding: 4rem 1.5rem !important;
    }
    
    .courses-grid,
    .programs-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .course-card,
    .program-card {
        max-width: 100% !important;
    }
    
    .section-title h2 {
        font-size: 2rem !important;
    }
}

/* ===================================
   SERVICIOS INDIVIDUALES - MOBILE
   =================================== */

@media (max-width: 768px) {
    .service-hero {
        padding: 7rem 1.5rem 4rem !important;
    }
    
    .paraquien-grid,
    .incluye-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .paraquien-card,
    .incluye-card {
        padding: 2rem 1.5rem !important;
    }
    
    .incluye-icon {
        font-size: 2.5rem !important;
    }
}

/* ===================================
   SOBRE MI - MOBILE
   =================================== */

@media (max-width: 768px) {
    .story-section,
    .timeline-section,
    .mission-section {
        padding: 4rem 1.5rem !important;
    }
    
    .timeline-item {
        padding-left: 3rem !important;
    }
    
    .timeline-item::before {
        left: 0 !important;
    }
}

/* ===================================
   TESTIMONIOS - MOBILE
   =================================== */

@media (max-width: 768px) {
    .testimonios {
        padding: 4rem 1.5rem !important;
    }
    
    .testimonio-card {
        padding: 2rem 1.5rem !important;
    }
    
    .testimonio-texto {
        font-size: 1rem !important;
    }
}

/* ===================================
   WHATSAPP FLOAT - MOBILE
   =================================== */

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px !important;
        right: 20px !important;
        padding: 8px 14px !important;
        gap: 8px !important;
        border-radius: 50px !important;
        animation: none !important;
    }
    
    .whatsapp-icon {
        width: 32px !important;
        height: 32px !important;
    }
    
    .whatsapp-icon svg {
        width: 32px !important;
        height: 32px !important;
    }
    
    .whatsapp-text {
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        display: inline !important;
        white-space: nowrap !important;
    }
}

/* ===================================
   IMÁGENES RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .course-thumbnail img,
    .program-thumbnail img {
        object-fit: cover !important;
    }
}

/* ===================================
   TIPOGRAFÍA MOBILE
   =================================== */

@media (max-width: 768px) {
    h1 {
        font-size: clamp(2rem, 8vw, 3rem) !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: clamp(1.8rem, 6vw, 2.5rem) !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: clamp(1.3rem, 4vw, 1.8rem) !important;
    }
    
    p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
}

/* ===================================
   SPACING GENERAL - MOBILE
   =================================== */

@media (max-width: 768px) {
    section {
        padding: 4rem 1.5rem !important;
    }
    
    .container,
    .container-wide {
        padding: 0 1.5rem !important;
    }
}

/* ===================================
   FIXES PARA PANTALLAS MUY PEQUEÑAS
   =================================== */

@media (max-width: 375px) {
    .hero-title {
        font-size: 1.8rem !important;
    }
    
    .btn {
        font-size: 0.9rem !important;
        padding: 0.875rem 1.5rem !important;
    }
    
    .stat-number {
        font-size: 2rem !important;
    }
    
    .stat-label {
        font-size: 0.7rem !important;
    }
}

/* ===================================
   LANDSCAPE MODE
   =================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero,
    .contact-hero,
    .academy-hero {
        min-height: auto !important;
        padding: 6rem 1.5rem 3rem !important;
    }
    
    .nav-menu {
        max-height: calc(100vh - 60px) !important;
    }
}

/* ===================================
   PREVENT ZOOM ON INPUT FOCUS (iOS)
   =================================== */

@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ===================================
   SMOOTH SCROLLING
   =================================== */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ===================================
   MEJORAS ADICIONALES - MOBILE PERFECTO
   =================================== */

/* Táctil optimizado - Área de toque mínima 44x44px */
@media (max-width: 768px) {
    a:not(.nav-toggle), button:not(.nav-toggle), .btn {
        min-height: 44px !important;
        min-width: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Enlaces de navegación con área táctil óptima */
    nav ul li a {
        padding: 1.2rem 1.5rem !important;
        min-height: 50px !important;
    }
    
    /* Botones de redes sociales con área táctil perfecta */
    .social-icon {
        padding: 1rem !important;
        min-width: 50px !important;
        min-height: 50px !important;
    }
}

/* Optimizaciones de rendimiento para móvil */
@media (max-width: 768px) {
    /* Reducir animaciones pesadas */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
    
    /* Optimizar carga de imágenes */
    img {
        content-visibility: auto;
        contain: layout style paint;
    }
    
    /* Prevenir scroll horizontal */
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Contenedores sin overflow */
    .container,
    .hero-container,
    .stats-container,
    .servicios-grid,
    .videos-grid {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* Textos legibles en móvil - contraste mejorado */
@media (max-width: 768px) {
    p, li, span, a {
        text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }
    
    /* Títulos con mejor contraste */
    h1, h2, h3, h4, h5, h6 {
        text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
}

/* Formularios táctiles optimizados */
@media (max-width: 768px) {
    /* Inputs más grandes y fáciles de tocar */
    input, textarea, select {
        min-height: 50px !important;
        padding: 1rem !important;
        border-radius: 12px !important;
    }
    
    /* Labels más visibles */
    label {
        font-size: 1rem !important;
        font-weight: 600 !important;
        margin-bottom: 0.5rem !important;
        display: block !important;
    }
    
    /* Checkboxes y radios más grandes */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 24px !important;
        min-height: 24px !important;
        margin-right: 0.75rem !important;
    }
}

/* Mejoras para enlaces y navegación */
@media (max-width: 768px) {
    /* Enlaces con feedback táctil visible */
    a:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
    
    /* Botones con feedback táctil */
    .btn:active,
    button:active {
        transform: scale(0.95) !important;
        box-shadow: inset 0 2px 8px rgba(0,0,0,0.3) !important;
    }
}

/* Grid responsivo mejorado */
@media (max-width: 768px) {
    /* Grids de 2 columnas optimizados */
    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    /* Asegurar que cards no se desborden */
    .servicio-card,
    .video-card,
    .course-card,
    .program-card,
    .testimonio-card,
    .social-card {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Modales y overlays móviles */
@media (max-width: 768px) {
    /* Overlay del menú móvil */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.7);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    /* Prevenir scroll cuando menu abierto */
    body.menu-open {
        overflow: hidden !important;
    }
}

/* Videos responsive perfectos */
@media (max-width: 768px) {
    /* Contenedores de video con aspect ratio */
    .video-wrapper,
    .video-container {
        position: relative !important;
        width: 100% !important;
        padding-bottom: 56.25% !important; /* 16:9 */
        height: 0 !important;
        overflow: hidden !important;
    }
    
    .video-wrapper iframe,
    .video-wrapper video,
    .video-container iframe,
    .video-container video {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border: none !important;
    }
}

/* Tablas responsive */
@media (max-width: 768px) {
    table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    th, td {
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
    }
}

/* Carruseles y sliders móviles */
@media (max-width: 768px) {
    .carousel,
    .slider {
        touch-action: pan-x !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* Fix para SVGs responsive */
@media (max-width: 768px) {
    svg {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* Tooltips móviles */
@media (max-width: 768px) {
    [data-tooltip] {
        position: relative;
    }
    
    [data-tooltip]:hover::after {
        display: none !important; /* Ocultar tooltips en móvil */
    }
}

/* Print styles básicos */
@media print {
    .nav-toggle,
    .whatsapp-float,
    .social-networks-section,
    .instagram-feed-section {
        display: none !important;
    }
    
    body {
        font-size: 12pt !important;
        color: black !important;
        background: white !important;
    }
}

/* ===================================
   FIX: SCROLL HORIZONTAL - SOBRE MI
   =================================== */

@media (max-width: 768px) {
    body, html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    .about-hero {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    .hero-image-section,
    .hero-text-section {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .hero-main-image {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .hero-stats {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    * {
        max-width: 100vw !important;
    }
}
