/* ================================================
   OlaLingo Campus - Responsive & Mobile Optimization
   Master file for all responsive fixes
   ================================================ */

/* ================================================
   GLOBAL MOBILE OPTIMIZATIONS
   ================================================ */

/* Improve touch targets and prevent zoom on input focus */
@media (max-width: 768px) {
    input, select, textarea, button {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
}

/* Smooth scrolling and overscroll behavior */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    overscroll-behavior-y: none;
}

/* Safe area insets for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
    .navbar {
        padding-top: env(safe-area-inset-top);
    }
    
    .footer-olalingo {
        padding-bottom: calc(30px + env(safe-area-inset-bottom));
    }
}

/* ================================================
   NAVIGATION - MOBILE FIXES
   ================================================ */

@media (max-width: 768px) {
    .navbar {
        position: fixed;
        width: 100%;
        z-index: 10001; /* FIXED: Higher than popups to ensure menu works */
    }

    .nav-container {
        height: 64px;
        padding: 0 16px;
    }

    .logo-img-full {
        height: 28px;
    }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-white);
        flex-direction: column;
        padding: 24px;
        gap: 8px;
        overflow-y: auto;
        z-index: 10002; /* FIXED: Higher than navbar to appear above */
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        display: block;
        padding: 16px 20px;
        font-size: 1.0625rem;
        border-radius: 12px;
        transition: background 0.2s ease;
    }

    .nav-link:hover,
    .nav-link.active {
        background: var(--color-gray-100);
    }

    .nav-link.active::after {
        display: none;
    }

    .nav-toggle {
        display: flex;
        padding: 10px;
        margin-right: -10px;
        z-index: 10003; /* FIXED: Highest to always be clickable */
        position: relative;
        cursor: pointer;
    }

    .nav-actions {
        gap: 8px;
    }

    .lang-btn {
        padding: 8px 12px;
        font-size: 0.8125rem;
    }

    .lang-dropdown {
        right: -10px;
        min-width: 140px;
        z-index: 10004; /* FIXED: Above nav-toggle */
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .nav-container {
        padding: 0 12px;
    }
    
    .logo-img-full {
        height: 24px;
    }
    
    .lang-code {
        display: none;
    }
}

/* ================================================
   HERO SECTION - MOBILE FIXES
   ================================================ */

