/* === VARIABLES & RESET === */
:root {
    --primary-color: #2E7D32; /* Vert profond et professionnel */
    --secondary-color: #37474F; /* Gris-bleu foncé pour le texte */
    --accent-color: #FFC107; /* Jaune ambré pour les accents */
    --background-light: #F8F9FA;
    --white-color: #FFFFFF;
    --font-title: 'Poppins', sans-serif;
    --font-text: 'Lato', sans-serif;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-text); color: var(--secondary-color); line-height: 1.7; background-color: var(--white-color); -webkit-font-smoothing: antialiased; }

/* === ÉLÉMENTS DE BASE & CONTENEUR === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 700; color: var(--primary-color); line-height: 1.2; }
h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); margin-bottom: 1rem; }
h3 { font-size: 1.4rem; color: var(--primary-color); margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; max-width: 65ch; }
.section-tag { display: inline-block; font-family: var(--font-title); font-weight: 600; color: var(--accent-color); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }
.btn-container { margin-top: 2rem; }

/* === HEADER & NAVIGATION === */
.header { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); box-shadow: var(--shadow); padding: 1rem 0; position: sticky; top: 0; z-index: 1000; }
.header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; text-decoration: none; font-family: var(--font-title); font-size: 1.5rem; color: var(--primary-color); }
.logo img { height: 50px; margin-right: 12px; }
.nav-main ul { list-style: none; display: flex; align-items: center; }
.nav-main li { margin-left: 35px; }
.nav-main a { text-decoration: none; color: var(--secondary-color); font-weight: 700; padding: 5px 0; position: relative; }
.nav-main a::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 3px; background-color: var(--primary-color); transition: width 0.3s ease-in-out; }
.nav-main a:hover::after, .nav-main a.active::after { width: 100%; }

/* === BOUTONS === */
.btn { display: inline-block; text-decoration: none; padding: 14px 30px; border-radius: 50px; font-weight: 700; transition: all 0.3s ease; border: 2px solid transparent; text-align: center; }
.btn-primary { background-color: var(--accent-color); color: #333; }
.btn-primary:hover { background-color: #ffca2c; transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.btn-secondary { background-color: transparent; color: var(--primary-color); border-color: var(--primary-color); }
.btn-secondary:hover { background-color: var(--primary-color); color: var(--white-color); }
.btn-nav { padding: 10px 20px; font-size: 0.9rem; background-color: var(--primary-color); color: var(--white-color); }
.btn-nav:hover { background-color: #256a28; }

/* === HERO SECTION === */
.hero { display: flex; align-items: center; justify-content: center; min-height: 85vh; padding: 40px 0; text-align: center; color: var(--white-color); position: relative; background-image: url('images/image00000413.jpg'); background-size: cover; background-position: center 60%; background-attachment: fixed; }
.hero::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(0deg, rgba(46, 125, 50, 0.7), rgba(46, 125, 50, 0.5)); }
.hero-content { position: relative; z-index: 2; }
.hero h1 { color: var(--white-color); text-shadow: 2px 2px 10px rgba(0,0,0,0.3); }
.hero .subtitle { font-size: 1.4rem; max-width: 700px; margin: 1rem auto 2.5rem; text-shadow: 1px 1px 5px rgba(0,0,0,0.3); }

/* === ANIMATIONS D'ENTRÉE HERO === */
.fade-in-up { animation: fadeInUp 0.8s ease-out forwards; opacity: 0; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* === AUTRES SECTIONS === */
section { padding: 80px 0; }
.reassurance { background-color: var(--background-light); padding: 60px 0; }
.reassurance .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 30px; }
.reassurance-item { text-align: center; }
.reassurance-item h3 { font-size: 1.2rem; }

.sap-section { background: var(--white-color); }
.sap-section .container { display: flex; align-items: center; gap: 40px; background-color: var(--background-light); padding: 40px; border-radius: var(--radius); }
.sap-logo { max-width: 200px; height: auto; align-self: center; flex-shrink: 0; }
.sap-text h2 { margin-top: 0; }
.sap-text p { max-width: none; }

.presentation .container { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 60px; }
.presentation-image img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; }

.services-overview { background-color: var(--background-light); text-align: center; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 3rem; }
.service-card { background: var(--white-color); border-radius: var(--radius); box-shadow: var(--shadow); text-align: left; transition: all 0.3s ease; display: flex; flex-direction: column; }
.service-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-hover); }
.service-card-image { overflow: hidden; height: 220px; border-radius: var(--radius) var(--radius) 0 0; }
.service-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.service-card:hover img { transform: scale(1.05); }
.service-card-content { padding: 25px; flex-grow: 1; }

.cta-section { background: var(--primary-color) url('images/image00000114.jpg') center/cover no-repeat; background-blend-mode: multiply; color: var(--white-color); text-align: center; }
.cta-section h2 { color: var(--white-color); }
.cta-section p { max-width: 600px; margin: 1rem auto 2rem; color: rgba(255,255,255,0.9); }

