/* Layout */
.single__filiere section + section {
    margin-top: 4rem;
}

/* Hero */
.hero-filiere {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 50dvh;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.hero-filiere .wrapper {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    height: fit-content;
    padding: 0 1rem;
    z-index: 1;
}

.hero-filiere__petale {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin-bottom: -120px;
}

.hero-filiere__petale svg {
    width: 100%;
    height: auto;
}

.hero-filiere__petale .filiere-item {
    position: absolute;
    top: 45%;
    transform: translateY(-50%) scale(1.2);
}

.hero-filiere__gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80%;
    background: linear-gradient(0deg, var(--c-vert-900) 20%, rgba(0, 0, 0, 0) 80%);
    z-index: 0;
}

.filiere-item__image--domaine {
    position: relative;
    color: #FFFFFF;
    font-size: 20px;
    text-transform: uppercase;
    font-weight: 600;
    font-family: "Monteserrat", sans-serif;
    border: 1px solid;
    border-bottom-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: .3rem 2rem .3rem 1rem;
    width: 100%;
    max-width: fit-content;
    z-index: 1;
}

.filiere-item__image--title {
    font-size: 20px;
    text-transform: uppercase;
    font-weight: 600;
    font-family: "Monteserrat", sans-serif;
    border: 1px solid #FFFFFF;
    border-bottom-left-radius: 24px;
    padding: .3rem 2rem .3rem 1rem;
    margin: 0 0 0 20px;
    display: block;
    width: 100%;
    background-color: #FFFFFF;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
    z-index: 0;
}

.filiere-item__image {
    position: relative;
}

.filiere-item__image--icon {
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translate(-30%, -50%);
    display: flex;
    width: 90px;
    height: 90px;
    z-index: 2;
}

.filiere-item__image--icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Section Simple image */
.section-simple-img .wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-simple-img h2 {
    font-family: "Monteserrat", sans-serif;
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    padding: 0;
    color: var(--c-vert-100);
    text-wrap-style: balance;
    text-align: center;
}

.section-simple-img__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 900px;
    margin: 2rem auto 0 auto;
}

.simple-img-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.simple-img-card__title {
    font-family: "Monteserrat", sans-serif;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    padding: 0;
    color: var(--c-noir-900);
    text-wrap-style: balance;
}

.simple-img-card__description {
    font-size: 14px;
    color: var(--c-noir-500);
    text-align: justify;
}

/* Introduction */
.section-introduction .wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-introduction .wrapper:not(:has(.section-introduction__video)) {
    grid-template-columns: 1fr;
}

.section-introduction__title {
    font-family: "Monteserrat", sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--c-vert-100);
    margin: 0;
    padding: 0;
    text-wrap-style: pretty;
}

.section-introduction__content {
    margin-top: 1rem;
    font-weight: 500;
}

.section-introduction__content * {
    color: var(--c-noir-900);
    font-size: 16px;
}

.section-introduction__content h1,
.section-introduction__content h2,
.section-introduction__content h3 {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.section-introduction__content h4,
.section-introduction__content h5,
.section-introduction__content h6 {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
}

.section-introduction__content a {
    color: var(--c-orange-900);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.section-introduction__video {
    position: relative;
    width: 100%;
    height: fit-content;
    aspect-ratio: 16 / 9;
}

.section-introduction__video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
}

/* Double images */
.section-double-img .wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-double-img h2 {
    font-family: "Monteserrat", sans-serif;
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    padding: 0;
    color: var(--c-vert-100);
    text-wrap-style: balance;
    text-align: center;
}

.section-double-img__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 900px;
    margin: 2rem auto 0 auto;
}

.double-img-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.double-img-card__image {
    width: 100%;
    height: 100%;
    max-height: 280px;
    min-height: 100px;
}

.double-img-card__image img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.double-img-card__title {
    font-family: "Monteserrat", sans-serif;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    padding: 0;
    color: var(--c-noir-900);
    text-wrap-style: balance;
}

.double-img-card__description {
    font-size: 14px;
    color: var(--c-noir-500);
    text-align: justify;
}

/* Section image de fond */
.section-cards {
    margin-top: 0 !important;
}

.section-cards .wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: center;
}

.section-cards__container {
    border-radius: 40px;
    padding: 1.25rem 1.5rem;
}

