.cpt {
    position: relative;
    text-align: center;

    .container.product {
        .teaser {
            position: relative;
            margin-top: 50px;

            .count {
                position: absolute;
                top: -50px;
                font-weight: var(--bold);
                font-size: 20px;
                color: var(--green-dark2);
            }
        }

    }

    .teaser:not(.type_product) {
        .count {
            display: none;
        }
    }

    .container.product {
        &.no-filters {
            .teaser.type_product {
                flex: 1;
            }
        }
    }

    .container.graine,
    .container.product {
        display: flex;
        gap: 80px;
        flex-direction: column;

        @media (min-width: 992px) {
            flex-direction: row;
        }

        .filtres_graines {
            background-color: var(--cream);
            flex: 0.25;
            padding: 15px 15px 40px 15px;
            height: fit-content;
            z-index: 1;

            li {
                &::before {
                    display: none !important;
                }
            }

            h5 {
                font-family: var(--curvy-font);
                font-style: italic;
                color: var(--green-dark2);
                background-color: var(--white);
                padding: 10px 20px;
                text-align: left;
            }

            .tabs {
                padding: 7px 20px;
                position: relative;

                &.open {
                    padding: 0px 20px 7px 20px;

                }

                h4 {
                    font-size: 14px;
                    font-family: var(--text-font);
                    color: var(--green-dark2);
                    text-transform: uppercase;
                    text-align: left;
                    display: flex;
                    justify-content: space-between;
                    margin: 0px;
                    cursor: pointer;
                    transition: all var(--transition);
                    background-color: var(--cream);
                    position: sticky;
                    top: 0px;
                    z-index: 9999999;
                    line-height: 20px;
                    padding-top: 10px;
                }

                &:not(.dispo_bio) {
                    h4 {
                        &:after {
                            content: "+";
                            font-size: 14px;
                            color: var(--red);
                            display: inline-block;
                            font-weight: var(--bold);
                            transition: all var(--transition);
                        }
                    }
                }

                &:not(.dispo_bio).open {
                    h4 {
                        &:after {
                            content: "-";
                        }
                    }
                }

                &:not(:last-child) {
                    border-bottom: 1px solid rgba(21, 41, 34, 0.15);
                    margin: 0px;
                }

                &.open {
                    max-height: 350px;
                    overflow-y: scroll;
                }

                ul {
                    padding: 0px;
                    margin: 0px;
                    overflow: hidden;
                    transition: max-height var(--transition);
                    display: block;
                    max-height: 0px;
                    margin-top: 6px;

                    li {
                        list-style: none;
                        text-align: left;
                        position: relative;

                        label {
                            display: flex;
                            align-items: center;
                            margin-bottom: 3px;
                            cursor: pointer;

                            .label_title {
                                opacity: 0.6;
                                color: var(--dark);
                                font-size: 14px;
                                margin: 0px;
                                transition: all var(--transition);
                                text-transform: capitalize;

                                &.checked,
                                &:hover {
                                    opacity: 1;
                                    font-weight: var(--bold);
                                }
                            }

                            input {
                                opacity: 0;
                                position: absolute;
                            }

                            input:checked+.custom_checkbox {
                                &:after {
                                    display: block;
                                    transition: all var(--transition);
                                }
                            }

                            input+.custom_checkbox {
                                background-color: var(--white);
                                border-radius: 3px;
                                height: 15px;
                                width: 15px;
                                display: inline-block;
                                margin-right: 7px;
                                position: relative;
                                transition: all var(--transition);

                                &:after {
                                    content: "";
                                    position: absolute;
                                    display: none;
                                    width: 9px;
                                    height: 9px;
                                    top: 3px;
                                    left: 3px;
                                    background-color: var(--red);
                                    transition: all var(--transition);
                                }
                            }
                        }
                    }
                }

                &.dispo_bio {
                    position: relative;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;

                    input {
                        display: none;
                    }

                    .toggle-switch .slider {
                        display: flex;
                        border-radius: 20px;
                        overflow: hidden;
                        cursor: pointer;
                        width: 76px;
                        height: 27px;
                        justify-content: space-between;
                        border: 2px solid var(--white);
                        position: relative;
                    }

                    .toggle-switch .option {
                        flex: 1;
                        text-align: center;
                        transition: background-color 0.3s, color 0.3s;
                        font-size: 12px;
                        line-height: 20px;
                        position: relative;
                    }

                    .glider {
                        position: absolute;
                        top: 0;
                        bottom: 0;
                        width: 47%;
                        background-color: var(--green-soft);
                        border-radius: 18px;
                        transition: transform 0.3s ease, background-color 0.3s ease;
                        margin: 2px 0px 2px 0px;
                        z-index: 1;
                    }

                    /* Quand checkbox est cochée (Oui actif) */
                    input:checked+.slider {
                        background-color: var(--green-soft);

                        .non {
                            color: var(--white);
                            margin-right: -2px;
                            border-radius: 10px;
                            z-index: 2;
                            font-weight: var(--regular);
                            opacity: 0.6;
                        }

                        .oui {
                            color: var(--green-soft);
                            margin: 0px;
                            border-radius: 10px;
                            font-weight: var(--bold);
                            margin-left: -3px;
                        }

                        .glider {
                            transform: translateX(-100%);
                            background-color: var(--white);
                        }
                    }

                    /* Quand checkbox est décochée (Non actif) */
                    input:not(:checked)+.slider {
                        background-color: var(--orange);

                        .oui {
                            color: var(--white);
                            margin: 1px;
                            border-radius: 10px;
                            margin-left: 1px;
                            opacity: 0.6;
                            font-weight: var(--regular);
                        }

                        .non {
                            color: var(--orange);
                            margin: 2px;
                            border-radius: 10px;
                            margin-right: -3px;
                        }

                        .glider {
                            transform: translateX(100%);
                            background-color: var(--white);
                        }
                    }
                }
            }

            .reset {
                margin-top: 20px;

                .reset_filters {
                    border: 0px;
                    background: 0px;
                    font-family: var(--text-font);
                    color: var(--green-dark2);
                    display: flex;
                    width: 100%;
                    justify-content: center;
                    gap: 6px;
                    align-items: center;
                    transition: all var(--transition);

                    &:before {
                        content: '';
                        background-image: url('../../img/reset.svg');
                        width: 20px;
                        height: 20px;
                        display: inline-block;
                        transition: all var(--transition);
                    }

                    &:hover {
                        color: var(--red);

                        &:before {
                            transform: rotate(-60deg);
                            filter: brightness(0) saturate(100%) invert(23%) sepia(100%) saturate(2214%) hue-rotate(350deg) brightness(93%) contrast(84%);
                        }
                    }
                }
            }
        }

        .teaser.type_graine,
        .teaser.type_product {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 40px;
            flex: 0.75;
            height: 100%;

            article {
                max-height: 500px;
                min-height: 450px;
            }

            .teaser__link {
                display: -webkit-box;
                display: -ms-flexbox;
                display: flex;
                -webkit-box-orient: vertical;
                -webkit-box-direction: normal;
                -ms-flex-direction: column;
                flex-direction: column;
                height: 100%;
                overflow: hidden;
                position: relative;
                text-decoration: none;
                box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
                padding: 15px;
                text-align: left;
                transition: all var(--transition);
                background-color: var(--white);
                max-height: 500px;

                .teaser__text {
                    padding: 20px;
                    display: flex;
                    flex-direction: column;
                    gap: 40px;
                    justify-content: space-between;
                    height: 50%;

                    @media (min-width: 992px) {
                        max-height: 350px;
                    }

                    h2 {
                        font-size: 22px;
                        line-height: 30px;
                        font-family: var(--title-font-hdp);
                        color: var(--green-dark1);
                        text-transform: uppercase;

                        @media (min-width: 992px) {
                            font-size: 28px;
                            line-height: 38px;
                        }
                    }

                    .teaser__slogan {
                        font-family: var(--curvy-font);
                        color: var(--green-dark2);
                    }
                }


                .teaser__image {
                    overflow: hidden;
                    height: 50%;
                    position: relative;
                    display: flex;
                    justify-content: center;

                    .nouveau {
                        background-color: var(--white);
                        width: fit-content;
                        padding: 0px 0px 5px 10px;
                        color: var(--orange);
                        font-weight: var(--bold);
                        font-size: 14px;
                        font-family: var(--text-font);
                        position: absolute;
                        right: 0px;
                        text-transform: uppercase;
                        border-radius: 0px 0px 0px 8px;
                        z-index: 999;
                    }

                    img {
                        display: block;
                        -o-object-fit: cover;
                        object-fit: cover;
                        -webkit-transition: all 0.3s;
                        transition: all 0.3s;
                        height: 100%;
                        width: 100%;
                        z-index: 2;
                    }
                }

                @media (min-width: 992px) {
                    &:hover {
                        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);

                        .teaser__image img {
                            -webkit-transform: scale(1.1);
                            transform: scale(1.1);
                        }

                        .teaser__more {
                            text-decoration: underline;
                        }
                    }
                }
            }
        }
    }
}

