:root {
    --primary-color: #37726E; /* Couleur principale (vert foncé) */
    --secondary-color: #F2FC32; /* Couleur secondaire (jaune vif) */
    --accent-color: #7EC7A8; /* Couleur accent (vert clair) */
    --light-color: #FFFFFF; /* Blanc */
    --light-bg: #f9f9f9; /* Fond clair */
    --dark-color: #343a40; /* Couleur texte foncé */
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    --transition-speed: 0.3s;
}

/* Container styling specific to FAQ if needed, otherwise rely on theme's container */
.faq-page-container { /* Renamed to avoid conflict with potential theme .container */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header section */
.faq-header {
    padding-top: calc(70px + 60px); /* Header height (70px) + original padding (60px) */
    padding-bottom: 60px; /* Keep original bottom padding */
    padding-left: 0;
    padding-right: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: var(--light-color);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.faq-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Path relative to the CSS file */
    background-image: url('../images/image-optimized/cleaning-pattern.webp');
    opacity: 0.1;
    z-index: 0;
}

/* Adjust padding when WP Admin Bar is visible */
body.admin-bar .faq-header {
    padding-top: calc(70px + 32px + 60px); /* Header height + Admin Bar height + original padding */
}

.header-content {
    position: relative;
    z-index: 1;
}

.faq-header .header-title { /* Specificity for FAQ header */
    font-size: 2.8rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--secondary-color); /* Change title color to yellow */
}

.faq-header .header-subtitle { /* Specificity for FAQ header */
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    color: var(--light-color); /* Change subtitle color to white */
    opacity: 0.9;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    transition: all var(--transition-speed);
}

.search-input:focus {
    outline: none;
    box-shadow: 0 5px 25px rgba(0,0,0,0.25);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1.3rem;
}

/* Main FAQ section */
.faq-section {
    padding: 60px 0;
}

.section-header {
    margin-bottom: 40px;
    display: flex;
    align-items: center;
}

.section-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 10px;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 3px;
}

.section-icon {
    background-color: var(--accent-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.faq-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    justify-content: center;
}

.category-button {
    background-color: var(--light-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.category-button:hover, .category-button.active {
    background-color: var(--primary-color);
    color: var(--light-color);
}

.faq-list {
    list-style: none;
    padding-left: 0; /* Reset default list padding */
}

.faq-item {
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--light-color);
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed);
}

.faq-item:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.faq-question {
    padding: 20px 60px 20px 25px;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--accent-color);
    transition: all var(--transition-speed);
}

.faq-item.active .faq-question::after {
    content: '−';
}

.faq-question:hover {
    background-color: rgba(55, 114, 110, 0.05);
}

.faq-item.active .faq-question {
    background-color: rgba(55, 114, 110, 0.1);
}

.faq-answer {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.faq-item.active .faq-answer {
    padding: 5px 25px 25px;
    max-height: 1000px; /* Adjust if needed for longer answers */
    opacity: 1;
}

.faq-answer-inner {
    color: #666;
    line-height: 1.7;
}
.faq-answer-inner ul { /* Style nested lists */
    margin-left: 20px;
    margin-top: 10px;
    list-style: disc; /* Or desired style */
}
.faq-answer-inner p { /* Add margin to paragraphs inside answers */
    margin-bottom: 10px;
}
.faq-answer-inner p:last-child {
    margin-bottom: 0;
}


/* Contact CTA section */
.contact-cta {
    background-color: rgba(126, 199, 168, 0.15);
    padding: 60px 0;
    text-align: center;
    margin-top: 40px;
}

.cta-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.cta-subtitle {
    font-size: 1.1rem;
    color: #555;
    max-width: 700px;
    margin: 0 auto 30px;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 15px 30px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed);
    margin: 0 10px 15px;
}

.cta-button:hover {
    background-color: #2a5a57;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cta-button.secondary {
    background-color: var(--secondary-color);
    color: var(--dark-color);
}

.cta-button.secondary:hover {
    background-color: #d8e129;
}

/* Related articles section */
.related-articles {
    padding: 60px 0;
}

.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.article-card {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.article-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.article-content {
    padding: 20px;
}

.article-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.article-excerpt {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.read-more::after {
    content: '→';
    margin-left: 5px;
    transition: transform var(--transition-speed);
}

.read-more:hover::after {
    transform: translateX(5px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .faq-header {
        padding-top: calc(60px + 40px); /* Mobile header height (60px) + spacing (40px) */
        padding-bottom: 40px;
    }

    /* Adjust for admin bar on mobile */
    body.admin-bar .faq-header {
        padding-top: calc(60px + 46px + 40px); /* Mobile header + mobile admin bar + spacing */
    }

    .faq-header .header-title {
        font-size: 2rem;
    }

    .faq-header .header-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .faq-question {
        padding: 15px 50px 15px 20px;
        font-size: 0.95rem;
    }

    .faq-question::after {
        right: 20px;
    }

    .search-input {
        padding: 12px 15px 12px 45px;
        font-size: 1rem;
    }

    .cta-title {
        font-size: 1.6rem;
    }

    .faq-page-container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .faq-header {
        padding-top: calc(60px + 30px); /* Mobile header + reduced spacing */
        padding-bottom: 30px;
    }

    body.admin-bar .faq-header {
        padding-top: calc(60px + 46px + 30px);
    }

    .faq-header .header-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .faq-header .header-subtitle {
        font-size: 0.95rem;
    }

    .faq-page-container {
        padding: 0 10px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .faq-question {
        padding: 12px 45px 12px 15px;
        font-size: 0.9rem;
    }

    .faq-question::after {
        right: 15px;
        font-size: 1.3rem;
    }

    .search-input {
        padding: 10px 12px 10px 40px;
        font-size: 0.95rem;
    }

    .category-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .cta-title {
        font-size: 1.4rem;
    }

    .cta-subtitle {
        font-size: 1rem;
    }

    .cta-button {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

@media (max-width: 375px) {
    .faq-header {
        padding-top: calc(55px + 25px); /* Smaller header + reduced spacing */
        padding-bottom: 25px;
    }

    body.admin-bar .faq-header {
        padding-top: calc(55px + 46px + 25px);
    }

    .faq-header .header-title {
        font-size: 1.5rem;
    }

    .faq-header .header-subtitle {
        font-size: 0.85rem;
    }

    .faq-page-container {
        padding: 0 8px;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .faq-question {
        padding: 10px 40px 10px 12px;
        font-size: 0.85rem;
    }

    .faq-question::after {
        font-size: 1.2rem;
    }

    .search-input {
        padding: 8px 10px 8px 35px;
        font-size: 0.9rem;
    }

    .search-icon {
        font-size: 1.1rem;
        left: 10px;
    }

    .category-button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .section-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin-right: 15px;
    }

    .cta-title {
        font-size: 1.2rem;
    }

    .cta-button {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}