.section-cards__row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.section-cards__container {
    /* Largeur proportionnelle au nombre d'items : 1+3 → 25%/75% */
    flex: var(--items, 1) 1 0;
    min-width: 240px;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
}

.section-cards__grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
    gap: 1rem;
}

.section-cards__grid[data-count="1"] {
    --cols: 1;
}

.section-cards__grid[data-count="2"] {
    --cols: 2;
}

.section-cards__grid[data-count="3"] {
    --cols: 3;
}

.section-cards__grid[data-count="4"] {
    --cols: 4;
}

@media (max-width: 768px) {
    .section-cards {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .section-cards .wrapper {
        padding: 1rem 1.25rem;
        box-sizing: border-box;
        max-width: 100%;
    }

    .section-cards__row {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .section-cards__container {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 1rem;
        border-radius: 12px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .section-cards__row {
        gap: 1rem;
    }

    .section-cards__grid {
        --cols: 2 !important;
        gap: 1rem;
    }

    /* 3 ou 4 items → carrousel horizontal scroll-snap, cards à la même
       largeur qu'en grid 2 colonnes (50% - moitié du gap) */
    .section-cards__grid[data-count="3"],
    .section-cards__grid[data-count="4"] {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .section-cards__grid[data-count="3"]::-webkit-scrollbar,
    .section-cards__grid[data-count="4"]::-webkit-scrollbar {
        display: none;
    }

    .section-cards__grid[data-count="3"] .section-cards__item,
    .section-cards__grid[data-count="4"] .section-cards__item {
        flex: 0 0 calc(50% - 0.5rem);
        min-width: calc(50% - 0.5rem);
        scroll-snap-align: start;
    }

    /* Flèches de navigation (injectées en JS quand carousel actif) */
    .section-cards__nav {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1rem;
        margin-top: 1rem;
    }

    .section-cards__nav-btn,
    .section-cards__nav-btn:hover,
    .section-cards__nav-btn:focus,
    .section-cards__nav-btn:active,
    .section-cards__nav-btn:focus-visible {
        background: rgba(0, 0, 0, 0.5) !important;
        border: 0 !important;
        box-shadow: none !important;
        outline: none !important;
        color: #fff !important;
    }

    .section-cards__nav-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        padding: 0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: opacity .2s ease, background-color .2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .section-cards__nav-btn:disabled,
    .section-cards__nav-btn[disabled] {
        opacity: .3;
        cursor: default;
        pointer-events: none;
    }

    .section-cards__nav-btn svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
        pointer-events: none;
    }
}

/* Hide nav arrows on desktop (visible only sous 768px via media query ci-dessus) */
@media (min-width: 769px) {
    .section-cards__nav {
        display: none !important;
    }
}

    .section-cards__item {
        max-width: none;
    }

    .section-cards__icone {
        width: 100%;
        max-width: 110px;
        height: 100px;
    }

    .section-cards__surtitre {
        font-size: 11px;
        line-height: 1.2;
    }

    .section-cards__titre {
        font-size: 16px;
        margin-bottom: .25rem;
    }

    .section-cards__description {
        font-size: 12px;
        line-height: 1.4;
    }
}

.section-cards__item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    text-align: center;
}

.section-cards__icone {
    width: 100%;
    max-width: 140px;
    height: 120px;
    margin: 0 auto .5rem;
}

.section-cards__icone img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.section-cards__grid:has(.section-cards__icone) .section-cards__item:not(:has(.section-cards__icone)) {
    justify-content: center;
}

.section-cards__surtitre {
    font-size: 16px;
    font-weight: 400;
    text-align: center;
}

.section-cards__titre {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: .5rem;
    text-align: center;
}

.section-cards__description,
.section-cards__description p {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--c-noir-500);
    text-align: center;
}

/* Section texte */
.section-texte .wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-texte__title {
    font-family: "Monteserrat", sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--c-vert-100);
    margin: 0;
    padding: 0;
    text-wrap-style: balance;
}

.section-texte__content {
    margin-top: 1rem;
    font-weight: 500;
}

.section-texte__content * {
    color: var(--c-noir-900);
    font-size: 16px;
}

