/* --- GLOBAL STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

/* --- HEADER & NAVBAR --- */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* === NEW CARD FLIP STYLES === */

/* --- Containers --- */
.services-cards-container {
    perspective: 1000px; /* Essential for 3D effect */
}

/* Base style for the outer flip containers */
.card-flip-container {
    perspective: inherit; /* Inherit from parent to ensure 3D is active across all cards */
    margin-bottom: 2rem; /* Add spacing between cards on mobile */
    height: auto;
    min-height: 400px; /* Ensure cards have some minimal height and stack well on mobile */
    cursor: pointer;
}

/* Ensure equal sizing within the container */
.card-flip-container .service-card {
    height: 100%;
    width: 100%;
}


/* --- Inner Card (The Rotating element) --- */
.service-card-inner {
    transform-style: preserve-3d; /* Keep children in 3D space */
    transition: transform 0.8s, box-shadow 0.3s ease; /* Flip duration and hover shadow duration */
    position: relative;
    width: 100%;
    height: 100%; /* Important for equal sizing */
    border-radius: 12px; /* Original style moved here */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); /* Original shadow moves to container hover */
}


/* --- Front and Back Face (Common Styling Fix) --- */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    padding: 2rem; 
    border-radius: 12px; 
    
    /* 1. CRITICAL FIXES FOR SUPERPOSITION: */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden; /* For Safari/Chrome rendering engines */
    transform-style: preserve-3d;        /* Forces strict layer separation */
    
    display: flex;
    flex-direction: column;
    justify-content: center; 
    text-align: center;
    border: 1px solid #e0e0e0; 
}

/* --- Front Face Specific Fix --- */
.card-front {
    background: #fff; 
    z-index: 2; 
    /* 2. Forces front content to explicitly stay flat on its face layer */
    transform: rotateY(0deg); 
}

/* --- Back Face Specific Fix --- */
.card-back {
    background: #fdfbf7; 
    transform: rotateY(180deg); 
    z-index: 1; 
    overflow-y: auto; /* Keeps the scrollbar functional for long text */
    
    /* CRITICAL FIXES FOR TOP CUT-OFF: */
    justify-content: flex-start; /* Aligns text to the top so it scrolls downwards naturally */
    padding-top: 1.5rem;         /* Adds a nice gap at the very top of the card */
}


.card-front .card-badge,
.card-front h3,
.card-front .card-duration,
.card-front .card-price {
    /* Preserve existing styles for front face only */
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    margin-bottom: inherit;
}



.card-back h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 1px solid rgba(74, 124, 89, 0.3); /* Subtle green divider */
    padding-bottom: 0.5rem;
}

.card-back p {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.8rem;
    line-height: 1.5;
    text-align: justify; /* Text looks better justified on paragraphs on cards */
}

.card-back p:last-child {
    margin-bottom: 0;
}


/* --- Trigger (Flip on Hover of the container) --- */
.card-flip-container:hover .service-card-inner {
    transform: rotateY(180deg);
}


/* --- Original Highlighted Styles Adaptations --- */
/* Highlighed styles are now applied selectively to front/back */
.service-card-inner.highlighted .card-front {
    border: 2px solid #4a7c59; /* Green border on front only */
    background: #fdfbf7; /* Warm tint on front face of highlighted */
}

.service-card-inner.highlighted .card-back {
    background: #fff; /* Inverse back face of highlighed */
}

/* Stronger shadow on hover of the container, original behavior */
.card-flip-container:hover .service-card-inner {
    box-shadow: 0 6px 10px rgba(0,0,0,0.1);
}

/* Ensure mobile stacking rules still work, the container width will handle this */

.card-flip-container.is-flipped .service-card-inner {
    transform: rotateY(180deg);
}

.navbar {
    display: flex;
    justify-content: center; /* Centers the logo and links together */
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: auto;
    position: relative; /* Crucial for positioning the mobile burger later */
}

.logo {
    display: flex;
    align-items: center;
}

/* Constrains the logo image size inside the header */
.logo-img {
    max-height: 50px; 
    width: auto;
    display: block;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    margin-left: 3rem; /* Kept to give breathing room between the logo and "Accueil" */
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #3498db;
}

.btn-primary {
    background-color: #3498db;
    color: white !important;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #2980b9;
}

/* Hamburger Menu (Hidden on Desktop) */
.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px;
    transition: all 0.3s ease;
}

/* --- MAIN BODY CONTENT --- */
main {
    max-width: 1200px;
    margin: auto;
    padding: 2rem 5%;
    min-height: 70vh;
}

.hero-section {
    text-align: center;
    padding: 4rem 0;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.content-section {
    margin: 4rem 0;
}

.content-section h2 {
    margin-bottom: 2rem;
    text-align: center;
    color: #2c3e50;
}

.split-layout {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.responsive-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    flex: 1;
}

.split-layout p {
    flex: 1;
    font-size: 1.1rem;
}

/* --- SERVICES CARDS (OPTION 2) --- */
.services-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    position: relative;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card.highlighted {
    border: 2px solid #4a7c59;
    background: #fdfbf7; /* Slight warm tint */
}

.card-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 0.5rem;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #2c3e50; /* Matches your section heading colors perfectly */
}

.card-duration {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.card-price {
    font-size: 1.75rem;
    font-weight: bold;
    color: #4a7c59; /* Gentle botanical green for health/naturopathy pricing */
}

/* Styling for the logo placed between sections */
.logo-middle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0; /* Adds spacing above and below the logo */
}

.logo-img-middle {
    max-width: 250px; /* Adjust this value depending on how big you want the logo to appear */
    height: auto;
    display: block;
}

/* --- FOOTER --- */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 2rem 5% 1rem;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: auto;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-container a {
    color: #ecf0f1;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-container a:hover {
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #34495e;
    font-size: 0.9rem;
}

/* Change this line to make it more specific */
.footer-container .footer-email {
    display: inline-block !important; /* !important guarantees it forces it onto the same line */
    color: #ecf0f1; 
    text-decoration: none;
    transition: color 0.3s ease;
    margin-left: 5px; 
}

.footer-container .footer-email:hover {
    color: #3498db; 
    text-decoration: underline;
}

/* --- PDF WINDOWS LAYOUT --- */
.pdf-section {
    margin: 4rem 0;
}

.pdf-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.pdf-container {
    display: flex;
    gap: 2rem;
    width: 100%;
}

.pdf-box {
    flex: 1; /* Keeps them exactly equal in width */
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.pdf-box h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #333;
    text-align: center;
}

.pdf-box iframe {
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* --- RESPONSIVENESS (MOBILE) --- */
@media screen and (max-width: 768px) {
    /* Navbar Mobile */
    .nav-links {
        position: absolute;
        right: 0px;
        height: 90vh;
        top: 8vh;
        background-color: #ffffff;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        transform: translateX(100%);
        transition: transform 0.4s ease-in;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
    }

    .nav-links li {
        margin: 2rem 0;
    }

    .nav-links.nav-active {
        transform: translateX(0%);
    }

    .burger {
        display: block;
        position: absolute; /* Detaches it from the center flow */
        right: 5%;         /* Pins it to the right edge of the header */
    }

    /* Layout Mobile */
    .split-layout {
        flex-direction: column;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }
/* Inside your existing @media screen block... */
    .pdf-container {
        flex-direction: column; /* Stacks the PDFs vertically on mobile phones */
    }
}