/* 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;
    }

    /* Contact Section Specifics */
    .contact-grid {
        gap: 30px; /* Add some space between contact info and form */
        margin-top: 20px;
    }

    .contact-info {
        padding: 0 10px; /* Add horizontal padding for content */
    }

    .contact-info .info-item {
        flex-direction: column; /* Stack icon and content vertically */
        align-items: center; /* Center items */
        text-align: center;
        margin-bottom: 25px; /* More space between items */
    }

    .contact-info .info-item i {
        font-size: 2em; /* Make icons larger */
        margin-bottom: 10px; /* Space between icon and text */
    }

    .contact-info .info-item-content {
        margin-left: 0; /* Remove left margin from desktop styles */
    }

    .contact-info .info-item-content h4 {
        font-size: 1.2em; /* Adjust heading size */
    }

    .contact-info .info-item-content p,
    .contact-info .info-item-content a {
        font-size: 0.9em; /* Adjust text size */
    }

    /* Email provider buttons */
    #mails {
        flex-direction: column; /* Stack email buttons vertically */
        gap: 10px; /* Space between buttons */
        margin-top: 15px;
    }
    #mails .email-provider-btn, #mails .email-quick-btn {
        width: 80%; /* Make buttons wider */
        max-width: 250px; /* Limit max width */
        margin: 0 auto; /* Center buttons */
    }

    /* Contact Form Specifics */
    .contact-form-container {
        padding: 0 10px; /* Add horizontal padding for the form */
    }

    .contact-form .form-group {
        margin-bottom: 20px; /* Consistent spacing for form groups */
    }

    .contact-form input[type="text"],
    .contact-form input[type="email"],
    .contact-form input[type="tel"],
    .contact-form select,
    .contact-form textarea {
        max-width: 100% !important; /* Override Site.css fixed max-width */
        width: 100%; /* Take full width */
        box-sizing: border-box; /* Include padding and border in the element's total width and height */
    }

    .contact-form label {
        font-size: 0.9em; /* Adjust label size */
    }

    .recaptcha-container {
        margin: 20px auto; /* Center recaptcha */
        width: fit-content; /* Adjust width to content */
        transform: scale(0.85); /* Slightly scale down reCAPTCHA for smaller screens */
        -webkit-transform: scale(0.85);
        transform-origin: 0 0; /* Scale from top-left */
        -webkit-transform-origin: 0 0;
    }
    /* Adjust container for scaled recaptcha if needed */
    .recaptcha-container > div { /* Target the inner div created by reCAPTCHA */
        width: 100% !important; /* Ensure it respects its parent's width after scaling */
    }

    .recaptcha-info {
        font-size: 0.75em; /* Smaller text for recaptcha info */
        text-align: center;
        padding-top: 10px;
    }

    .submit-button {
        width: 100%; /* Full width button */
        padding: 12px 0; /* Adjust padding */
        font-size: 1.1em; /* Larger text */
    }

    /* intl-tel-input mobile fixes */
    .form-group-phone .iti {
        width: 100% !important;
        display: block !important;
    }

    .form-group-phone .iti__selected-flag {
        padding: 0 10px 0 12px !important;
        background-color: #f8f9fa !important;
        border-right: 1px solid #e1e5e9 !important;
        border-top-left-radius: 10px !important;
        border-bottom-left-radius: 10px !important;
    }

    .iti__selected-dial-code {
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #333 !important;
        margin-left: 6px !important;
    }

    .iti__country-list {
        width: 280px !important;
        max-height: 200px !important;
        z-index: 100 !important;
    }

    .form-group-phone input#phone {
        padding-left: 95px !important;
    }

    /* Modals for Development and Service Type */
    .modal-dev-content {
        width: 90%; /* Make modal content wider on mobile */
        max-width: 400px; /* Max width to prevent it from being too big on tablets */
        margin: 50px auto; /* Center vertically and horizontally */
        padding: 20px;
    }
    .dev-modules-grid {
        grid-template-columns: 1fr; /* Stack checkboxes vertically in modals */
        gap: 15px;
    }
    .form-group-dev input[type="checkbox"] {
        transform: scale(1.2); /* Slightly larger checkboxes */
        margin-right: 10px;
    }
    .form-group-dev label {
        font-size: 1em;
    }
}

/* ============ 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 ============ */

/* 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;
    }
}
