/* =============================================== */
/* FICHEIRO: style.css (Versão Organizada)        */
/* =============================================== */

/* =============================================== */
/* 1. CONFIGURAÇÕES GLOBAIS E VARIÁVEIS          */
/* =============================================== */

:root {
    --primary: #2a7221;
    --secondary: #f8a51b;
    --dark: #1a1a1a;
    --light: #f5f5f5;
    --accent: #0d5b8a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    overflow-x: hidden;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

body.fade-out {
    opacity: 0;
}

/* =============================================== */
/* 2. COMPONENTES REUTILIZÁVEIS                   */
/* =============================================== */

/* --- Container --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Botões --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--secondary);
    color: var(--dark);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--secondary);
    color: var(--secondary);
    margin-left: 15px;
}

.btn-outline:hover {
    background-color: var(--secondary);
    color: var(--dark);
}

/* --- Secções --- */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--secondary);
}

.section-title p {
    color: #666;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* =============================================== */
/* 3. HEADER E NAVEGAÇÃO                          */
/* =============================================== */

/* --- Header Principal --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 20px 0;
}

header.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Logo --- */
.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo-container img {
    height: 50px;
    display: block;
    transition: height 0.3s ease;
}

header.scrolled .logo-container img {
    height: 40px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    transition: all 0.3s ease;
}

.logo-text span {
    color: var(--secondary);
}

header.scrolled .logo-text {
    color: var(--primary);
}

/* --- Navegação Desktop --- */
nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    text-decoration: none;
    color: var(--light);
    font-weight: 600;
    transition: color 0.3s;
    position: relative;
    padding-bottom: 8px;
}

header.scrolled nav ul li a {
    color: var(--dark);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary);
    transition: width 0.3s;
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--secondary);
}

header.scrolled nav ul li a:hover,
header.scrolled nav ul li a.active {
    color: var(--secondary);
}

/* --- Seletor de Línguas --- */
.language-switcher {
    display: flex;
    gap: 10px;
    margin-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 20px;
}

