/* ===== MEDIA QUERY PARA SMARTPHONES ===== */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }

    /* Header reduzido no mobile */
    #header-wrapper {
        padding: 8px 0 6px;
    }
    
    #header {
        padding: 0 16px;
    }
    
    #header img {
        max-height: 50px;
        margin: 0 auto 3px;
    }
    
    /* Seletor de idioma */
    .lang-selector {
        position: static;
        justify-content: center;
        margin-bottom: 10px;
        display: flex;
        gap: 10px;
        width: auto;
        background: rgba(255,255,255,0.1);
        padding: 5px 10px;
        border-radius: 20px;
    }
    
    .lang-selector a {
        padding: 5px 12px;
    }

    /* Navegação principal HORIZONTAL no mobile */
    .mobileUI-site-nav {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
        margin-top: 12px !important;
        padding: 8px 0 !important;
        list-style: none;
    }

    .mobileUI-site-nav a {
        color: #FFF !important;
        padding: 8px 12px !important;
        display: inline-block !important;
        text-decoration: none !important;
        transition: background .4s !important;
        font-size: 12px !important;
        border-radius: 20px !important;
        white-space: nowrap !important;
        background: rgba(255,255,255,0.15) !important;
    }
    
    .mobileUI-site-nav a.active {
        background: rgba(255,255,255,0.3) !important;
    }

    /* Sub-navegação da página de solutions - HORIZONTAL */
    #page .mobileUI-site-nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 12px !important;
        border-radius: 40px !important;
        margin: 20px 0 !important;
        background: rgba(0,0,0,0.05) !important;
    }

    #page .mobileUI-site-nav a {
        flex: 0 1 auto !important;
        min-width: auto !important;
        font-size: 11px !important;
        padding: 6px 12px !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    /* Main content */
    #wrapper {
        margin: 20px auto;
        padding: 0 16px;
        min-height: calc(100vh - 140px);
    }

    /* Imagens */
    .alignleft {
        float: none;
        margin: 0 0 20px;
        max-width: 100%;
        text-align: center;
    }

    .image-style1 {
        display: inline-block;
    }
    
    .image-style1 img {
        max-width: 100%;
        height: auto;
    }

    /* Títulos */
    h1, .welcome-title {
        font-size: 28px;
        margin-bottom: 15px;
        text-align: center;
    }

    h2 {
        font-size: 24px;
        margin: 25px 0 15px;
        text-align: center;
    }
    
    h2::after {
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
    }

    .welcome-text {
        font-size: 16px;
        text-align: center;
    }

    .subtitle {
        font-size: 16px;
        margin-bottom: 20px;
        text-align: center;
    }

    p {
        font-size: 14px;
        margin-bottom: 14px;
    }

    /* Tabelas - scroll horizontal para telas pequenas */
    table.fixed {
        font-size: 12px;
        margin: 25px 0;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    table.fixed th,
    table.fixed td {
        padding: 10px 12px;
    }

    /* Cards */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 25px 0;
    }
    
    .card {
        padding: 18px;
    }
    
    .card h3 {
        font-size: 18px;
    }

    /* Formulário */
    #CONTACTS, #CONTACTOS {
        padding: 24px;
    }

    .input-text {
        font-size: 15px;
        padding: 12px 14px;
        width: 100%;
        box-sizing: border-box;
    }

    .text-area {
        min-height: 100px;
    }

    .input-btn {
        width: 100%;
        padding: 12px;
    }

    /* Mapa */
    #gmap_canvas {
        height: 220px !important;
        width: 100%;
    }

    /* Links de voltar ao topo */
    a[href="#top"] {
        display: inline-block;
        text-align: center;
        max-width: 160px;
        margin: 20px auto;
        padding: 8px 20px;
        font-size: 12px;
    }

    /* Página de idiomas */
    .lang-box {
        display: block;
        margin: 12px auto;
        padding: 28px 20px;
        max-width: 260px;
    }

    .lang-box a {
        font-size: 22px;
    }

    /* Partners grid */
    .partners-grid {
        gap: 12px;
        margin: 25px 0;
        justify-content: center !important;
    }
    
    .partner-logo {
        min-width: 95px;
        padding: 12px 16px;
        font-size: 13px;
        text-align: center;
    }

    /* Solutions highlight */
    .solutions-highlight {
        padding: 20px;
        margin: 25px 0;
        text-align: center;
    }
    
    .solutions-highlight p {
        font-size: 13px;
    }

    /* Contactos */
    .contact-info,
    .contact-person {
        padding: 18px;
        text-align: center;
    }
    
    .contact-person h3 {
        font-size: 18px;
    }

    /* Copyright */
    #copyright {
        padding: 20px;
        margin-top: 40px;
        font-size: 11px;
        text-align: center;
    }
    
    /* Clearfix */
    .clearfix {
        clear: both;
    }
    
    /* Lists */
    ul {
        padding-left: 20px;
    }
    
    /* References section */
    #REFERENCES div {
        justify-content: center;
    }
}

/* ===== ECRÃS MUITO PEQUENOS (menos de 480px) ===== */
@media screen and (max-width: 480px) {
    .mobileUI-site-nav a {
        padding: 6px 10px !important;
        font-size: 10px !important;
        white-space: normal !important;
    }
    
    #page .mobileUI-site-nav a {
        font-size: 10px !important;
        padding: 5px 8px !important;
    }

    table.fixed th,
    table.fixed td {
        padding: 6px 8px;
        font-size: 10px;
    }

    h1, .welcome-title {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
    }

    .solutions-highlight {
        padding: 12px;
    }
    
    .welcome-text {
        font-size: 13px;
    }
    
    .lang-box {
        padding: 20px 12px;
    }
    
    .lang-box a {
        font-size: 18px;
    }
    
    .card h3 {
        font-size: 16px;
    }
    
    .partner-logo {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 11px;
    }
}




  