/* Optimizaciones específicas para dispositivos móviles */

/* Mejoras generales para móviles */
@media (max-width: 767.98px) {

    /* Optimizar el viewport y evitar zoom no deseado */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        scroll-behavior: smooth;
    }

    /* Mejorar el rendimiento general */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* Optimizar el navbar para móviles */
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-brand img {
        max-width: 120px;
        height: auto;
    }

    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 4px;
    }

    .navbar-collapse {
        background: rgba(0, 0, 0, 0.95);
        margin-top: 0.5rem;
        padding: 1rem;
        border-radius: 8px;
        backdrop-filter: blur(10px);
    }

    .navbar-nav .nav-item {
        margin: 0.25rem 0;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 6px;
        font-size: 1rem;
        text-align: center;
        transition: all 0.3s ease;
    }

    .navbar-nav .nav-link:hover {
        background-color: rgba(95, 177, 52, 0.2);
        transform: translateX(5px);
    }

    /* Optimizar el header para móviles */
    .masthead {
        min-height: 100vh;
        padding: 6rem 0 4rem;
        display: flex;
        align-items: center;
    }

    .masthead-heading {
        font-size: 2rem;
        line-height: 1.2;
        padding: 0 1rem;
        margin-bottom: 1.5rem;
    }

    .masthead-subheading {
        font-size: 1.1rem;
        padding: 0 1rem;
        margin-bottom: 2rem;
    }

    /* Optimizar los service highlights */
    .service-highlights {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
        margin-top: 2rem;
    }

    .service-highlight {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
        font-size: 0.9rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        backdrop-filter: blur(5px);
    }

    /* Optimizar las secciones */
    .page-section {
        padding: 3rem 0;
    }

    .full-width-section {
        padding: 2rem 0;
    }

    .elegant-title {
        font-size: 1.8rem;
        padding-left: 1rem;
        margin-bottom: 1rem;
    }

    .elegant-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
        margin-bottom: 2rem;
    }

    /* Optimizar las cards */
    .about-card,
    .service-card,
    .modern-about-card,
    .mission-vision-modern {
        margin-bottom: 2rem;
        padding: 1.5rem;
        border-radius: 15px;
    }

    /* Optimizar el formulario de contacto */
    .contact-container {
        padding: 1.5rem;
        margin: 1rem 0;
    }

    .contact-info-wrapper,
    .form-wrapper {
        padding: 1.5rem;
    }

    .form-floating>.form-control,
    .form-floating>.form-select {
        font-size: 16px;
        /* Evita zoom en iOS */
        height: 55px;
        padding: 1rem 1rem 1rem 3rem;
    }

    .form-floating>textarea.form-control {
        height: 120px;
    }

    .btn-primary {
        width: 100%;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        margin-top: 1rem;
    }

    /* Optimizar la información de contacto */
    .contact-item {
        padding: 1.5rem;
        margin-bottom: 1rem;
        height: auto;
        min-height: 120px;
    }

    .contact-item .icon-container {
        width: 45px;
        height: 45px;
        margin-right: 12px;
    }

    .contact-item .fas {
        font-size: 1.2rem;
    }

    /* Optimizar el mapa */
    .map-placeholder {
        padding: 1.5rem;
        text-align: center;
    }

    .map-placeholder .btn {
        min-width: 50px;
        min-height: 50px;
        font-size: 0.4rem;
    }

    /* Optimizar el footer */
    .footer {
        padding: 2rem 0 1.5rem;
    }

    .footer-brand img {
        max-width: 140px;
    }

    .footer-description {
        font-size: 0.9rem;
        text-align: center;
    }

    .footer-heading {
        margin-top: 1rem;
        font-size: 1.1rem;
    }

    .footer-links {
        text-align: center;
    }

    .footer-bottom-links {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        margin-top: 1rem;
    }

    .copyright-text {
        text-align: center;
        font-size: 0.85rem;
    }

    /* Optimizar el selector de idioma */
    .language-selector {
        margin-left: 0.5rem;
        padding: 4px;
    }

    .language-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
        min-width: 35px;
        min-height: 35px;
    }

    /* Optimizar las imágenes */
    img {
        max-width: 100%;
        height: auto;
    }

    .client-logo {
        max-width: 120px;
        height: auto;
    }

    .partner-logo {
        max-width: 150px;
        height: auto;
    }

    /* Optimizar el popup de cookies */
    .cookie-consent-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .cookie-consent-text {
        text-align: center;
        font-size: 0.9rem;
    }

    .cookie-consent-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .cookie-consent-buttons .btn {
        min-width: 120px;
        margin: 0.25rem;
        font-size: 0.85rem;
    }

    /* Optimizar las partículas para móviles */
    #particles-js {
        height: 100vh;
    }

    /* Mejorar la navegación lateral */
    .side-nav-control {
        display: none;
        /* Ocultar en móviles para ahorrar espacio */
    }

    /* Optimizar el efecto fade-in para móviles */
    .section-fade {
        transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Optimizaciones para las cards de Historia, Valores, Misión y Visión */
    .modern-about-card,
    .mission-vision-modern {
        padding: 1.5rem !important;
        min-height: 350px !important;
        border-radius: 15px !important;
        margin-bottom: 1rem;
    }

    .card-header-modern {
        flex-direction: column;
        text-align: center;
        margin-bottom: 1rem !important;
    }

    .card-header-modern .icon-container {
        width: 50px !important;
        height: 50px !important;
        margin-right: 0 !important;
        margin-bottom: 0.75rem;
    }

    .card-header-modern .icon-container i {
        font-size: 1.2rem !important;
    }

    .card-header-modern h3 {
        font-size: 1.3rem !important;
        text-align: center;
    }

    .about-text,
    .mission-vision-modern p {
        font-size: 0.9rem !important;
        line-height: 1.6;
    }

    .values-grid .value-item {
        flex-direction: column;
        text-align: center;
        padding: 0.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    .values-grid .value-item i {
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
        font-size: 1rem !important;
    }

    .values-grid .value-item div {
        text-align: center;
    }

    .values-grid .value-item strong {
        display: block;
        margin-bottom: 0.25rem;
    }

    .values-grid .value-item span {
        margin-left: 0 !important;
        font-size: 0.85rem;
    }
}

/* Mejoras para pantallas muy pequeñas */
@media (max-width: 575.98px) {
    .masthead-heading {
        font-size: 1.8rem;
        padding: 0 0.5rem;
    }

    .masthead-subheading {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    .elegant-title {
        font-size: 1.5rem;
        padding-left: 0.5rem;
    }

    .service-highlight {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .contact-container {
        padding: 1rem;
        margin: 0.5rem 0;
    }

    .contact-info-wrapper,
    .form-wrapper {
        padding: 1rem;
    }

    .navbar-brand img {
        max-width: 100px;
    }

    .footer {
        padding: 1.5rem 0 1rem;
    }

    .footer-brand img {
        max-width: 120px;
    }

    .footer-description {
        font-size: 0.85rem;
    }

    .copyright-text {
        font-size: 0.8rem;
    }

    /* Optimizaciones para las cards de Historia, Valores, Misión y Visión */
    .modern-about-card,
    .mission-vision-modern {
        padding: 1.25rem !important;
        min-height: 300px !important;
        border-radius: 12px !important;
    }

    .card-header-modern .icon-container {
        width: 45px !important;
        height: 45px !important;
    }

    .card-header-modern .icon-container i {
        font-size: 1.1rem !important;
    }

    .card-header-modern h3 {
        font-size: 1.2rem !important;
    }

    .about-text,
    .mission-vision-modern p {
        font-size: 0.85rem !important;
    }

    .values-grid .value-item {
        padding: 0.4rem !important;
    }

    .values-grid .value-item i {
        font-size: 0.9rem !important;
    }

    .values-grid .value-item span {
        font-size: 0.8rem;
    }
}

/* Mejoras para pantallas extra pequeñas */
@media (max-width: 375px) {
    .masthead-heading {
        font-size: 1.6rem;
    }

    .masthead-subheading {
        font-size: 0.9rem;
    }

    .service-highlight {
        font-size: 0.8rem;
        padding: 0.4rem;
    }

    .contact-container {
        padding: 0.75rem;
    }

    .contact-info-wrapper,
    .form-wrapper {
        padding: 0.75rem;
    }

    .navbar-brand img {
        max-width: 90px;
    }

    /* Optimizaciones para las cards de Historia, Valores, Misión y Visión */
    .modern-about-card,
    .mission-vision-modern {
        padding: 1rem !important;
        min-height: 280px !important;
    }

    .card-header-modern .icon-container {
        width: 40px !important;
        height: 40px !important;
    }

    .card-header-modern .icon-container i {
        font-size: 1rem !important;
    }

    .card-header-modern h3 {
        font-size: 1.1rem !important;
    }

    .about-text,
    .mission-vision-modern p {
        font-size: 0.8rem !important;
    }

    .values-grid .value-item {
        padding: 0.3rem !important;
    }

    .values-grid .value-item i {
        font-size: 0.85rem !important;
    }

    .values-grid .value-item span {
        font-size: 0.75rem;
    }
}

/* Mejoras para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {

    .btn,
    .nav-link,
    .language-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .btn {
        padding: 0.75rem 1.5rem;
    }

    /* Mejorar el feedback táctil */
    .btn:active,
    .nav-link:active,
    .language-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    /* Deshabilitar hover en dispositivos táctiles */
    .btn:hover,
    .nav-link:hover,
    .language-btn:hover {
        transform: none;
    }
}

/* Optimizaciones de rendimiento para móviles */
@media (max-width: 767.98px) {

    /* Reducir animaciones para mejor rendimiento */
    .fade-in,
    .slide-in-left,
    .slide-in-right {
        animation-duration: 0.5s;
    }

    /* Optimizar las transiciones */
    * {
        transition-duration: 0.3s;
    }

    /* Mejorar el scroll */
    html {
        scroll-padding-top: 80px;
        /* Compensar el navbar fijo */
    }

    /* Optimizar el contenedor principal */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .row {
        margin-left: -7.5px;
        margin-right: -7.5px;
    }

    .col,
    .col-1,
    .col-2,
    .col-3,
    .col-4,
    .col-5,
    .col-6,
    .col-7,
    .col-8,
    .col-9,
    .col-10,
    .col-11,
    .col-12 {
        padding-left: 7.5px;
        padding-right: 7.5px;
    }
}

/* Mejoras específicas para el hero section en móviles */
@media (max-width: 767.98px) {
    .about-hero-section {
        margin: 2rem 0;
        min-height: 400px;
        border-radius: 15px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    }

    .about-hero-section .container {
        height: auto !important;
        padding: 2rem 1rem !important;
    }

    .hero-content {
        padding: 1rem !important;
        text-align: center;
    }

    .hero-content h2 {
        font-size: 1.8rem !important;
        margin-bottom: 1rem;
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 1rem !important;
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }

    .hero-stats {
        flex-direction: column !important;
        gap: 1rem !important;
        margin-top: 1.5rem !important;
    }

    .hero-stats .stat-item {
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        backdrop-filter: blur(5px);
    }

    .hero-stats .stat-item div:first-child {
        font-size: 1.5rem !important;
    }

    .hero-stats .stat-item div:last-child {
        font-size: 0.8rem !important;
    }

    .hero-visual {
        padding: 1rem !important;
        margin-top: 1rem;
    }

    .tech-icons-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        max-width: 250px !important;
    }

    .tech-icon {
        padding: 1rem !important;
        border-radius: 12px !important;
    }

    .tech-icon i {
        font-size: 1.5rem !important;
    }

    .tech-icon div {
        font-size: 0.7rem !important;
        margin-top: 0.3rem !important;
    }
}

/* Mejoras para pantallas muy pequeñas */
@media (max-width: 575.98px) {
    .about-hero-section {
        margin: 1rem 0;
        min-height: 350px;
        border-radius: 12px !important;
    }

    .about-hero-section .container {
        padding: 1.5rem 0.75rem !important;
    }

    .hero-content h2 {
        font-size: 1.5rem !important;
    }

    .hero-content p {
        font-size: 0.9rem !important;
    }

    .hero-stats .stat-item div:first-child {
        font-size: 1.3rem !important;
    }

    .hero-stats .stat-item div:last-child {
        font-size: 0.75rem !important;
    }

    .tech-icons-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        max-width: 200px !important;
    }

    .tech-icon {
        padding: 0.75rem !important;
    }

    .tech-icon i {
        font-size: 1.2rem !important;
    }

    .tech-icon div {
        font-size: 0.65rem !important;
    }
}