.section-texte__content h1,
.section-texte__content h2,
.section-texte__content h3 {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.section-texte__content h4,
.section-texte__content h5,
.section-texte__content h6 {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
}

.section-texte__content a {
    color: var(--c-orange-900);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

/* Section — Conseil */
.section-conseil .wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background-color: rgb(236 160 38 / 0.2);
    border-radius: 0 40px 40px 0;
}

.section-conseil .wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: rgb(236 160 38 / 0.2);
}

.section-conseil__title {
    font-family: "Monteserrat", sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--c-vert-900);
    margin: 0 0 1rem 0;
    padding: 0;
    text-wrap-style: balance;
}

.section-conseil__content {
    position: relative;
}

.section-conseil__quote-top {
    position: absolute;
    top: -20px;
    left: -10px;
    width: 40px;
    height: fit-content;
    z-index: 1;
    pointer-events: none;
    fill: var(--c-bleu-500);
    stroke: var(--c-bleu-500);
}

.section-conseil__quote-bottom {
    position: absolute;
    bottom: -20px;
    right: -10px;
    width: 40px;
    height: fit-content;
    z-index: 1;
    pointer-events: none;
    fill: var(--c-bleu-500);
    stroke: var(--c-bleu-500);
}

.section-conseil__content * {
    color: var(--c-noir-900);
    font-size: 16px;
    font-weight: 600;
}

.section-conseil__content img {
    width: 100%;
    height: auto;
}

.section-conseil__cta {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.petale-verte {
    position: absolute;
    bottom: 50%;
    left: 150px;
    width: 180px;
    z-index: 1;
    mix-blend-mode: multiply;
}

.petale-marron {
    position: absolute;
    width: 400px;
    height: 270px;
    bottom: 50%;
    transform: translateY(50%);
}

.section-conseil__dl {
    position: absolute;
    bottom: 50%;
    transform: translateY(50%);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1;
    color: #FFFFFF;
    font-size: 18px;
    max-width: 300px;
    text-align: center;
    text-decoration: none;
    transition: color .2s ease-in-out;
}

.section-conseil__dl span:nth-child(2) {
    font-weight: 700;
}

.section-conseil__dl:hover {
    color: var(--c-vert-300);
}

.section-conseil__dl svg {
    position: absolute;
    bottom: -40px;
}

.section-conseil__mention {
    position: absolute;
    bottom: -30px;
    right: 40px;
    font-size: 14px;
}

.related-filiere .wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.related-filiere__title {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    font-family: "Monteserrat", sans-serif;
    color: var(--c-noir-900);
    margin: 0 auto 2rem auto;
    max-width: 700px;
    text-wrap-style: balance;
}

.related-filiere__title span {
    color: var(--c-orange-500);
}

.related-filiere__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    column-gap: 2rem;
    row-gap: 4rem;
    margin: 4rem 0 0 0;
}

.filiere-card__image {
    position: relative;
}

.filiere-card__image--icon {
    position: absolute;
    top: -45px;
    left: 45px;
    width: 119px;
    height: 114px;
    object-fit: contain;
    object-position: center;
    transform: scale(.85);
    transform-origin: top left;
    z-index: 1;
    will-change: transform;
    transition: transform .2s ease-in-out;
}

.filiere-card__image--img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 346 / 212;
    object-fit: cover;
    -webkit-mask-image: url(/wp-content/themes/bmvcom/assets/images/filiere-card-mask.png);
    -webkit-mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: url(/wp-content/themes/bmvcom/assets/images/filiere-card-mask.png);
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
    mask-position: center;
    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0.4));
    will-change: transform;
    transition: transform .2s ease-in-out, filter .2s ease-in-out;
}

.filiere-card:hover .filiere-card__image--icon {
    transform: scale(.85) rotate(4deg);
}

.filiere-card:hover .filiere-card__image--img {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.3));
    transform: scale(1.05);
}

.filiere-card__body span {
    font-family: "Monteserrat", sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--c-noir-900);
}

.filiere-card__body h3 {
    font-family: "Monteserrat", sans-serif;
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0;
}

/* Bioagresseurs */
.bioagresseurs .wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.bioagresseurs--title {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    font-family: "Monteserrat", sans-serif;
    text-transform: uppercase;
    color: var(--c-noir-900);
    margin: 0 auto 2rem auto;
    max-width: 700px;
    text-wrap-style: balance;
}

.bioagresseurs--title span {
    color: var(--c-orange-500);
}

