.categories-name {
    margin-bottom: 40px;
}

.categories-content {
    display: grid;
    grid-template-columns: 244px 1fr;
    gap: 36px;
}

.count-of-products {
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 40px;
}

.filter-title {
    font-size: 16px;
    font-weight: 900;
    line-height: 115%;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.applied-filters-content > div {
    background-color: var(--light-gray);
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 6px 12px;
}

.applied-filters-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.applied-filters-content > div > img {
    height: 12px;
    width: 12px;
}

.filter-group {
    margin-bottom: 40px;
}

.filter-group > div > div:not(:last-child),
.filter-group > form > div:not(:last-child),
.filter-group-content > div:not(:last-child){
    margin-bottom: 12px;
}

.filter-group > div, .filter-group > form, .filter-group-content {
    overflow: hidden;
}

.filtering-group {
    display: flex;
    justify-content: space-between;
}

.filtering-group .count {
    color: #8B8B8B;
}

.filtering-group .name {
    display: flex;
    align-items: center;
}

.brands-search {
    display: flex;
    background-color: var(--light-gray);
    gap: 12px;
    padding: 12px 0 12px 16px;
    margin-bottom: 24px;
}

.brands-search input {
    border: none;
    outline: none;
    background-color: var(--light-gray);
    width: 100%;
    padding-right: 16px;
    box-sizing: border-box;
}

.filter-form .container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 20px;
    width: 20px;
}

.checkmark {
    height: 20px;
    width: 20px;
    box-sizing: border-box;
    border: 1px solid #111;
    display: flex;
    align-items: center;
}

.container input:checked ~ .checkmark {
    background-color: #111;
}

.checkmark img {
    margin-left: 2px;
    height: 14px;
    width: 14px;
}

.filter-form .filtering-group{
    justify-content: initial;
    gap: 12px;
}