header.scrolled .language-switcher {
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.lang-link {
    text-decoration: none;
    color: var(--light);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s;
}

header.scrolled .lang-link {
    color: var(--dark);
}

.lang-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

header.scrolled .lang-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.lang-link.active {
    background-color: var(--secondary);
    color: var(--dark);
}

/* --- Menu Mobile --- */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-menu-button {
    display: none;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1002;
}

header.scrolled .mobile-menu-button {
    color: var(--dark);
}

.mobile-menu-close {
    display: none;
}

/* =============================================== */
/* 4. SECÇÕES PRINCIPAIS                          */
/* =============================================== */

/* --- Secção Hero (Homepage) --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    color: white;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3));
    z-index: 1;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* --- Cabeçalho de Página Interna --- */
.page-header {
    padding-top: 150px;
    padding-bottom: 50px;
    background-color: var(--dark);
    color: white;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    color: var(--secondary);
}

/* --- Secção Missão, Visão e Valores --- */
.mission-vision {
    background-color: var(--primary);
    color: white;
}

.mission-vision .section-title h2 {
    color: white;
}

.mission-vision .section-title p {
    color: rgba(255, 255, 255, 0.8);
}

.mission-vision .mv-container {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.mission-vision .mv-box {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.mission-vision .mv-box:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mission-vision .mv-box h3 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 15px;
}

.mission-vision .mv-box p {
    line-height: 1.7;
    color: #f0f0f0;
}

/* --- Cartões de Destaque na Homepage --- */
.mv-container {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.mv-box {
    flex: 1 1 300px;
    padding: 30px;
    text-align: center;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s ease;
}

.mv-box:hover {
    transform: translateY(-5px);
}

.mv-box i {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 20px;
}

.mv-box h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.mv-box p {
    color: #555;
    line-height: 1.6;
}

/* =============================================== */
/* 5. SECÇÕES DE VALORES E EQUIPA                */
/* =============================================== */

/* --- Secção de Valores --- */
.values-section {
    background-color: #f9f9f9;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.value-card {
    background-color: white;
    padding: 40px 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0,0,0,0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.value-icon {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 20px;
}

.value-card h4 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.value-card p {
    color: #555;
    line-height: 1.6;
}

/* --- Secção Equipa --- */
.team-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.team-member {
    background-color: white;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.team-member:hover {
    transform: translateY(-10px);
}

.member-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

.member-info {
    padding: 20px;
}

.member-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary);
}

.member-info p {
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* =============================================== */
/* 6. SECÇÕES DE SERVIÇOS                        */
/* =============================================== */

/* --- Secção Serviços --- */
.services {
    background-color: #f9f9f9;
}

.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.1);
}

.service-image {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-card:hover .service-image img {
    transform: scale(1.05);
}

.service-content {
    padding: 25px 30px;
    text-align: left;
}

.service-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.service-content p {
    color: #333333;
    line-height: 1.6;
    margin-bottom: 25px;
    min-height: 80px;
}

.service-content .btn {
    background-color: var(--secondary);
    color: #333;
    font-weight: 700;
    padding: 10px 25px;
}

.service-content .btn:hover {
    background-color: #e89a1a;
    color: #000;
}

/* --- Secção Agri-Hub --- */
.agri-hub-section {
    background-color: white;
}

.agri-hub-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.agri-hub-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
}

.agri-hub-image img {
    width: 100%;
    display: block;
}

.agri-hub-text {
    flex: 1.2;
}

.agri-hub-text h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.agri-hub-text p {
    margin-bottom: 15px;
    line-height: 1.7;
    color: #555;
}

/* --- Agri-Hub Homepage --- */
.agri-hub-home-section {
    background-color: white;
}

.agri-hub-home-content {
    display: flex;
    gap: 50px;
    align-items: center;
}

.agri-hub-home-text {
    flex: 1;
}

.agri-hub-home-text h3 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.agri-hub-home-text p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 15px;
}

.agri-hub-home-diagram {
    flex: 1;
    text-align: center;
}

.agri-hub-home-diagram img {
    max-width: 100%;
    height: auto;
}

/* =============================================== */
/* 7. SECÇÕES DE PROCESSO E INTERVENÇÃO          */
/* =============================================== */

/* --- Secção Processo --- */
.process-section {
    background-color: #f9f9f9;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.process-step {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.process-step:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--secondary);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.process-step h4 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.process-step p {
    color: #666;
    line-height: 1.6;
}

/* --- Secção Modelo de Intervenção --- */
.intervention-section {
    background-color: #f9f9f9;
}

.intervention-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.intervention-card {
    background-color: white;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.intervention-card .step-number {
    margin-bottom: 15px;
    margin-left: auto;
    margin-right: auto;
}

.intervention-card h3 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.intervention-card p {
    color: #666;
    line-height: 1.6;
}

/* =============================================== */
/* 8. SECÇÕES DE LOCALIZAÇÕES                    */
/* =============================================== */

/* --- Secção Locais de Atuação --- */
.locations-section {
    background-color: var(--accent);
    color: white;
}

.locations-section .section-title h2 {
    color: white;
}

.locations-section .section-title p {
    color: rgba(255, 255, 255, 0.8);
}

.location-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.location-card {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.location-card:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-10px);
}

.location-icon {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 20px;
}

.location-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

/* --- Localizações Homepage --- */
.locations-home-section {
    background-color: #f9f9f9;
}

.locations-home-content {
    display: flex;
    gap: 50px;
    align-items: center;
}

.locations-home-text {
    flex: 1;
}

.locations-home-text h3 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.locations-home-text p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
}

.locations-home-list {
    list-style: none;
    padding-left: 0;
}

.locations-home-list li {
    background-color: var(--secondary);
    color: var(--dark);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-weight: 600;
}

.locations-home-maps-container {
    flex: 1.2;
    display: flex;
    gap: 20px;
}

.locations-home-map {
    flex: 1;
}

