/* mobile.css - FINAL RESPONSIVE FIXES */

/* ============ TABLET & SMALLER DESKTOP (<= 1024px) ============ */
@media (max-width: 1024px) {
    .nav-container {
        padding: 10px 20px;
        width: 100%;
        max-width: 100%;
        justify-content: space-between;
        gap: 0;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 0;
        right: -80%; /* Start off-screen to the right, adjusted for new width */
        width: 80%; /* Flexible width for the side menu */
        max-width: 300px; /* Keep a max-width to prevent it from getting too wide on tablets */
        height: 100vh; /* Full viewport height */
        background: white;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        flex-direction: column;
        -webkit-box-align: center;
        align-items: center;
        -webkit-box-pack: start;
        justify-content: flex-start; /* Align items to the top */
        gap: 25px;
        transition: right 0.3s ease-in-out; /* Animate the 'right' property */
        z-index: 999;
        padding-top: 100px; /* Add padding to push items down below the main navbar */
    }

    .nav-menu.active {
        display: -webkit-box;
        display: flex;
        right: 0; /* Slide into view */
    }

    .hamburger {
        display: flex;
        z-index: 1000;
    }

    .nav-logo .logo {
        position: static;
        height: 60px; /* Smaller height for tablet/mobile nav */
        transform: scale(1); /* No extra scaling */
        left: 0;
    }

    .nav-menu {
        font-size: 1em; /* Smaller font for menu items */
    }

    /* Adjust grid layouts for tablets */
    .services-grid,
    .module-matrix-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Footer responsive styles for tablets */
    .footer-section, .footer-logo, .footer #nave, .footer #oursol {
        position: static;
        left: 0;
    }

    .footer-content {
        justify-content: center;
        text-align: center;
    }
}

/* ============ MOBILE PHONES (<= 780px) ============ */
@media (max-width: 780px) {
    /* General Section Padding */
    section {
        padding: 60px 15px;
    }

    /* Hero Section */
        .hero,
        section.hero#inicio,
        #inicio.hero {
            display: block !important;
            height: auto !important;
            min-height: 500px !important;
            padding: 120px 15px 60px !important;
            overflow: visible !important;
            position: relative !important;
        }

    .hero-content {
        position: relative;
        z-index: 10;
        padding: 20px;
        border-radius: 10px;
        backdrop-filter: blur(5px);
    }

    .hero-title {
        font-size: 2em !important;
        line-height: 1.2 !important;
        word-wrap: break-word !important;
        margin-bottom: 15px !important;
        color: white !important;
    }

    .hero-slider {
        display: none !important; 
    }

    .hero-description {
        font-size: 1em;
        color: rgba(255, 255, 255, 0.9) !important;
        margin-bottom: 20px !important;
    }

    .hero-tagline {
        font-size: 0.9em !important;
        color: rgba(255, 255, 255, 0.8) !important;
        margin-bottom: 25px !important;
        white-space: normal; 
        overflow: visible; 
        border-right: none; 
        animation: none; 
        width: auto; 
    }

    .hero-buttons {
        flex-direction: column;
        gap: 13px;
        align-items: center;
        margin-top: 50px;
        padding: 20px;
    }

    .hero,
    .hero * {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .services-grid,
    .module-matrix-grid,
    .gallery-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .services, .module-matrix {
        min-height: auto;
        height: auto;
    }

    .contact {
        padding-bottom: 100px; 
        height: auto;
        min-height: auto;
    }
    
    .contact-info {
        max-height: none; 
        overflow: visible;
    }

    .recaptcha-container {
        margin: 10px; 
    }


    #gmail, #outlook, #yahoo, #otro {
        display: none !important; 
    }
    #mail {
        display: inline-flex !important; 
        visibility: visible !important; 
    }
    #mails {
        justify-content: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-section, .footer-logo, .footer #nave, .footer #oursol {
        align-items: center;
        position: static;
        left: 0;
    }
}

