.subcategory {
    padding-top: 165px;
}
.subcategory__wrapper .filters {
    margin-top: 40px;
    background-color: #eff3ff;
    padding: 40px 50px;
    border-radius: 10px;
}
.subcategory__wrapper .filters__title {
    font-weight: 700;
    font-size: 18px;
    color: #021549;
}
.subcategory__wrapper .filters__wrapper {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
}
.subcategory__wrapper .filters__box {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    width: 100%;
}
.subcategory__wrapper .filters__box-reset {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.subcategory__wrapper .filters__box-reset span {
    font-size: 16px;
    color: #6a7d94;
}
.subcategory__wrapper .filters__box-item {
    width: 100%;
    position: relative;
    border: none;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    max-height: 40px;
    cursor: pointer;
    background-color: #fff;
}
.subcategory__wrapper .filters__box-item span {
    overflow-x: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.subcategory__wrapper .filters__box-item .arrow {
    width: 9px;
    height: 9px;
    border-left: 1px solid #021549;
    border-bottom: 1px solid #021549;
    transform: rotate(-45deg);
    transition: all 0.2s ease;
}
.subcategory__wrapper .filters__box-item.open .arrow {
    transform: rotate(135deg);
}
.subcategory__wrapper .filters__dropdown {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    background-color: #fff;
    border: none;
    border-top: 0;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    z-index: 10;
    padding: 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 160px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #850003 #8b8b91;
}
.subcategory__wrapper .filters__dropdown::-webkit-scrollbar {
    width: 2px;
    border-radius: 3px;
}
.subcategory__wrapper .filters__dropdown::-webkit-scrollbar-track {
    background: #8b8b91;
    border-radius: 3px;
}
.subcategory__wrapper .filters__dropdown::-webkit-scrollbar-thumb {
    background-color: #850003;
    border-radius: 3px;
}
.subcategory__wrapper .filters__dropdown label {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.subcategory__wrapper .filters__dropdown label input[type="checkbox"] {
    accent-color: #850003;
}
.subcategory__wrapper .filters__dropdown.hidden {
    display: none;
}
.subcategory__wrapper .filters__search {
    position: sticky;
    top: 0;
    background: #fff;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #dfe4f3;
}
.subcategory__wrapper .filters__search-input {
    width: 100%;
    height: 34px;
    padding: 6px 10px;
    border: 1px solid #dfe4f3;
    border-radius: 4px;
    font-size: 14px;
}
.subcategory__showmore {
    margin-top: 30px;
}
.subcategory__showmore-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    background-color: rgba(0, 0, 0, 0);
    border: 1px solid #dfe4f3;
    border-radius: 5px;
    color: #021549;
    text-decoration: underline;
    cursor: pointer;
}
.subcategory__showmore-button:hover {
    background-color: #f9faff;
}
.subcategory .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #021549;
    font-size: 20px;
    margin-top: 30px;
}
.subcategory .pagination__num {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}
.subcategory .pagination__num:hover {
    color: #fff;
    background-color: #850003;
}
.subcategory .pagination__num.current {
    color: #fff;
    background-color: #850003;
}
.subcategory .pagination .arrow {
    width: 9px;
    height: 9px;
    border-left: 1px solid #021549;
    border-bottom: 1px solid #021549;
}
.subcategory .pagination .arrow:hover {
    border-left: 1px solid #021549;
    border-bottom: 1px solid #021549;
    cursor: pointer;
}
.subcategory .pagination .arrow-left {
    transform: rotate(45deg);
}
.subcategory .pagination .arrow-right {
    transform: rotate(-135deg);
}
.subcategory__products {
    margin-top: 40px;
}
.subcategory__products-title {
    color: #7898a1;
    font-size: 16px;
}
.subcategory__products-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}
.subcategory__product {
    display: grid;
    grid-template-areas: "image title title title price btn" "image chars chars chars counter .";
    padding: 20px;
    border-radius: 10px;
    column-gap: 16px;
    border: 1px solid #dfe4f3;
    grid-template-columns: 85px 1fr 1fr 1fr 150px 45px;
    transition: all 0.3s ease;
}
.subcategory__product-img {
    grid-area: image;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 2px;
}
.subcategory__product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.subcategory__product-title {
    grid-area: title;
    font-size: 18px;
    font-weight: 700;
}
.subcategory__product-chars {
    grid-area: chars;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 20px;
    row-gap: 10px;
}
.subcategory__product-chars .char {
    font-size: 14px;
    color: #8b8b91;
    font-weight: 400;
}
.subcategory__product-chars .char span {
    color: #021549;
}
.subcategory__product-price {
    grid-area: price;
    font-size: 16px;
}
.subcategory__product-counter {
    grid-area: counter;
    display: flex;
    gap: 2px;
}
.subcategory__product-counter .minus,
.subcategory__product-counter .plus {
    background-color: #f9faff;
    width: 40px;
    height: 35px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.subcategory__product-counter input {
    width: 50px;
    height: 35px;
    border: none;
    outline: none;
    background-color: #f9faff;
    padding: 5px;
    text-align: center;
}
.subcategory__product .addtocart {
    grid-area: btn;
    width: 44px;
    height: 44px;
    border: none;
    outline: none;
    background-color: #021549;
    padding: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
}
.subcategory__product .addtocart::after {
    content: "";
    position: absolute;
    right: -4px;
    top: -5px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    z-index: 2;
    display: none;
}
.subcategory__product .addtocart::before {
    content: "";
    position: absolute;
    right: 2px;
    top: -1px;
    width: 7px;
    height: 10px;
    border-bottom: 2px solid #850003;
    border-right: 2px solid #850003;
    z-index: 3;
    transform: rotate(45deg);
    display: none;
}
.subcategory__product.purchased {
    background-color: #eff3ff;
}
.subcategory__product.purchased .addtocart {
    background-color: #850003;
}
.subcategory__product.purchased .addtocart::after {
    display: block;
}
.subcategory__product.purchased .addtocart::before {
    display: block;
}
@media screen and (max-width: 992px) {
    .subcategory__wrapper .filters__box {
        grid-template-columns: repeat(3, 1fr);
    }
    .subcategory__wrapper .filters {
        padding: 30px 20px;
    }
    .subcategory__wrapper .filters__title {
        font-size: 16px;
    }
    .subcategory__product {
        grid-template-areas: "image title title price btn" "image chars chars counter ." ". chars chars . . " ". chars chars . .";
        width: 100%;
        grid-template-columns: 85px 1fr 1fr 136px 45px;
    }
    .subcategory__product-chars {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        row-gap: 8px;
    }
    .subcategory__product-title {
        font-size: 16px;
    }
    .subcategory .pagination {
        font-size: 16px;
    }
    .subcategory .pagination__num {
        width: 30px;
        height: 30px;
    }
}
/* @media screen and (max-width: 692px) {
    .subcategory__wrapper .filters__box {
        grid-template-columns: 100%;
    }
    .subcategory__product {
        grid-template-areas: "image . ." "image . ." "title title title" "chars chars chars" "chars chars chars" "chars chars chars" "price price ." "counter . btn";
        row-gap: 16px;
        column-gap: 10px;
        grid-template-columns: 85px 1fr 1fr;
    }
    .subcategory__product .addtocart {
        align-self: end;
        justify-self: end;
    }
    .subcategory__product-chars .char {
        font-size: 12px;
    }
    .subcategory__product-price {
        font-size: 14px;
    }
    .subcategory__product {
        padding: 10px;
    }
    .subcategory__wrapper .filters__wrapper {
        max-height: 0;
        overflow: hidden;
        margin-top: 0;
        transition: max-height 0.3s ease;
    }
    .subcategory__wrapper .filters__title {
        position: relative;
        z-index: 1;
    }
    .subcategory__wrapper .filters__title::after {
        content: "";
        position: absolute;
        top: 30%;
        right: 10px;
        width: 10px;
        height: 10px;
        border-bottom: 2px solid #021549;
        border-right: 2px solid #021549;
        z-index: 5;
        transform: rotate(45deg);
        transition: transform 0.2s ease;
    }
    .filters.is-open .filters__title::after {
        transform: rotate(225deg);
    }
    .filters.is-open .filters__wrapper {
        margin-top: 16px;
    }
} */

@media screen and (max-width: 692px) {

        .subcategory__wrapper .filters__box {
        grid-template-columns: 100%;
    }
    .subcategory__product {
        grid-template-areas: "image . ." "image . ." "title title title" "chars chars chars" "chars chars chars" "chars chars chars" "price price ." "counter . btn";
        row-gap: 16px;
        column-gap: 10px;
        grid-template-columns: 85px 1fr 1fr;
    }
    .subcategory__product .addtocart {
        align-self: end;
        justify-self: end;
    }
    .subcategory__product-chars .char {
        font-size: 12px;
    }
    .subcategory__product-price {
        font-size: 14px;
    }
    .subcategory__product {
        padding: 10px;
    }

    .subcategory__wrapper .filters__title {
        position: relative;
        cursor: pointer;
        padding-right: 30px;
        user-select: none;
    }
    
    .subcategory__wrapper .filters__title::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 10px;
        width: 10px;
        height: 10px;
        border-bottom: 2px solid #021549;
        border-right: 2px solid #021549;
        transform: translateY(-50%) rotate(45deg);
        transition: transform 0.3s ease;
    }
    
    .filters.is-open .filters__title::after {
        transform: translateY(-50%) rotate(225deg);
    }

    .subcategory__wrapper .filters__wrapper {
        max-height: 0;
        overflow: hidden;
        margin-top: 0;
        transition: max-height 0.3s ease;
        /* Assurer que le contenu est visible quand ouvert */
        opacity: 1;
        visibility: visible;
    }
    
    .filters.is-open .filters__wrapper {
        margin-top: 16px;
        /* Ajouter un padding bottom pour s'assurer que tout le contenu est visible */
        padding-bottom: 20px;
    }
    
    .subcategory__wrapper .filters__box {
        grid-template-columns: 100%;
        gap: 15px;
    }
    
    .subcategory__wrapper .filters__box-item {
        max-height: none;
        min-height: 40px;
    }
    
    .subcategory__wrapper .filters__dropdown {
        max-height: 200px; /* Augmenter si nécessaire */
        z-index: 1000; /* S'assurer qu'il est au-dessus */
    }
    
    /* S'assurer que le dernier élément n'est pas coupé */
    .filters__box-reset {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #dfe4f3;
    }
}