.categories-title {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.categories-title h1 {
    font-size: 32px;
}

.categories-sorting > p {
    font-size: 16px;
    color: #8B8B8B;
    display: flex;
    align-items: center;
}

.categories-sorting {
    display: flex;
    gap: 8px;
}

.sorting-variants {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sorting-variants img {
    height: 24px;
    width: 24px;
}

.category-products {
    margin-bottom: 80px;
}

.categories-content {
    margin-bottom: 140px;
}

.filter-group div:last-child, .filter-group form:last-child {
    max-height: 1000px !important;
    -webkit-transition: max-height 0.5s;
    -moz-transition: max-height 0.5s;
    -ms-transition: max-height 0.5s;
    -o-transition: max-height 0.5s;
    transition: max-height 0.5s;
    overflow: hidden !important;
}

.filter-group div.hidden:last-child, .filter-group form.hidden:last-child {
    max-height: 0 !important;
}

.filter-group.hidden {
    margin-bottom: 0;
    -webkit-transition: margin-bottom 0.5s;
    -moz-transition: margin-bottom 0.5s;
    -ms-transition: margin-bottom 0.5s;
    -o-transition: margin-bottom 0.5s;
    transition: margin-bottom 0.5s;
}

.filter-title img, .filter-title.hidden img {
    animation-duration: 0.5s;
    animation-fill-mode: forwards;
}

.filter-title.hidden img {
    animation-name: hide-filter-group;
}

.filter-title img {
    animation-name: display-filter-group;
}

.applied-filters-content > div {
    margin-bottom: 0 !important;
}

.product-image__wrapper > .category-product__image {
    max-width: calc((1260px - 352px) / 4);
    max-height: calc((1260px - 352px) / 4);
}


.sorting-dropdown-wrapper {
    position: absolute;
    width: 165px;
    transform: translate(0, 45px);
    z-index: 1;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sorting-dropdown {
    border: 1px solid black;
    background-color: white;
    padding: 0 20px;
    border-radius: 4px;
    width: 158px;
    height: 136px;
}

.sorting-link {
    font-size: 14px;
    padding: 8px 0;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 10px;
}

@media (max-width: 1340px) {
    .product-image__wrapper > .category-product__image {
        max-height: calc((1260px - 352px) / 3);
        max-width: calc((1260px - 352px) / 3);
    }
}

@media (max-width: 1292px) {
    .product-image__wrapper > .category-product__image {
        max-height: calc((100vw - 32px - 352px) / 3);
        max-width: calc((100vw - 32px - 352px) / 3);
    }
}

@media (max-width: 1080px) {
    .product-image__wrapper > .category-product__image {
        max-height: calc((100vw - 32px - 352px) / 2);
        max-width: calc((100vw - 32px - 352px) / 2);
    }
}

/* 244px 32px */

@media (max-width: 990px) {
    .product-image__wrapper > .category-product__image {
        max-height: calc((100vw - 32px) / 2);
        max-width: calc((100vw - 32px) / 2);
    }
}

@keyframes hide-filter-group {
    from { transform: rotate(0deg); }
    to { transform: rotate(90deg ); }
}

@keyframes display-filter-group {
    from { transform: rotate(90deg); }
    to { transform: rotate(0deg ); }
}

@media (max-width: 990px) {
    .categories-content {
        display: block;
    }

    .page-wrapper {
        padding: 0 16px;
    }

    .categories-filter {
        position: fixed;
        background-color: white;
        width: calc(100vw - 32px);
        top: 0;
        left: -100vw;
        z-index: 10000;
        padding: 24px 16px;
        height: calc(100vh - 48px);
        overflow-y: scroll;
        transition: max-width 0.5ms;
    }

    .category-products {
        grid-template-columns: 1fr 1fr;
    }

    .category-products > div > .product-image {
        width: 100%;
    }

    .heart-wrapper {
        width: calc((100% - 48px) / 2);
    }

    .category-products > div > p {
        font-size: 14px;
    }

    .category-products > div > p.author {
        margin-top: 16px;
    }

    .category-products > div > p:not(:last-child) {
        margin-bottom: 8px;
    }

    .category-products {
        margin-bottom: 60px;
    }

    .categories-products .button-wrapper .button {
        width: 100%;
        padding: 14px 40px;
        font-size: 14px;
        font-weight: 500;
    }

    .mobile-filter {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .mobile-filter p span, .mobile-filter p {
        font-size: 14px;
    }

    .categories-sorting > p {
        font-size: 14px;
    }

    .sorting-variants .sorting-value {
        font-size: 14px;
    }

    .categories-products h1 {
        font-size: 24px;
        padding: 24px 0;
    }

    .mobile .applied-filters .applied-filters-content > div p {
        font-size: 14px;
    }

    .mobile .applied-filters .applied-filters-content > div {
        padding: 12px;
    }

    .applied-filters-content > div > img {
        height: 12px;
        width: 12px;
    }

    .mobile .applied-filters {
        margin-bottom: 24px;
    }

    .items-count.mobile {
        margin-bottom: 12px;
    }

    .mobile.items-count, .mobile.items-count span {
        font-size: 14px;
    }

    .mobile.items-count span {
        color: #8B8B8B;
    }

    .categories-title {
        margin-bottom: 24px;
    }

    .mobile .filter-title p {
        font-size: 24px;
        font-weight: 900;
        line-height: 115%;
    }

    .mobile .filter-title {
        display: flex;
        width: 100%;
        justify-content: space-between;
        margin-bottom: 32px;
    }

    .mobile .filter-title img {
        height: 20px;
        width: 20px;
        margin-right: 2px;
    }

    .filter-title span {
        font-size: 20px;
        line-height: 115%;
    }

    .filter-title {
        margin-bottom: 24px;
    }

    .filtering-group {
        justify-content: initial;
        gap: 6px;
    }

    .filtering-group p {
        font-size: 16px;
    }

    .filter-group {
        margin-bottom: 40px;
    }

    .filter-group > div > div:not(:last-child),
    .filter-group > form > div:not(:last-child),
    .filter-group-content > div:not(:last-child) {
        margin-bottom: 16px;
    }

    .checkmark {
        height: 20px;
        width: 20px;
    }

    .checkmark img {
        height: 14px;
        width: 14px;
        margin-left: 2px;
    }

    .stories.filter-group {
        margin-bottom: 0;
    }

    .filter-form .filtering-group {
        gap: 12px;
    }

    .brands-search input {
        font-size: 14px;
        font-weight: 400;
        padding-left: 12px;
    }

    .brands-search {
        gap: 0;
        padding: 10px 16px;
    }

    .categories-filter.opened {
        animation-name: open-filters;
        animation-fill-mode: forwards;
        animation-duration: 0.4s;
    }

    .categories-filter.closed {
        animation-name: hide-filters;
        animation-fill-mode: forwards;
        animation-duration: 0.4s;
    }

    .filter-form.hidden input {
        display: none;
    }

    @keyframes open-filters {
        from {
            left: -100vw;
        }
        to {
            left: 0;
        }
    }

    @keyframes hide-filters {
        from {
            left: 0;
        }
        to {
            left: -100vw;
        }
    }
}