/* ============ SMALL MOBILE PHONES (<= 480px) ============ */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6em !important;
    }
    
    .section-title {
        font-size: 1.7em;
    }
}

@media (max-width: 780px) {
    .hero {
        max-width: 100% !important; 
        width: 100%;
        overflow: hidden;
    }

    .hero-background-elements {
        display: none;
    }
}

/* ============ LANGUAGE SELECTOR MOBILE ============ */

/* ============ LANGUAGE SELECTOR MOBILE - FIX COMPLETO ============ */

/* Estilos base para el contenedor */
.mobile-language-selector {
    display: none; /* Oculto por defecto, se muestra en media queries */
    align-items: center;
    z-index: 1001;
}

/* Mostrar en tabletas (1024px o menos) */
@media (max-width: 1024px) {
    .mobile-language-selector {
        display: flex !important; /* Fuerza la visualización */
        visibility: visible !important;
        opacity: 1 !important;
        position: relative;
        width: 100%; /* Ensure it takes full width */
        justify-content: center; /* Center its content */
    }

    /* Asegurar que el contenedor nav tenga espacio */
    .nav-container {
        display: flex;
        align-items: center;
        width: 100%;
        justify-content: space-between;
    }

    /* Estilos específicos para el select */
    #language-selector-mobile {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: 38px;
        padding: 0 12px;
        padding-right: 35px; /* Espacio para la flecha */
        font-size: 15px;
        font-weight: 500;
        background: #f8f9fa;
        border: 1px solid #ddd;
        border-radius: 6px;
        color: #333;
        cursor: pointer;
        min-width: 75px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        /* Flecha personalizada */
        background-image: url('data:image/svg+xml;utf8,<svg fill="%23666" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 16px;
        /* Sombra sutil */
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        transition: all 0.3s ease;
    }

        #language-selector-mobile:hover {
            background-color: #fff;
            border-color: #007bff;
            box-shadow: 0 2px 8px rgba(0,123,255,0.1);
        }

        #language-selector-mobile:focus {
            outline: none;
            border-color: #007bff;
            box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
        }

        /* Opciones del select */
        #language-selector-mobile option {
            font-size: 14px;
            padding: 8px;
            background: white;
        }
}

/* Ajustes para pantallas medianas (800px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .mobile-language-selector {
        margin-right: 25px;
    }

    #language-selector-mobile {
        height: 40px;
        font-size: 16px;
        min-width: 80px;
        padding: 0 15px;
        padding-right: 40px;
    }
}

/* Ajustes para móviles (768px o menos) */
@media (max-width: 768px) {
    .mobile-language-selector {
        margin-right: 15px;
        order: 2; /* Para el orden flex */
    }

    #language-selector-mobile {
        height: 36px;
        font-size: 14px;
        min-width: 70px;
        padding: 0 10px;
        padding-right: 32px;
    }

    /* Asegurar que el hamburguesa tenga espacio */
    .hamburger {
        order: 3;
        margin-left: 0;
    }
}

/* Ajustes para móviles pequeños (480px o menos) */
@media (max-width: 480px) {
    .mobile-language-selector {
        margin-right: 10px;
    }

    #language-selector-mobile {
        height: 34px;
        font-size: 13px;
        min-width: 65px;
        padding: 0 8px;
        padding-right: 30px;
    }
}

/* Para móviles muy pequeños (360px o menos) */
@media (max-width: 360px) {
    .mobile-language-selector {
        margin-right: 8px;
    }

    #language-selector-mobile {
        height: 32px;
        font-size: 12px;
        min-width: 60px;
        padding: 0 6px;
        padding-right: 28px;
        background-size: 14px;
        background-position: right 8px center;
    }
}

/* Ocultar en desktop (1025px o más) */
@media (min-width: 1025px) {
    .mobile-language-selector {
        display: none !important;
    }
}