@media (max-width: 968px) {
    .hero {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: 40px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        padding: 32px 0;
        gap: 32px;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-badge {
        margin-bottom: 16px;
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
        margin-bottom: 16px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin: 0 auto 24px;
        padding: 0 8px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        padding: 0 20px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-scroll {
        display: none;
    }
}

/* ================================================
   REGISTER PAGE - MOBILE FIXES
   ================================================ */

@media (max-width: 968px) {
    .register-main {
        padding-top: 64px;
    }
    
    .register-container {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 24px;
    }
    
    .register-form-section {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .form-header {
        margin-bottom: 24px;
    }
    
    .gift-badge-large {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
    }
    
    .gift-badge-large .badge-icon {
        font-size: 2rem;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .form-subtitle {
        font-size: 0.9375rem;
    }
    
    .registration-form {
        gap: 16px;
    }
    
    .form-input {
        padding: 14px 16px;
    }
    
    /* Gift selection cards - stack vertically */
    .gift-options {
        gap: 12px;
    }
    
    .gift-card-content {
        padding: 16px;
        gap: 12px;
    }
    
    .gift-card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
    
    .gift-card-title {
        font-size: 1rem;
    }
    
    .gift-card-desc {
        font-size: 0.8125rem;
    }
    
    /* Success message */
    .success-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .success-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Hide sidebar on mobile */
    .register-activities-section {
        display: none;
    }
}

/* Small phones */
@media (max-width: 375px) {
    .register-form-section {
        padding: 20px 16px;
    }
    
    .form-title {
        font-size: 1.375rem;
    }
    
    .gift-card-content {
        flex-wrap: wrap;
    }
    
    .gift-card-details {
        flex: 1 1 100%;
        order: 3;
        margin-top: 8px;
    }
}

/* ================================================
   INTERCAMBIOS PAGE - MOBILE FIXES
   ================================================ */

@media (max-width: 768px) {
    /* Main container - CRITICAL: Match navbar height */
    .intercambios-main {
        padding-top: 64px !important;
    }

    /* Hero section - prevent overflow issues */
    .intercambios-hero {
        padding: 32px 0 40px;
        overflow: hidden !important; /* FIXED: Changed to hidden to prevent overlap with fixed navbar */
        z-index: 0; /* FIXED: Ensure hero stays below navbar (z-index: 10001) */
    }

    .intercambios-hero .container {
        padding: 0 16px;
    }

    .intercambios-hero .hero-content {
        max-width: 100%;
    }

    .hero-tag {
        padding: 6px 16px;
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .intercambios-hero .hero-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
        margin-bottom: 12px;
    }

    .intercambios-hero .hero-subtitle {
        font-size: 0.9375rem;
        padding: 0 8px;
        margin-bottom: 24px;
    }

    .hero-stats {
        gap: 20px;
        padding: 0 8px;
    }

    .stat-item {
        min-width: 80px;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Map section */
    .map-section {
        padding: 40px 0;
    }

    .map-section .container {
        padding: 0 16px;
    }

    .interactive-map {
        height: 250px;
        border-radius: 12px;
    }

    .neighborhood-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 12px;
        margin: 16px -16px 0;
        padding-left: 16px;
        padding-right: 16px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .neighborhood-pills::-webkit-scrollbar {
        display: none;
    }

    .neighborhood-pill {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    /* Intercambios grid */
    .intercambios-list {
        padding: 40px 0;
    }

    .intercambios-list .container {
        padding: 0 16px;
    }

    .intercambios-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .intercambio-card {
        padding: 20px;
        border-radius: 16px;
    }

    .intercambio-badge {
        top: 12px;
        right: 12px;
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .intercambio-header {
        margin-bottom: 12px;
    }

    .intercambio-day .day-name {
        font-size: 0.75rem;
    }

    .intercambio-day .day-time {
        font-size: 1.125rem;
    }

    .intercambio-emoji {
        font-size: 2rem;
    }

    .intercambio-title {
        font-size: 1.25rem;
    }

    .intercambio-desc {
        font-size: 0.875rem;
        margin-bottom: 12px;
    }

    .intercambio-details {
        gap: 8px;
        margin-bottom: 12px;
    }

    .detail-item {
        font-size: 0.8125rem;
    }

    .intercambio-promo {
        padding: 10px 14px;
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .intercambio-actions {
        flex-direction: column;
        gap: 12px;
        padding-top: 12px;
    }

    .intercambio-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .intercambio-actions .btn-link {
        justify-content: center;
        padding: 10px;
        background: var(--color-gray-100, #f3f4f6);
        border-radius: 8px;
        width: 100%;
    }

    /* CTA Section */
    .intercambios-cta {
        padding: 32px 0;
    }

    .intercambios-cta .container {
        padding: 0 16px;
    }

    .intercambios-cta .cta-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .intercambios-cta .cta-card h2 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .intercambios-cta .cta-card p {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .cta-buttons .btn {
        width: 100%;
    }
}

/* ================================================
   ACTIVITIES PAGE - MOBILE FIXES
   ================================================ */

@media (max-width: 768px) {
    .activities {
        padding: 40px 0;
    }
    
    .activities-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .activity-card {
        border-radius: 12px;
    }
    
    .activity-image {
        height: 150px;
    }
    
    .activity-emoji {
        font-size: 3rem;
    }
    
    .activity-content {
        padding: 16px;
    }
    
    .activity-title {
        font-size: 1rem;
    }
    
    .activity-desc {
        font-size: 0.875rem;
    }
}

/* ================================================
   CONTACT SECTION - MOBILE FIXES
   ================================================ */

@media (max-width: 768px) {
    .contact-section {
        padding: 40px 0;
    }
    
    .contact-section .container {
        padding: 0 16px;
    }
    
    .contact-section-title {
        font-size: 1.5rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .contact-info-card,
    .contact-form-card {
        padding: 24px 20px;
        border-radius: 12px;
    }
    
    .contact-info-title,
    .contact-form-title {
        font-size: 1.125rem;
        margin-bottom: 20px;
    }
    
    .contact-info-item {
        margin-bottom: 16px;
    }
    
    .contact-info-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .contact-form .form-group {
        margin-bottom: 14px;
    }
    
    .contact-form input,
    .contact-form select,
    .contact-form textarea {
        padding: 14px 16px;
    }
    
    .contact-form textarea {
        min-height: 100px;
    }
    
    .contact-form .btn-submit {
        padding: 16px 24px;
    }
    
    .contact-social {
        justify-content: center;
        flex-wrap: wrap;
    }
}

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

@media (max-width: 768px) {
    .footer-olalingo {
        padding: 40px 0 24px;
    }
    
    .footer-olalingo .container {
        padding: 0 16px;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    
    .footer-brand-section {
        max-width: 100%;
    }
    
    .footer-logo-img {
        height: 32px;
    }
    
    .footer-tagline {
        font-size: 0.875rem;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-column h4 {
        margin-bottom: 16px;
    }
    
    .footer-column ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 16px;
    }
    
    .footer-column ul li {
        margin: 0;
    }
    
    .footer-contact-info {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-contact-info p {
        margin: 0;
    }
    
    .footer-bottom-bar {
        flex-direction: column;
        gap: 12px;
        padding-top: 24px;
        text-align: center;
    }
    
    .footer-copyright {
        font-size: 0.8125rem;
    }
    
    .footer-legal {
        font-size: 0.75rem;
    }
}

/* ================================================
   FEATURES & SECTIONS - MOBILE FIXES
   ================================================ */

@media (max-width: 768px) {
    section {
        padding: 40px 0;
    }
    
    .section-header {
        margin-bottom: 24px;
        padding: 0 8px;
    }
    
    .section-tag {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }
    
    .section-title {
        font-size: clamp(1.375rem, 5vw, 1.75rem);
        margin-bottom: 8px;
    }
    
    .section-subtitle {
        font-size: 0.9375rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .feature-card {
        padding: 24px 20px;
        border-radius: 12px;
    }
    
    .feature-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    .feature-title {
        font-size: 1.125rem;
    }
    
    .feature-desc {
        font-size: 0.875rem;
    }
    
    /* Courses section */
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .course-type-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .course-type-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    .course-type-title {
        font-size: 1.25rem;
    }
    
    .course-type-desc {
        font-size: 0.875rem;
    }
    
    /* CTA section */
    .cta-card {
        padding: 32px 24px;
        border-radius: 16px;
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
    
    .cta-title {
        font-size: 1.375rem;
    }
    
    .cta-text {
        font-size: 0.9375rem;
    }
    
    .cta-card .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ================================================
   MODALS & POPUPS - MOBILE FIXES
   ================================================ */

/* Base modal styles for mobile */
@media (max-width: 768px) {
    .modal {
        padding: 0;
    }

    .modal-backdrop {
        padding: 0;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-header {
        padding: 16px 20px;
        flex-shrink: 0;
    }

    .modal-header .modal-title {
        font-size: 1.125rem;
    }

    .modal-emoji {
        font-size: 2rem;
    }

    .modal-body {
        flex: 1;
        padding: 16px 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        padding: 16px 20px;
        flex-shrink: 0;
        background: var(--color-white);
        border-top: 1px solid var(--color-gray-200);
    }

    .modal-close {
        width: 36px;
        height: 36px;
        top: 14px;
        right: 14px;
    }

    /* Form rows in modals */
    .modal .form-row,
    .modal-body .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .modal .form-group {
        margin-bottom: 14px;
    }

    .modal .form-input,
    .modal input,
    .modal select,
    .modal textarea {
        padding: 14px 16px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    /* Submit buttons in modals */
    .modal .btn-submit,
    .modal .btn-primary {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
    }

    /* Contact popup specific */
    .contact-popup-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .contact-popup {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        bottom: 0;
        right: 0;
        left: 0;
    }

    .contact-popup-header {
        padding: 20px;
    }

    .contact-popup-body {
        padding: 20px;
        max-height: calc(85vh - 160px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Intercambio registration modal specific */
    #intercambioModal .modal-content {
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }

    #intercambioModal .modal-header-form {
        padding: 16px 20px;
    }

    #intercambioModal .modal-info {
        padding: 12px;
        margin-bottom: 16px;
    }

    #intercambioModal .modal-subtitle {
        font-size: 0.8125rem;
    }

    /* Success view in modal */
    .modal-success-body {
        padding: 32px 20px;
        text-align: center;
    }

    .modal-success-body .success-icon {
        font-size: 3.5rem;
        margin-bottom: 16px;
    }

    .modal-success-body .success-title {
        font-size: 1.25rem;
    }

    .modal-success-body .success-actions {
        flex-direction: column;
        gap: 12px;
    }

    .modal-success-body .success-actions .btn {
        width: 100%;
    }
}

/* Very small screens - further adjustments */
@media (max-width: 375px) {
    .modal-header {
        padding: 14px 16px;
    }

    .modal-body {
        padding: 14px 16px;
    }

    .modal-footer {
        padding: 14px 16px;
    }

    .modal .form-group label {
        font-size: 0.8125rem;
    }

    .contact-popup-emoji {
        font-size: 2.5rem;
    }

    .contact-popup-title {
        font-size: 1.125rem;
    }
}

/* ================================================
   BUTTONS - MOBILE OPTIMIZATIONS
   ================================================ */

@media (max-width: 768px) {
    .btn {
        padding: 14px 24px;
        font-size: 0.9375rem;
        border-radius: 10px;
    }
    
    .btn-lg {
        padding: 16px 28px;
        font-size: 1rem;
    }
    
    .btn-sm {
        padding: 10px 18px;
        font-size: 0.8125rem;
    }
    
    /* Ensure buttons are easy to tap */
    button, .btn, a.btn {
        min-height: 44px;
    }
}

/* ================================================
   REVIEWS SECTION - MOBILE FIXES
   ================================================ */

@media (max-width: 768px) {
    .reviews-section {
        padding: 40px 0;
    }
    
    .reviews-carousel,
    #google-reviews {
        gap: 16px;
    }
    
    .review-card {
        padding: 20px;
        border-radius: 12px;
    }
    
    .review-header {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .reviewer-avatar {
        width: 40px;
        height: 40px;
    }
    
    .reviewer-name {
        font-size: 0.9375rem;
    }
    
    .review-text {
        font-size: 0.875rem;
        line-height: 1.5;
    }
}

/* ================================================
   PHONE PREFIX INPUT - MOBILE FIXES  
   ================================================ */

@media (max-width: 480px) {
    .phone-prefix-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .phone-prefix-select {
        width: 100%;
    }
    
    .phone-number-input {
        width: 100%;
    }
}

/* ================================================
   CALENDAR/DATE PICKERS - MOBILE FIXES
   ================================================ */

@media (max-width: 768px) {
    .calendar-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .calendar-grid {
        min-width: 280px;
    }
    
    .calendar-day {
        min-width: 40px;
        min-height: 40px;
        font-size: 0.875rem;
    }
}

/* ================================================
   UTILITY CLASSES FOR MOBILE
   ================================================ */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .text-center-mobile {
        text-align: center !important;
    }
    
    .full-width-mobile {
        width: 100% !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
    
    .show-desktop {
        display: block !important;
    }
}

/* ================================================
   PERFORMANCE OPTIMIZATIONS
   ================================================ */

/* Reduce animations on mobile for performance */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
    .hero-shape {
        animation: none;
    }
    
    .gift-icon {
        animation: none;
    }
    
    .scroll-indicator::before {
        animation: none;
    }
    
    .pulse-dot {
        animation: none;
    }
}

/* Honor reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================
   LANDSCAPE MOBILE FIXES
   ================================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 0 40px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-body {
        max-height: 50vh;
    }
}

/* ================================================
   HIGH DPI / RETINA OPTIMIZATIONS
   ================================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img-full,
    .footer-logo-img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ================================================
   DARK MODE SUPPORT (Future-proofing)
   ================================================ */

@media (prefers-color-scheme: dark) {
    /* Ready for dark mode implementation */
}

/* ================================================
   PRINT STYLES
   ================================================ */

@media print {
    .navbar,
    .nav-toggle,
    .lang-switcher,
    .footer-social,
    .btn,
    .modal-overlay,
    .contact-popup-overlay {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* ================================================
   CRITICAL FIXES - Z-INDEX & POPUP OVERLAYS
   Added to ensure mobile navigation always works
   ================================================ */

/* Ensure popups never block navbar interactions */
.welcome-popup,
.contact-popup-overlay,
.contact-popup,
.contact-fab {
    z-index: 9950 !important; /* Force lower than navbar */
}

/* But allow them to show properly when active */
.welcome-popup.active {
    z-index: 10050 !important; /* Above navbar when active */
}

.contact-popup-overlay.show {
    z-index: 10050 !important; /* Above navbar when shown */
}

.contact-popup.show {
    z-index: 10051 !important; /* Above overlay when shown */
}

/* Mobile-specific navigation fixes */
@media (max-width: 768px) {
    /* Force navbar and toggle to be clickable */
    .navbar {
        z-index: 10001 !important;
        position: fixed !important;
        width: 100% !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }

    .nav-container {
        position: relative;
        z-index: 10001;
    }

    .nav-actions {
        position: relative;
        z-index: 10003;
    }

    .nav-toggle {
        display: flex !important;
        z-index: 10003 !important;
        position: relative !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer !important;
        background: transparent;
        border: none;
        padding: 10px;
    }

    .nav-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--color-gray-700, #333);
        border-radius: 1px;
        transition: all 0.3s ease;
        pointer-events: none;
    }

    .nav-menu {
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: var(--color-white, #fff) !important;
        flex-direction: column !important;
        padding: 24px !important;
        gap: 8px !important;
        overflow-y: auto !important;
        z-index: 10002 !important;
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 10002 !important;
    }

    /* Ensure hidden popups never block anything */
    .welcome-popup:not(.active),
    .contact-popup-overlay:not(.show),
    .contact-popup:not(.show) {
        pointer-events: none !important;
    }

    /* Make sure contact FAB doesn't interfere with nav */
    .contact-fab {
        z-index: 9950 !important;
    }

    /* Ensure lang dropdown works */
    .lang-switcher {
        position: relative;
        z-index: 10003;
    }

    .lang-dropdown {
        z-index: 10004 !important;
    }

    .lang-dropdown.active {
        z-index: 10005 !important;
    }
}

/* ================================================

/* Ensure cards can grow to fit content */

@media (min-width: 768px) {
}

@media (min-width: 768px) {
}

/* Ensure descriptions don't get truncated */

/* Ensure details section doesn't get cut off */

/* ================================================
   INTERCAMBIO CARD GRID - ADAPTIVE HEIGHT
   ================================================ */

.intercambios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-xl, 2rem);
    align-items: start; /* CRITICAL: Prevent stretching */
}

.intercambio-card {
    height: auto !important;
    min-height: fit-content !important;
}

/* Ensure card content is not truncated */
.intercambio-desc {
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
}

.intercambio-details {
    overflow: visible !important;
}

/* ================================================
   INTERCAMBIOS PAGE - COMPREHENSIVE MOBILE FIX
   Added: 2025-11-30
   This section overrides ALL intercambios.css mobile styles
   with higher specificity to ensure consistent behavior
   ================================================ */

@media screen and (max-width: 768px) {
    /* ===== CRITICAL: NAVBAR ALWAYS VISIBLE ===== */
    body.intercambios-page .navbar,
    .intercambios-page .navbar.navbar-light {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 10001 !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }

    /* ===== MAIN CONTENT: Proper spacing below fixed navbar ===== */
    body.intercambios-page .intercambios-main {
        padding-top: 64px !important;
        overflow-x: hidden !important;
    }

    /* ===== HERO SECTION: Prevent overlap with navbar ===== */
    body.intercambios-page .intercambios-hero {
        padding: 24px 0 32px !important;
        overflow: hidden !important;
        position: relative !important;
        z-index: 0 !important;
    }

    body.intercambios-page .intercambios-hero .container {
        padding: 0 16px !important;
    }

    body.intercambios-page .intercambios-hero .hero-content {
        max-width: 100% !important;
        padding: 0 !important;
    }

    body.intercambios-page .hero-tag {
        padding: 6px 14px !important;
        font-size: 0.7rem !important;
        margin-bottom: 12px !important;
    }

    body.intercambios-page .intercambios-hero .hero-title {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
        margin-bottom: 12px !important;
        line-height: 1.2 !important;
    }

    body.intercambios-page .intercambios-hero .hero-subtitle {
        font-size: 0.875rem !important;
        padding: 0 8px !important;
        margin-bottom: 20px !important;
        line-height: 1.5 !important;
    }

    body.intercambios-page .hero-stats {
        display: flex !important;
        justify-content: center !important;
        gap: 16px !important;
        flex-wrap: wrap !important;
        padding: 0 8px !important;
    }

    body.intercambios-page .stat-item {
        min-width: 70px !important;
        text-align: center !important;
    }

    body.intercambios-page .stat-number {
        font-size: 1.5rem !important;
        margin-bottom: 4px !important;
    }

    body.intercambios-page .stat-label {
        font-size: 0.65rem !important;
    }

    /* ===== MAP SECTION ===== */
    body.intercambios-page .map-section {
        padding: 32px 0 !important;
    }

    body.intercambios-page .map-section .container {
        padding: 0 16px !important;
    }

    body.intercambios-page .interactive-map {
        height: 220px !important;
        border-radius: 12px !important;
    }

    body.intercambios-page .neighborhood-pills {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        padding: 12px 0 !important;
        margin: 16px -16px 0 !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        gap: 8px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    body.intercambios-page .neighborhood-pills::-webkit-scrollbar {
        display: none !important;
    }

    body.intercambios-page .neighborhood-pill {
        flex-shrink: 0 !important;
        padding: 8px 14px !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
    }

    /* ===== INTERCAMBIOS GRID ===== */
    body.intercambios-page .intercambios-list {
        padding: 32px 0 !important;
    }

    body.intercambios-page .intercambios-list .container {
        padding: 0 16px !important;
    }

    body.intercambios-page .intercambios-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    body.intercambios-page .intercambio-card {
        padding: 16px !important;
        border-radius: 14px !important;
        height: auto !important;
        min-height: fit-content !important;
    }

    body.intercambios-page .intercambio-badge {
        top: 10px !important;
        right: 10px !important;
        padding: 4px 8px !important;
        font-size: 0.65rem !important;
    }

    body.intercambios-page .intercambio-header {
        margin-bottom: 10px !important;
    }

    body.intercambios-page .intercambio-day .day-name {
        font-size: 0.7rem !important;
    }

    body.intercambios-page .intercambio-day .day-time {
        font-size: 1rem !important;
    }

    body.intercambios-page .intercambio-emoji {
        font-size: 1.75rem !important;
    }

    body.intercambios-page .intercambio-title {
        font-size: 1.1rem !important;
        margin-bottom: 6px !important;
    }

    body.intercambios-page .intercambio-desc {
        font-size: 0.8rem !important;
        margin-bottom: 10px !important;
        line-height: 1.4 !important;
    }

    body.intercambios-page .intercambio-details {
        gap: 6px !important;
        margin-bottom: 10px !important;
    }

    body.intercambios-page .detail-item {
        font-size: 0.75rem !important;
    }

    body.intercambios-page .intercambio-promo {
        padding: 8px 12px !important;
        font-size: 0.7rem !important;
        margin-bottom: 10px !important;
    }

    body.intercambios-page .intercambio-actions {
        flex-direction: column !important;
        gap: 10px !important;
        padding-top: 12px !important;
    }

    body.intercambios-page .intercambio-actions .btn,
    body.intercambios-page .intercambio-actions .btn-primary,
    body.intercambios-page .intercambio-actions .btn-sm {
        width: 100% !important;
        justify-content: center !important;
        padding: 10px 16px !important;
        font-size: 0.875rem !important;
    }

    body.intercambios-page .intercambio-actions .btn-link {
        justify-content: center !important;
        padding: 10px !important;
        background: #f3f4f6 !important;
        border-radius: 8px !important;
        width: 100% !important;
    }

    /* ===== REVIEWS SECTION ===== */
    body.intercambios-page .reviews-section {
        padding: 32px 0 !important;
    }

    body.intercambios-page .reviews-section .container {
        padding: 0 16px !important;
    }

    body.intercambios-page .reviews-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        padding-bottom: 12px !important;
        margin: 0 -16px 20px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        gap: 8px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    body.intercambios-page .reviews-tabs::-webkit-scrollbar {
        display: none !important;
    }

    body.intercambios-page .review-tab {
        flex-shrink: 0 !important;
        padding: 8px 14px !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
    }

    body.intercambios-page .reviews-carousel {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    body.intercambios-page .review-card {
        padding: 16px !important;
        border-radius: 12px !important;
    }

    body.intercambios-page .review-header {
        gap: 10px !important;
        margin-bottom: 10px !important;
    }

    body.intercambios-page .reviewer-avatar {
        width: 36px !important;
        height: 36px !important;
    }

    body.intercambios-page .reviewer-name {
        font-size: 0.875rem !important;
    }

    body.intercambios-page .reviewer-date {
        font-size: 0.7rem !important;
    }

    body.intercambios-page .review-text {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
    }

    body.intercambios-page .reviews-cta {
        margin-top: 20px !important;
    }

    body.intercambios-page .reviews-cta .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* ===== CTA SECTION ===== */
    body.intercambios-page .intercambios-cta {
        padding: 24px 0 !important;
    }

    body.intercambios-page .intercambios-cta .container {
        padding: 0 16px !important;
    }

    body.intercambios-page .intercambios-cta .cta-card {
        padding: 20px 16px !important;
        border-radius: 14px !important;
        text-align: center !important;
    }

    body.intercambios-page .intercambios-cta .cta-card h2 {
        font-size: 1.25rem !important;
        margin-bottom: 8px !important;
    }

    body.intercambios-page .intercambios-cta .cta-card p {
        font-size: 0.875rem !important;
        margin-bottom: 16px !important;
    }

    body.intercambios-page .cta-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    body.intercambios-page .cta-buttons .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 12px 20px !important;
    }

    /* ===== SECTION HEADERS ===== */
    body.intercambios-page .section-header {
        margin-bottom: 20px !important;
        padding: 0 8px !important;
        text-align: center !important;
    }

    body.intercambios-page .section-tag {
        font-size: 0.7rem !important;
        margin-bottom: 6px !important;
    }

    body.intercambios-page .section-title {
        font-size: 1.25rem !important;
        margin-bottom: 6px !important;
    }

    body.intercambios-page .section-subtitle {
        font-size: 0.85rem !important;
    }

    /* ===== FOOTER ===== */
    body.intercambios-page .footer-olalingo {
        padding: 32px 0 20px !important;
    }

    body.intercambios-page .footer-olalingo .container {
        padding: 0 16px !important;
    }

    body.intercambios-page .footer-main {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        text-align: center !important;
    }

    body.intercambios-page .footer-brand-section {
        max-width: 100% !important;
    }

    body.intercambios-page .footer-social {
        justify-content: center !important;
    }

    body.intercambios-page .footer-column ul {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px 16px !important;
    }

    body.intercambios-page .footer-bottom-bar {
        flex-direction: column !important;
        gap: 10px !important;
        padding-top: 20px !important;
        text-align: center !important;
    }

    /* ===== MODAL FIXES ===== */
    body.intercambios-page .modal {
        padding: 0 !important;
    }

    body.intercambios-page .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    body.intercambios-page .modal-header {
        padding: 16px !important;
    }

    body.intercambios-page .modal-body {
        padding: 16px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.intercambios-page .register-form .form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    body.intercambios-page .register-form input,
    body.intercambios-page .register-form select,
    body.intercambios-page .register-form textarea {
        padding: 12px 14px !important;
        font-size: 16px !important; /* Prevents iOS zoom */
    }

    body.intercambios-page .register-form .btn-primary,
    body.intercambios-page .register-form .btn-submit {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 1rem !important;
    }
}

/* ===== VERY SMALL SCREENS (360px and below) ===== */
@media screen and (max-width: 360px) {
    body.intercambios-page .intercambios-hero .hero-title {
        font-size: 1.25rem !important;
    }

    body.intercambios-page .stat-item {
        min-width: 60px !important;
    }

    body.intercambios-page .stat-number {
        font-size: 1.25rem !important;
    }

    body.intercambios-page .stat-label {
        font-size: 0.6rem !important;
    }

    body.intercambios-page .intercambio-title {
        font-size: 1rem !important;
    }

    body.intercambios-page .section-title {
        font-size: 1.1rem !important;
    }
}

/* ================================================
   HAMBURGER MENU - UNIVERSAL FIX
   Added: 2025-11-30
   Fixes hamburger truncation on scroll for ALL pages
   and ensures it works on intercambios page
   ================================================ */

@media screen and (max-width: 768px) {
    /* ===== NAVBAR: Ensure no overflow clipping ===== */
    .navbar,
    .navbar.scrolled,
    .navbar.navbar-light,
    .navbar.navbar-light.scrolled,
    body.intercambios-page .navbar,
    body.intercambios-page .navbar.navbar-light {
        overflow: visible !important;
        height: auto !important;
        min-height: 64px !important;
    }

    /* ===== NAV-CONTAINER: Explicit height, no clipping ===== */
    .nav-container {
        height: 64px !important;
        min-height: 64px !important;
        overflow: visible !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    /* ===== NAV-ACTIONS: Ensure children are not clipped ===== */
    .nav-actions {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        overflow: visible !important;
        position: relative !important;
        z-index: 10003 !important;
        height: auto !important;
    }

    /* ===== NAV-TOGGLE (HAMBURGER): Always visible and clickable ===== */
    .nav-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 5px !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 10px !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 10003 !important;
        overflow: visible !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
        box-sizing: border-box !important;
    }

    /* ===== NAV-TOGGLE SPANS (the 3 lines) ===== */
    .nav-toggle span {
        display: block !important;
        width: 24px !important;
        height: 2px !important;
        background-color: #333 !important;
        border-radius: 2px !important;
        transition: all 0.3s ease !important;
        pointer-events: none !important;
        flex-shrink: 0 !important;
    }

    /* ===== NAV-TOGGLE ACTIVE STATE (X icon) ===== */
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px) !important;
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0 !important;
        transform: translateX(-10px) !important;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px) !important;
    }

    /* ===== NAV-MENU: Full screen mobile menu ===== */
    .nav-menu {
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: calc(100vh - 64px) !important;
        background: #fff !important;
        flex-direction: column !important;
        padding: 24px !important;
        gap: 8px !important;
        overflow-y: auto !important;
        z-index: 10002 !important;
        transform: translateX(-100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease !important;
    }

    .nav-menu.active {
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* ===== INTERCAMBIOS PAGE SPECIFIC: Ensure hamburger works ===== */
    body.intercambios-page .nav-toggle {
        display: flex !important;
        pointer-events: auto !important;
        z-index: 10003 !important;
    }

    body.intercambios-page .nav-menu {
        z-index: 10002 !important;
    }

    body.intercambios-page .nav-menu.active {
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* ===== ENSURE NOTHING OVERLAYS THE HAMBURGER ===== */
    .hero,
    .hero-content,
    .hero-bg,
    .intercambios-hero,
    .intercambios-hero .hero-content,
    .hero-bg-pattern,
    section {
        pointer-events: none;
    }

    .hero *,
    .hero-content *,
    .intercambios-hero *,
    section * {
        pointer-events: auto;
    }

    /* But navbar and its children should always receive pointer events */
    .navbar,
    .navbar *,
    .nav-container,
    .nav-container *,
    .nav-actions,
    .nav-actions *,
    .nav-toggle,
    .nav-toggle * {
        pointer-events: auto !important;
    }
}

/* ===== LANG SWITCHER FIX ===== */
@media screen and (max-width: 768px) {
    .lang-switcher {
        position: relative !important;
        z-index: 10003 !important;
        overflow: visible !important;
    }

    .lang-btn {
        padding: 8px 12px !important;
        font-size: 0.8125rem !important;
        pointer-events: auto !important;
    }

    .lang-dropdown {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        z-index: 10005 !important;
        min-width: 140px !important;
    }

    .lang-dropdown.active {
        z-index: 10005 !important;
    }
}

/* ================================================

@media screen and (max-width: 768px) {
    /* ===== SECTION CONTAINER ===== */

    /* ===== CARDS CONTAINER ===== */

    /* ===== CARD INNER LAYOUT ===== */

    /* ===== CARD MAIN CONTENT ===== */

    /* ===== TIME BADGES ===== */

    /* ===== TITLE SECTION ===== */

    /* ===== DESCRIPTION ===== */

    /* ===== DETAILS GRID ===== */

    /* ===== CTA SECTION ===== */

    /* ===== PLACEHOLDER ===== */
}

/* ===== VERY SMALL SCREENS ===== */
@media screen and (max-width: 360px) {

}

/* ================================================
   High specificity to override ALL conflicting styles
   ================================================ */

/* Force all parent containers to allow content */
@media screen and (max-width: 768px) {
    html body .intercambios-main,
    html body.intercambios-page .intercambios-main {
        overflow-x: visible !important;
        overflow-y: visible !important;
        overflow: visible !important;
    }

}

/* Very small screens */
@media screen and (max-width: 380px) {

}
