/* Ocultar elementos móviles por defecto (desktop) */
.mobile-sidebar, 
.sidebar-overlay, 
.mobile-menu-toggle, 
.mobile-map-btn {
    display: none !important;
}

@media (max-width: 768px) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.9);
        --shadow-premium: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }

    body {
        padding-bottom: 0; /* Sin padding ahora que no hay nav inferior */
    }

    /* 1. Header con Botón de Mapa */
    .navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        backdrop-filter: blur(15px);
        background: var(--glass-bg);
        padding: 10px 16px;
        flex-direction: row;
        justify-content: space-between;
        border-radius: 0 0 20px 20px;
        box-shadow: var(--shadow-premium);
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .logo {
        gap: 6px;
    }

    .logo span {
        font-size: 0.9rem;
        font-weight: 700;
    }

    .logo img {
        height: 28px !important;
    }

    .mobile-map-btn {
        display: flex !important; /* Mostrar solo en móvil */
        background: var(--light-gray);
        padding: 8px;
        border-radius: 12px;
        color: var(--text-dark);
        transition: all 0.2s ease;
    }

    .mobile-map-btn:active {
        background: var(--fv-uy-celeste);
        color: white;
        transform: scale(0.95);
    }

    .nav-links, .search-bar {
        display: none !important; 
    }

    .login-section {
        margin: 0;
    }

    .login-btn {
        background: rgba(255, 255, 255, 0.10);
        border-radius: 12px;
        padding: 8px;
        box-shadow: none;
        border: none;
        color: #fff;
    }

    /* 2. Hero Fullscreen Mobile */
    .hero--fullscreen {
        height: 100vh;
        min-height: 480px;
        max-height: 640px;
        border-radius: 0;
        margin: 0;
    }

    .hero--fullscreen .hero-bg {
        background-position: 65% center;
    }

    .hero--fullscreen > .container {
        padding: 80px 16px 24px;
    }

    .hero--fullscreen .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .hero--fullscreen .hero-actions .btn-primary {
        padding: 14px 28px;
        font-size: 0.95rem;
        border-radius: 30px;
        box-shadow: 0 4px 15px rgba(0, 51, 153, 0.3);
    }

    /* Navbar hero mobile */
    .navbar--hero .navbar-inner {
        flex-wrap: nowrap;
        gap: 8px;
    }
    .navbar--hero .nav-links {
        display: none;
    }
    .navbar--hero .search-bar {
        display: none !important;
    }
    .navbar--hero .login-section {
        margin-left: auto;
    }
    .navbar--hero .login-btn svg {
        stroke: #fff;
    }
    .navbar--hero .mobile-menu-toggle {
        display: flex !important;
        color: #fff;
    }

    /* Page hero compact mobile */
    .page-hero {
        height: 200px !important;
        min-height: 180px !important;
    }
    .page-hero h1 {
        font-size: 1.8rem !important;
    }
    .page-hero p {
        font-size: 0.9rem !important;
    }

    /* Fix: mobile body padding for navbar */
    .page-dark main {
        padding-top: 80px;
    }

    /* 3. Cards con Scroll Horizontal */
    .section-header {
        padding: 0 16px;
        margin-top: 20px;
        margin-bottom: 12px;
    }

    .section-title {
        font-size: 1.2rem;
        font-weight: 800;
    }

    .tours-grid {
        display: flex;
        overflow-x: auto;
        padding: 5px 16px 20px;
        gap: 12px;
        scroll-snap-type: x mandatory;
    }

    .tour-card {
        flex: 0 0 200px; /* Cards más pequeñas */
        height: 260px !important;
        border-radius: 20px;
    }

    /* 4. Why Choose Us */
    .why-choose-us {
        margin-top: 40px;
        padding: 0 16px;
        gap: 30px;
    }

    .feature-item {
        padding: 16px;
        border-radius: 16px;
    }

    /* 6. VISTA DE MAPA SIMPLIFICADA (EVITAR AMONTONAMIENTO) */
    .map-wrapper {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        padding: 10px 16px !important;
        margin: 0 !important;
        position: relative !important;
    }

    .map-main {
        display: block !important;
        width: 100% !important;
        height: 350px !important; /* Altura fija para asegurar que se vea */
        margin-bottom: 20px !important;
        position: relative !important;
        border-radius: 15px;
        overflow: hidden;
    }

    #map {
        height: 100% !important;
        width: 100% !important;
        border-radius: 15px;
        position: relative;
    }

    .map-sidebar-right {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        position: relative !important;
        margin-bottom: 40px !important;
    }

    .map-sidebar-right .country-filters {
        padding: 5px 0 15px;
        overflow-x: auto;
        white-space: nowrap;
        display: flex !important;
        gap: 10px;
    }

    .map-sidebar-right .places-list {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        height: auto !important;
        overflow-y: visible !important; /* Dejamos que crezca */
        padding-bottom: 40px;
    }

    .place-item {
        display: flex !important;
        flex-direction: column !important;
        border-radius: 16px !important;
        background: #fbfbfb;
        border: 1px solid #f0f0f0 !important;
        padding: 8px !important;
        text-align: center;
    }

    .place-item-img {
        width: 100% !important;
        height: 80px !important;
        border-radius: 12px !important;
        margin-bottom: 6px !important;
        overflow: hidden;
    }
    
    .place-item-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .place-item-info h4 {
        font-size: 0.8rem !important;
        font-weight: 700 !important;
    }

    .place-item-info p, .place-item-info .place-country {
        display: none !important;
    }

    /* Estilos del Menú Desplegable (Hamburguesa) */
    .mobile-menu-toggle {
        display: flex !important;
        background: transparent;
        border: none;
        font-size: 1.8rem;
        color: var(--text-dark);
        cursor: pointer;
        padding: 5px;
    }

    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Oculto por defecto */
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 3000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
        flex-direction: column;
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }

    .mobile-sidebar.open {
        left: 0;
    }

    .sidebar-header {
        padding: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f0f0f0;
    }

    .sidebar-header h3 {
        font-weight: 800;
        font-size: 1.3rem;
    }

    .close-sidebar {
        background: var(--light-gray);
        border: none;
        font-size: 1.5rem;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-nav {
        flex: 1;
        overflow-y: auto;
        padding: 20px 10px;
    }

    .sidebar-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 20px;
        color: var(--text-dark);
        font-weight: 600;
        border-radius: 12px;
        transition: all 0.2s;
        margin-bottom: 4px;
        text-decoration: none;
    }

    .sidebar-link ion-icon {
        font-size: 1.3rem;
        color: var(--text-gray);
    }

    .sidebar-link.active {
        background: #F0F9FF;
        color: var(--fv-uy-celeste);
    }

    .sidebar-link.active ion-icon {
        color: var(--fv-uy-celeste);
    }

    .sidebar-section {
        margin-top: 10px;
    }

    .sidebar-section-title {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 20px;
        color: var(--text-dark);
        font-weight: 700;
        font-size: 1.1rem;
    }

    .sidebar-section-title ion-icon {
        font-size: 1.3rem;
        color: var(--fv-uy-celeste);
    }

    .sidebar-links-list {
        display: block;
        padding-left: 10px;
    }

    .sidebar-sublink {
        display: block;
        padding: 10px 20px 10px 52px;
        font-size: 0.95rem;
        color: var(--text-gray);
        text-decoration: none;
        transition: color 0.2s;
        border-left: 2px solid transparent;
    }

    .sidebar-sublink:active {
        color: var(--fv-uy-celeste);
        background: #fdfdfd;
        border-left-color: var(--fv-uy-celeste);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(4px);
        z-index: 2999;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.open {
        display: block !important;
        opacity: 1;
    }

    .divider {
        height: 1px;
        background: #eee;
        margin: 8px 20px;
    }

    /* Ajustes existentes */
    .mobile-nav {
        display: none !important;
    }
}

/* ==========================================
   3D FALLBACKS — Disable on mobile
   ========================================== */
@media (max-width: 768px) {
    .hero-3d-canvas,
    .globe-mini-canvas {
        display: none !important;
    }

    .hero--3d.fv-3d-active .hero-image-col--fallback {
        display: block !important;
    }

    .tour-card[data-tilt] {
        transform: none !important;
    }

    .section-header-with-globe {
        gap: 0;
    }

    .globe-mini-canvas {
        display: none !important;
    }

    .choose-img-wrapper--parallax .choose-img {
        transform: none !important;
    }
}