.testimonials { padding: 80px 0; text-align: center; }
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 3rem; text-align: left; }
.testimonial-card { background: var(--background-light); padding: 30px; border-radius: var(--radius); border-left: 5px solid var(--primary-color); }
.testimonial-card p { font-style: italic; margin-bottom: 1rem; }
.testimonial-author { font-weight: 700; color: var(--primary-color); }

/* === FOOTER === */
.footer { background: #263238; color: #cfd8dc; padding-top: 60px; }
.footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer h3 { color: var(--white-color); margin-bottom: 1rem; font-size: 1.2rem; }
.footer p, .footer li { font-size: 0.95rem; }
.footer ul { list-style: none; }
.footer .contact-list li { margin-bottom: 0.8rem; }
.footer a { color: #cfd8dc; text-decoration: none; transition: color 0.3s ease; }
.footer a:hover { color: var(--accent-color); }
.footer-bottom { text-align: center; margin-top: 40px; padding: 20px 0; border-top: 1px solid #455A64; }
.footer-bottom p { font-size: 0.9rem; margin: 0; color: #90A4AE; }

/* === ANIMATIONS & VISIONNEUSE === */
.fade-in-section { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in-section.is-visible { opacity: 1; transform: translateY(0); }

.lightbox { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.85); align-items: center; justify-content: center; animation: fadeIn 0.3s ease; }
.lightbox-content { max-width: 90%; max-height: 85%; object-fit: contain; animation: zoomIn 0.3s ease; }
.lightbox-close { position: absolute; top: 20px; right: 35px; color: #fff; font-size: 40px; font-weight: bold; cursor: pointer; transition: color 0.2s ease; }
.lightbox-close:hover { color: #ccc; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0.8); } to { transform: scale(1); } }

/* === HAMBURGER & RESPONSIVE === */
.hamburger { display: none; background: none; border: none; cursor: pointer; z-index: 1001; }
.hamburger-bar { display: block; width: 28px; height: 3px; margin: 6px auto; background-color: var(--primary-color); transition: all 0.3s ease-in-out; }

/*
==================================================================
    RESPONSIVE - CORRECTIONS MOBILES
==================================================================
*/

/* === TABLETTE ET MOBILE (< 992px) === */
@media (max-width: 992px) {
    .nav-main { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--white-color); }
    .nav-main.active { display: block; box-shadow: var(--shadow); }
    .nav-main ul { flex-direction: column; width: 100%; padding: 10px 0; }
    .nav-main li { margin: 10px 0; text-align: center; }
    .hamburger { display: block; }
    .hamburger.active .hamburger-bar:nth-child(2) { opacity: 0; }
    .hamburger.active .hamburger-bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .hamburger.active .hamburger-bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
    
    /* --- CORRECTION POUR LA SECTION "QUI SOMMES-NOUS" --- */
    .presentation .container { 
        display: flex; /* On passe en flexbox pour un contrôle simple */
        flex-direction: column; /* On force l'empilement vertical */
        text-align: center;
    }
    .presentation-text p {
        margin-left: auto;
        margin-right: auto;
    }
    .presentation-image { 
        order: -1; /* On s'assure que l'image est bien en haut */
        width: 100%; /* L'image prend toute la largeur disponible */
        margin-bottom: 30px; /* On ajoute un espace sous l'image */
    }
    
    .sap-section .container { flex-direction: column; text-align: center; }
    .sap-logo { margin: 0 auto 20px; }
    
    .services-grid { grid-template-columns: 1fr 1fr; }

    /* --- Correction Page Services sur Tablette --- */
    .service-detail .container,
    .service-detail.reversed .container {
        grid-template-columns: 1fr;
        grid-template-areas: none !important;
        gap: 40px;
    }
    .service-detail-text { text-align: center; }
    .service-detail-text p { margin-left: auto; margin-right: auto; }
    .service-detail .service-detail-image,
    .service-detail.reversed .service-detail-image {
        order: -1;
    }
}

/* === MOBILE (< 768px) === */
@media (max-width: 768px) {
    section, .sap-section .container { padding: 60px 20px; }
    .services-grid, .footer .container { grid-template-columns: 1fr; }
    .reassurance .container { gap: 40px; }
    
    .floating-call-button {
        display: flex; align-items: center; justify-content: center;
        position: fixed; bottom: 20px; left: 50%;
        transform: translateX(-50%);
        background-color: var(--primary-color);
        color: var(--white-color);
        padding: 12px 20px; border-radius: 50px;
        text-decoration: none; font-family: var(--font-title);
        font-size: 1rem; font-weight: 700;
        box-shadow: 0 4px 20px rgba(0,0,0,0.25);
        z-index: 999; gap: 8px; white-space: nowrap;
        animation: fadeInUp 0.5s ease-out;
    }
}