/* ============================================
   MOBILE & ALIGNMENT FIXES + VIEWPORT FIX
   ============================================ */

/* CRITICAL: Prevent horizontal scroll */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Prevent all elements from overflowing */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Container fix for mobile */
.container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden;
}

/* Fix allineamento nav-wrapper */
.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.2rem 0;
}

/* Fix menu desktop - allineamento migliore */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
}

/* Language switcher meglio allineato */
.language-switcher-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--primary);
    border-radius: 50px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Call button meglio allineato */
.btn-call {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    background: var(--gradient);
    color: var(--dark);
    font-weight: 600;
    border-radius: 50px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    letter-spacing: 1px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* ============================================
   MOBILE RESPONSIVE - CRITICAL FIXES
   ============================================ */

@media (max-width: 968px) {
    /* Mobile menu fix */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(10, 14, 39, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        padding: 2rem;
        transition: left 0.4s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    /* Menu items mobile */
    .nav-menu li {
        width: 100%;
        text-align: center;
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem;
        font-size: 1.2rem;
    }
    
    /* Language switcher mobile */
    .language-switcher-wrapper {
        width: 100%;
    }
    
    .language-switcher {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .language-dropdown {
        position: static;
        width: 100%;
        margin-top: 1rem;
    }
    
    /* Call button nascosto su mobile */
    .btn-call {
        display: none;
    }
    
    /* Mobile menu toggle visibile */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
        z-index: 1000;
    }
    
    .mobile-menu-toggle span {
        width: 25px;
        height: 3px;
        background: var(--primary);
        border-radius: 3px;
        transition: var(--transition);
    }
    
    /* Logo più piccolo su mobile */
    .logo-image {
        height: 45px !important;
        max-width: 180px;
    }
    
    .logo-text {
        font-size: 1.3rem !important;
    }
    
    .logo-combo .logo-text {
        font-size: 1.1rem !important;
    }
}

/* Tablet landscape */
@media (max-width: 1024px) and (min-width: 969px) {
    .nav-menu {
        gap: 1.5rem;
    }
    
    .nav-menu a {
        font-size: 0.85rem;
    }
    
    .btn-call {
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .language-switcher {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Mobile small */
@media (max-width: 576px) {
    .nav-wrapper {
        padding: 1rem 0;
    }
    
    .logo-image {
        height: 40px !important;
        max-width: 150px;
    }
    
    .logo-text {
        font-size: 1.2rem !important;
    }
    
    .logo-combo {
        gap: 0.4rem;
    }
    
    .logo-combo .logo-text {
        font-size: 1rem !important;
    }
    
    .mobile-menu-toggle span {
        width: 22px;
        height: 2px;
    }
    
    .nav-menu {
        top: 65px;
        height: calc(100vh - 65px);
        gap: 1.5rem;
    }
    
    .nav-menu a {
        font-size: 1.1rem;
        padding: 0.8rem;
    }
    
    .language-switcher {
        font-size: 1rem;
    }
}

/* ============================================
   HERO SECTION MOBILE FIX
   ============================================ */

@media (max-width: 768px) {
    .hero {
        padding: 120px 0 50px;
        min-height: auto;
    }
    
    .hero h1 {
        font-size: 2.5rem !important;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2rem !important;
    }
    
    .hero p {
        font-size: 1rem;
    }
}

/* ============================================
   SECTIONS MOBILE FIX
   ============================================ */

@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem !important;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2rem;
    }
}

/* ============================================
   LANGUAGE POPUP MOBILE FIX
   ============================================ */

@media (max-width: 576px) {
    .language-popup-content {
        padding: 2rem;
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .language-popup-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .language-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .language-option {
        padding: 1.2rem;
    }
    
    .language-option .flag {
        font-size: 2rem;
    }
    
    .language-option .lang-name {
        font-size: 1rem;
    }
}
