section.brands {
    margin-top: 100px;
    margin-bottom: 100px;

    .brands__wrap {
        display: flex;
        column-gap: 40px;
    }

    .brands__header {
        margin-bottom: 50px;
    }

    .brands__sidebar {
        width: 260px;
        flex-shrink: 0;
    }

    .brands__result {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        row-gap: 60px;
    }

    .brands__title {
        color: var(--Base-Dark, #171717);
        font-size: 40px;
        font-style: normal;
        font-weight: 500;
        line-height: 100%;
        letter-spacing: 0.8px;
    }

    .brands__info {
        display: flex;
        column-gap: 30px;
        margin-bottom: 50px;
    }

    .brands__count {
        color: var(--Gray-6, #9A9AA2);
        font-size: 16px;
        font-style: normal;
        font-weight: 400;
        line-height: 100%;
        letter-spacing: 0.16px;
        align-self: flex-end;
        margin-bottom: 6px;
    }

    .brands__control {
        display: flex;
        align-items: center;
    }

    .brands__sort {
        margin-left: auto;

        .custom-select__wrapper {
            border: none;
            
            .custom-select__active {
                min-height: auto;
                padding: 0px;
            }
        }
    }

    .brands__views {
        margin-left: 32px;
        display: flex;
        align-items: center;

        .brands__view {
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            fill: var(--Gray-6, #9A9AA2);

            &:not(:last-child) {
                position: relative;
                margin-right: 12px;
                padding-right: 12px;
            }

            &:not(:last-child):after {
                content: "";
                position: absolute;
                right: 0;
                height: 100%;
                width: 1px;
                background-color: var(--Gray-2, #F2F2F2);
            }

            &.active {
                fill: var(--Gray-8---Main, #383838);
                pointer-events: none;
            }
        }
    }

    .brands__items {
        display: flex;
        flex-wrap: wrap;
        column-gap: 34px;
        row-gap: 60px;
    }

    .brands__footer {
        margin-top: auto;
        align-self: center;
    }
}

.brand {
    flex: 1 0 calc(33.333% - 30px);
    max-width: 304px;

    .brand__card {
        position: relative;
        width: 100%;
        min-height: 200px;
        border-radius: 8px;
        border: 1px solid #FAFAFA;
        background-color: #FAFAFA;
        perspective: 1000px;

        .brand__card-front,
        .brand__card-back {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            backface-visibility: hidden;
            border-radius: 8px;
            overflow: hidden;
            transition: transform 0.6s ease;
        }

        .brand__card-front {
            z-index: 2;
            transform: rotateY(0deg);
        }

        .brand__card-back {
            background-color: #45080D;
            transform: rotateY(180deg);
            padding: 16px;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .brand__card-wishlist {
            display: inline-flex;
            width: 28px;
            height: 28px;
            fill: transparent;
            stroke: var(--Gray-6, #9A9AA2);
            cursor: pointer;
            transition: opacity .3s ease;
            position: absolute;
            top: 20px;
            right: 20px;
            z-index: 9;

            &:hover {
                fill: var(--Dark-wine-1, #92111C);
                stroke: var(--Dark-wine-1, #92111C);
                opacity: .6;
            }

            &.active {
                fill: var(--Dark-wine-Main, #45080D);
                stroke: var(--Dark-wine-Main, #45080D);
                opacity: 1;
                animation: wishlist__pulse .3s ease-in-out;
            }
        }

    }

    &:hover {
        .brand__card-front {
            transform: rotateY(-180deg);
        }

        .brand__card-back {
            transform: rotateY(0deg);
        }

        .brand__card-wishlist {
            fill: transparent;
            stroke: #ffffff;

            &:hover {
                fill: #ffffff;
                stroke: #ffffff;
                opacity: .6;
            }

            &.active {
                fill: #ffffff;
                stroke: #ffffff;
                opacity: 1;
                animation: wishlist__pulse .3s ease-in-out;
            }
        }
    }

    .brand__title {
        color: var(--Gray-8---Main, #383838);
        font-size: 14px;
        font-style: normal;
        font-weight: 400;
        line-height: 140%;
        letter-spacing: 0.14px;
        margin-top: 12px;
    }

    .brand__image {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background-color: #FAFAFA;
        padding: 24px 24px;
    }

    .brand__image img {
        object-fit: contain;
        height: 100%;
        mix-blend-mode: darken;
    }

    .brand__attributes {
        .brand__attribute {display: grid;grid-template-columns: 84px 1fr;column-gap: 10px;

            &:not(:last-child) {
                margin-bottom: 8px;
            }

            .brand__attribute-name {
                color: rgba(255, 255, 255, 0.70);
                font-size: 14px;
                font-style: normal;
                font-weight: 400;
                line-height: 140%;
                letter-spacing: 0.14px;
                max-width: 84px;
                width: 100%;
            }

            .brand__attribute-value {
                color: var(--Gray-1, #FAFAFA);
                font-size: 14px;
                font-style: normal;
                font-weight: 400;
                line-height: 140%;
                letter-spacing: 0.14px;
            }
        }
    }
}

.brands__page > .sidebar_popup-wrap {
    display:none;
}

@media (max-width: 992px) {
    .brands__page {
        .banner {
            .banner__wrap {
                height:240px;
                min-height:0;
                box-sizing:border-box;
                padding:23px;

                .banner__content {
                    height:100%;
                    display:flex;
                    flex-direction:column;
                    justify-content:center;

                    .banner__title {
                        font-size: 28px;
                        font-weight: 500;
                        line-height: 140%;
                        letter-spacing: 0.56px;
                    }

                    .banner__description {
                        color: var(--Base-White, #FFF);
                        font-size: 16px;
                        line-height: 140%;
                        letter-spacing: 0.16px;
                    }
                }
            }
        }

        .small__banner {
            margin-top:16px;

            .banner__wrap {
                .banner__block {
                    display:none;

                    &:first-child {
                        display:block;
                        min-height: 0;
                        height:171px;

                        img {
                            height: 100%;
                        }
                     }
                }
            }
        }
        section.brands {
            margin-top:60px;

            .brands__header {
                display:flex;
                justify-content:space-between;
                gap:10px;
                align-items:center;
                margin-bottom:32px;

                .brands__info {
                    display:block;
                    margin-bottom:0;

                    .brands__title {
                        font-size: 28px;
                        font-weight: 500;
                        line-height: 140%;
                        letter-spacing: 0.56px;
                    }
                }

                .brands__control {
                    .brands__sort {
                        display:none;
                    }
                }
            }
            .brands__wrap {
                display:block;
            }
        }

        .brands__wrap {
            .brands__result {
                .brands__items {
                    column-gap: 12px;
                    row-gap: 32px;

                    .brand {
                        flex: none;
                        width: calc(calc(100% / 2) - 12px);
                        max-width: 100%;

                        .brand__title {
                            margin-top:8px;
                        }
                    }
                }
            }
        }
    }

    .catalog__panel-mobile--block {
        display:flex;
        justify-content: space-between;
        gap:15px;
        margin-bottom:16px;

        .catalog__panel-mobile--filter {
            a {
                display:flex;
                align-items:center;
                gap:14px;

                span {
                    color: var(--Base-Dark, #171717);
                    font-size: 16px;
                    font-weight: 400;
                    line-height: 140%;
                    letter-spacing: 0.16px;
                }
            }
        }

        .catalog__panel-mobile--sort {
            .custom-select {
                .custom-select__wrapper {
                    .custom-select__items {
                        position:fixed;
                        bottom:0;
                        left:0;
                        width:100%;
                        z-index:99999;
                        padding:23px 0 0 0;
                        border-radius: 15px 15px 0 0;
                        background: #FFF;
                        box-shadow: 0 -12px 37px 0 rgba(230, 235, 243, 0.50);
                        display:flex;
                        flex-direction:column;
                        gap:8px;

                        .custom-select__item {
                            color: var(--Base-Dark, #171717);
                            font-size: 16px;
                            font-weight: 500;
                            line-height: 140%;
                            letter-spacing: 0.16px;
                            padding: 6px 16px;
                        }
                    }
                }
            }
        }
    }



    .sidebar_popup-wrap {
        display:block;
        position:fixed;
        top:0;
        left:-100%;
        width:100%;
        z-index:999;
        background:#fff;
        height: 100%;
        overflow-y: auto;
        box-sizing:border-box;
        padding:86px 16px 110px 16px;
        transition: all 0.5s;

        &.active {
            left:0;

            .filter__sidebar {
                .filter__sidebar-popup--header, .filter__sidebar-popup--button {
                    left:0%;
                }
            }
        }

        .filter__sidebar {
            .filter__sidebar-popup--header {
                display:flex;
                align-items:center;
                justify-content:space-between;
                position:fixed;
                left:-100%;
                top:0;
                width:100%;
                padding:24px 16px;
                background: #FFFFFF;
                z-index:9;
                transition: all 0.5s;

                .filter__sidebar-popup--title {
                    color: var(--Base-Dark, #171717);
                    font-size: 28px;
                    font-weight: 500;
                    line-height: 140%;
                    letter-spacing: 0.56px;
                }
            }
            .filter__wrap {
                .filter__section {
                    margin-bottom:32px;

                    &:hover {
                        h4 {
                            color: var(--Base-Dark, #171717);
                        }
                        .filter__section-toggle {
                            stroke: var(--Base-Dark, #171717);
                        }
                    }
                }
            }
            .filter__sidebar-popup--button {
                position:fixed;
                bottom:0;
                left:-100%;
                width:100%;
                background:#fff;
                padding:8px 16px 16px 16px;
                transition: all 0.5s;
                display:flex;
                flex-direction:column;
                gap:8px;

                .button {
                    width:100%;
                }
            }
        }
    }
    .brands__page > .sidebar_popup-wrap {
        display:block
    }
}