.filter-tooltip {
    position: fixed;
    background-color: #2c3e50;
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0; 
    transform: translateY(10px); 
    transition: opacity 0.2s ease, transform 0.2s ease; 
}

.filter-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}



.filters__dropdown label {
    position: relative;
    display: block;
}

.disabled-filter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    cursor: not-allowed;
    z-index: 2;
}




.active-filters {
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #e0e6ed;
    border-bottom: 1px solid #e0e6ed;
}

.active-filters__container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.active-filter {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: #eff3ff;
    border: 1px solid #bacade;
    border-radius: 30px;
    font-size: 14px;
    color: #16224a;
}

.active-filter__remove {
    margin-left: 8px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.active-filter__remove svg {
    transition: fill 0.2s ease;
}

.active-filter__remove:hover svg {
    fill: #228aed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .active-filters {
        padding: 12px 0;
    }
    
    .active-filter {
        padding: 5px 10px;
        font-size: 13px;
    }
}

.search-results__title {
    margin-top: 60px;
    font-size: 24px;
    font-weight: 700;
}
.search-results__title span {
    font-size: 18px;
    font-weight: 400;
}
@media screen and (max-width: 992px) {
    .search-results__title {
        font-size: 20px;
        margin-top: 40px;
    }
    .search-results__title span {
        font-size: 16px;
    }
}