.bioagresseurs__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    align-items: start;
}

.bioagresseur {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
    color: var(--c-noir-900);
}

.bioagresseur--image {
    width: 100%;
    height: 220px;
    display: flex;
    overflow: hidden;
    margin-bottom: .5rem;
    border-top-left-radius: 60px;
    border-bottom-right-radius: 60px;
}

.bioagresseur--image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform .2s ease-in-out;
}

.bioagresseur:hover .bioagresseur--image img {
    transform: scale(1.05);
}

.bioagresseur--content__title {
    color: var(--c-noir-900);
    text-decoration: none;
    font-size: 18px;
    font-family: "Monteserrat", sans-serif;
    font-weight: 700;
    transition: color 0.2s ease-in-out;
    margin: 0 0 .5rem 0;
    line-height: 1;
}

.bioagresseur:hover .bioagresseur--content__title {
    color: var(--c-orange-500);
}

.bioagresseur--content__excerpt {
    line-height: 1.2;
    font-size: 14px;
    font-weight: 400;
}

.bioagresseur--content__showmore {
    color: var(--c-noir-900);
    font-size: 14px;
    padding: .5rem 2rem;
    border: 1px solid var(--c-noir-900);
    border-radius: 30px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.bioagresseur:hover .bioagresseur--content__showmore {
    background-color: var(--c-orange-500);
    color: #FFFFFF;
    border-color: var(--c-orange-500);
}

/* Section GoBack */
.section-goback .wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.section-goback__link {
    padding: 1rem 3rem;
    color: #FFFFFF;
    background-color: var(--c-violet-500);
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid var(--c-violet-500);
    border-radius: 0;
    transition: color .2s ease-in-out, background-color .2s ease-in-out;
}

.section-goback__link:hover {
    color: var(--c-violet-500);
    background-color: #FFFFFF;
}

@media screen and (max-width: 768px) {
    .hero-filiere__petale .filiere-item {
        transform: translateY(-50%) translateX(-10%) scale(.9);
    }

    .hero-filiere__petale {
        margin-bottom: -50px;
    }

    /* Section conseil : stack vertical, CTA contenue dans une hauteur fixe,
       pétale vert décoratif en haut-gauche, mention en flow juste après */
    .section-conseil .wrapper {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        padding: 2.5rem 1rem 2rem;
    }

    .section-conseil__cta {
        position: relative;
        height: 200px;
        margin: 0;
    }

    .petale-verte {
        display: none;
    }

    .petale-marron {
        width: 100%;
        max-width: 320px;
        height: 200px;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    .section-conseil__dl {
        position: absolute;
        bottom: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, 50%);
        font-size: 14px;
        max-width: 220px;
    }

    .section-conseil__dl svg {
        bottom: -32px;
    }

    .section-conseil__mention {
        position: static;
        bottom: auto;
        right: auto;
        text-align: center;
        max-width: 320px;
        margin: 0 auto;
        font-size: 13px;
        line-height: 1.4;
    }

    .section-introduction .wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Related filière : carrousel horizontal scroll-snap, 2 cards à demi visibles */
    .related-filiere__title {
        font-size: 1.4rem;
    }

    .related-filiere__grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        column-gap: 1rem;
        row-gap: 0;
        margin: 2rem -1rem 0;
        padding: 3rem 1.25rem 1rem;
        scroll-padding-left: 1.25rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .related-filiere__grid::-webkit-scrollbar {
        display: none;
    }

    .related-filiere__grid .filiere-card {
        flex: 0 0 70%;
        min-width: 70%;
        scroll-snap-align: start;
    }

    .related-filiere .filiere-card__image--icon {
        top: -30px;
        left: 25px;
        width: 80px;
        height: 77px;
    }

    .related-filiere .filiere-card__body span {
        font-size: 13px;
    }

    .related-filiere .filiere-card__body h3 {
        font-size: 16px;
    }

    .section-goback__link {
        padding: 1rem;
        font-size: 14px;
    }
}


.bioagresseur {
    position: relative;
}

.bioagresseur--filiere {
    position: absolute;
    top: 220px;
    left: 0;
    transform: translateY(-100%);
    z-index: 2;
    padding: .4rem 1.1rem;
    font-family: "Monteserrat", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    border-radius: 60px 0 60px 0;
    line-height: 1.2;
}