/* Mejoras para pantallas extra pequeñas */
@media (max-width: 375px) {
    .about-hero-section {
        min-height: 300px;
        margin: 0.5rem 0;
    }

    .about-hero-section .container {
        padding: 1rem 0.5rem !important;
    }

    .hero-content h2 {
        font-size: 1.3rem !important;
    }

    .hero-content p {
        font-size: 0.85rem !important;
    }

    .hero-stats {
        gap: 0.75rem !important;
    }

    .hero-stats .stat-item div:first-child {
        font-size: 1.2rem !important;
    }

    .hero-stats .stat-item div:last-child {
        font-size: 0.7rem !important;
    }

    .tech-icons-grid {
        max-width: 180px !important;
    }

    .tech-icon {
        padding: 0.5rem !important;
    }

    .tech-icon i {
        font-size: 1rem !important;
    }

    .tech-icon div {
        font-size: 0.6rem !important;
    }
}

/* Mejoras para la sección de alianzas en móviles */
@media (max-width: 767.98px) {
    .alliance-benefits {
        padding: 2rem 0;
    }

    .benefit-item {
        margin-bottom: 1.5rem;
        padding: 1rem;
    }

    .benefit-item i {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .benefit-item h4 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .benefit-item p {
        font-size: 0.9rem;
    }
}