.cpt {
    .section__btn {
        display: flex;
        justify-content: center;
    }

    .teaser {
        &.w_pagination {
            position: relative;
            margin-bottom: 80px;

            @media (max-width: 992px) {
                margin-bottom: 200px;
            }

            .wp-pagenavi {
                position: absolute;
                bottom: -120px;
                width: 100%;
                border: 0px;
                transition: all var(--transition);

                @media (max-width: 992px) {
                    bottom: -210px;
                }

                .pages {
                    display: none;
                }

                .current,
                span.current {
                    background-color: var(--green-dark1);
                    border: var(--green-dark1);
                    transition: all var(--transition);

                }

                .extend {
                    border: 0px;
                }

                .previouspostslink,
                .nextpostslink {
                    margin: 4px 0px 0px 0px;
                }

                .last,
                .first {
                    padding: 7px 15px;
                }

                .last,
                .first,
                .page.larger,
                .page.smaller,
                .nextpostslink,
                .previouspostslink {
                    color: var(--green-dark1);
                    border: 1px solid var(--green-dark1);
                    transition: all var(--transition);

                    &:hover {
                        background-color: var(--red);
                        color: var(--white);
                        border: 1px solid var(--red);

                    }
                }
            }
        }
    }
}

.teaser:not(.type_graine, .type_product) {
    padding: 0;
    position: relative;
    z-index: 2;
    justify-content: space-evenly;
    display: grid;
    gap: 40px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    place-items: center;

    @media (min-width: 1400px) {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    }

    .teaser__item {
        max-width: 360px;
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
        transition: all var(--transition);
        padding: 15px 15px 35px 15px;
        height: 100%;
        min-width: 100%;

        &:hover {
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);

            .teaser__image img {
                -webkit-transform: scale(1.1);
                transform: scale(1.1);
            }

            .teaser__more {
                text-decoration: underline;
            }
        }
    }

    .teaser__link {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
        position: relative;
        text-decoration: none;
    }

    .teaser__image {
        overflow: hidden;
        height: 260px;
    }

    .teaser__image img {
        display: block;
        -o-object-fit: cover;
        object-fit: cover;
        -webkit-transition: all 0.3s;
        transition: all 0.3s;
        width: 100%;
        height: 100%;
    }

    .teaser__text {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-flex: 1;
        -ms-flex: 1;
        flex: 1;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        position: relative;
        padding: 0px 15px;
        transition: all var(--transition);
        justify-content: space-around;
        text-align: left;
    }

    .teaser__text p {
        position: absolute;
        top: -35px;
        background-color: var(--white);
        padding: 15px 20px 0px 15px;
        border-radius: 0px 10px 0px 0px;
        text-transform: uppercase;
        color: var(--green-dark2);
        font-size: 14px;
        left: 0;
        transition: all 0.3s;
    }

    .teaser__title {
        color: var(--green-dark2);
        font-family: var(--curvy-font);
        -webkit-transition: all 0.3s;
        transition: all var(--transition);
        padding: 20px 0px;
        margin: 0px;
        font-weight: var(--regular);
    }
}

.teaser__item.nopostsfound {
    justify-self: center;
    text-align: center;
    width: 100%;
}