.locations-home-map img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 3px solid white;
}

/* =============================================== */
/* 9. SECÇÕES DE CONTACTO                        */
/* =============================================== */

/* --- Secção Contactos --- */
.contact-wrapper {
    display: flex;
    gap: 50px;
}

.contact-details,
.contact-form-container {
    flex: 1;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.contact-icon {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-right: 20px;
}

.contact-text h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.contact-text p,
.contact-text a {
    color: #666;
    text-decoration: none;
}

.contact-form-container {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

textarea.form-control {
    min-height: 120px;
}

/* --- Secção Mapa --- */
.map-section {
    padding-top: 0;
    padding-bottom: 100px;
}

.map-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    height: 450px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* =============================================== */
/* 10. FOOTER                                     */
/* =============================================== */

footer {
    background-color: var(--dark);
    color: white;
    padding: 60px 0 20px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--secondary);
}

.footer-col p,
.footer-links a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: var(--secondary);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #bbb;
}

/* =============================================== */
/* 11. ANIMAÇÕES E EFEITOS                       */
/* =============================================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================== */
/* 12. MEDIA QUERIES (RESPONSIVIDADE)            */
/* =============================================== */

/* --- Tablets e ecrãs médios (até 992px) --- */
@media (max-width: 992px) {
    .about-content, 
    .contact-wrapper, 
    .agri-hub-content, 
    .mission-vision .mv-container,
    .agri-hub-home-content {
        flex-direction: column;
    }

    .locations-home-content {
        flex-direction: column-reverse;
    }
}

/* --- Telemóveis (até 768px) --- */
@media (max-width: 768px) {
    /* Header Controls */
    .header-controls {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .mobile-menu-button {
        display: block;
        order: 2; /* Coloca o botão depois do seletor de língua */
    }

    /* Seletor de língua no mobile */
    .language-switcher {
        order: 1;
        border-left: none;
        padding-left: 0;
        margin-left: 0;
    }

    /* Navegação Mobile */
    header nav {
        display: none;
    }
    
    nav.nav-active {
        display: block;
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 85%;
        max-width: 300px;
        height: 100vh; 
        background-color: white;
        box-shadow: 2px 0 15px rgba(0,0,0,0.2);
        transition: transform 0.3s ease-in-out;
        padding-top: 80px;
        z-index: 2000;
        overflow-y: auto;
    }
    
    nav.nav-active ul {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding: 0 20px;
    }

    nav.nav-active ul li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    nav.nav-active ul li:last-child {
        border-bottom: none;
    }

    nav.nav-active ul li a {
        color: var(--dark);
        font-size: 1.1rem;
        display: block;
        padding: 15px 0;
        width: 100%;
        text-align: left;
        border-radius: 0;
    }

    nav.nav-active ul li a:hover {
        color: var(--secondary);
        background-color: rgba(248, 165, 27, 0.1);
        padding-left: 10px;
    }
    
    .mobile-menu-close {
        display: block;
        position: absolute;
        top: 25px;
        right: 25px;
        font-size: 1.8rem;
        color: var(--dark);
        background: none;
        border: none;
        cursor: pointer;
        z-index: 2001;
    }

    /* Overlay para fechar o menu */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1999;
    }

    .mobile-menu-overlay.active {
        display: block;
    }

    /* Ajustes do logo no mobile */
    .logo-container img {
        height: 40px;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    header.scrolled .logo-container img {
        height: 35px;
    }

    /* Ajustes Hero */
    .hero-content {
        text-align: center;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .page-header h1 {
        font-size: 2.5rem;
    }

    /* Ajustes de seção para mobile */
    section {
        padding: 60px 0;
    }

    .section-title h2 {
        font-size: 2rem;
    }
}

/* --- Telemóveis pequenos (até 576px) --- */
@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .btn {
        display: block;
        width: 90%;
        margin: 10px auto;
    }
    
    .btn-outline {
        margin-left: auto;
    }

    .locations-home-maps-container {
        flex-direction: column;
    }
}
