.topbar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: -1;
    width: 100%;
    background-color: #ffffff;
    padding: 15px 0 10px;
    animation-fill-mode: forwards;
    animation-duration: 1s;
    box-shadow: 0 2px 10px 0px rgba(34, 34, 34, 0.5);
    opacity: 0;
}

.topbar.js-show {
    animation-name: showElement;
    opacity: 1;
    animation-fill-mode: forwards;
    animation-duration: 1s;
    z-index: 11;
}

.topbar-wrapper {
    width: 100%;
    display: flex;
    align-items: flex-start;
    max-width: 1200px;
    padding: 0 10px;
    margin: 0 auto;
}

.topbar-product-info {
    display: grid;
    grid-template-columns: 40px auto;
    gap: 6px 15px;
    grid-template-areas: 
    "photo title"
    "photo rating";
}

.topbar-product-info__img {
    grid-area: photo;
    width: 40px;
    height: 40px;
    background-color: #ffffff;
}

.topbar-block__title {
    grid-area: title;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    color: #222222;
    margin: 0;
}

.product-main-info-rating {
    grid-area: rating;
}

.product-controls--topbar {
    position: static;
    flex-direction: row-reverse;
    gap: 15px;
    padding: 8px 0 0 0;
    margin: 0;
}

.topbar-btns {
    display: flex;
    gap: 14px;
    border-left: 1px solid #F0F0F0;
    padding: 0 0 0 15px;
    margin: 0 15px;
}

.topbar-btns .button .icon {
    display: none;
}

.topbar-btns .product-btns__btn,
.topbar-btns .button_base.js-price-request,
.topbar-btns .button_primary.js-preorder-btn {
    width: 140px;
    height: auto;
    text-align: center;
    font-size: 14px;
    padding: 8px 0;
}


.topbar-price {
    padding: 8px 0 0;
    margin: 0 15px 0 auto;
}

.topbar-price .product-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-price .product-price .old {
    gap: 5px;
    margin: 0;
}

.topbar-price .product-price .val {
    padding: 3px 0 0;
}

.topbar-price .product-price.sale-percent .sale {
    font-size: 14px;
    line-height: 1;
    padding: 4px 3px;
    margin: 0;
}

.product-nav-list {
    width: 100%;
    display: flex;
    gap: 20px;
    padding: 15px 0 0;
}

.product-nav-list__item {
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    border-right: 1px solid #F0F0F0;
    color: #222222;
    padding: 0 20px 0 0;
}

.product-nav-list__item sup {
    color: #00AFFF;
}

.product-nav-list__item:hover,
.product-nav-list__item:focus {
    color: #00AFFF;
}

.mob-navigation {
    display: none;
}

@keyframes showElement {
    0% {
        opacity: 0;
        top: -72px
    }

    100% {
        opacity: 1;
        top: 0
    }
}

@media (max-width: 1024px) {
    .topbar-product-info .product-main-info-rating,
    .product-controls--topbar,
    .topbar-btns .js-one-click-buy {
        display: none;
    }

    .topbar-wrapper {
        gap: 10px;
    }

    .topbar-product-info {
        grid-template-areas: "photo title";
    }

    .topbar-block__title {
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        margin: auto 0;
    }

    .topbar-price {
        margin: 0 0 0 auto;
    }

    .topbar-btns {
        padding: 0 0 0 10px;
        margin: 0;
    }

    .product-nav-list {
        gap: 10px;
        padding: 0;
    }

    .product-nav-list__item {
        padding: 0 1% 0 0;
    }

    @keyframes showElement {
        0% {
            opacity: 0;
            top: 0
        }

        100% {
            opacity: 1;
            top: 84px
        }
    }
}

@media (max-width: 767px) {
    .topbar {
        top: auto;
        bottom: 0;
        padding: 10px 0;
    }

    .topbar-wrapper {
        display: grid;
        grid-template-areas: 
        "title btns"
        "price btns";
        gap: 0 16px;
        padding: 0 16px;
    }

    .topbar-wrapper:nth-of-type(2) {
        display: none;
    }

    .topbar-product-info {
        grid-template-columns: auto;
        grid-template-areas: "title";
        gap: 0;
        margin: auto 0;
    }

    .topbar-product-info__img {
        display: none;
    }

    .topbar-block__title {
        font-size: 14px;
    }

    .topbar-price {
        grid-area: price;
        padding: 2px 0 0;
        margin: 0;
    }

    .topbar-price .product-price {
        font-size: 14px;
        font-weight: 600;
        gap: 4px;
    }

    .topbar-price .product-price .old {
        gap: 5px;
        margin: 0;
    }

    .topbar-price .product-price .val {
        padding: 5px 0 0;
    }

    .topbar-btns {
        grid-area: btns;
        border: none;
        padding: 0;
        margin: 0 0 0 auto;
    }

    .topbar-btns .product-btns__btn {
        width: 128px;
    }

    .topbar-price:has(.product-price:empty) {
        display: none;
    }

    .topbar-wrapper:has(.topbar-price .product-price:empty) {
        grid-template-areas: "title btns";
    }

    .topbar-price .product-price:empty {
        display: none;
    }

    /* Mob Nav */
    .mob-navigation {
        display: block;
        width: 100%;
        z-index: 99;
        position: fixed;
        top: 0;
        left: 0;
        background-color: #ffffff;
        box-shadow: 0 2px 10px 0px rgba(34, 34, 34, 0.5);
        animation-fill-mode: forwards;
        opacity: 0;
        padding: 0;
    }

    .mob-navigation__trigger {
        width: 100%;
        position: relative;
        font-family: var(--font-harmonia);
        font-size: 16px;
        font-weight: 600;
        line-height: 1;
        text-align: left;
        color: #222222;
        background-color: transparent;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 8px 8px 8px 35px;
    }

    .mob-navigation__trigger::after,
    .mob-navigation__trigger::before {
        position: absolute;
        content: '';
        top: 15px;
        width: 8px;
        height: 2px;
        background-color: #222222;
        border-radius: 2px;
        transition: transform .3s ease-in-out;
    }

    .mob-navigation__trigger::before {
        left: 12px;
        transform: rotate(45deg);
    }

    .mob-navigation__trigger::after {
        left: 18px;
        transform: rotate(-45deg);
    }

    .mob-navigation.js-open .mob-navigation__trigger::before {
        transform: rotate(-45deg);
    }

    .mob-navigation.js-open .mob-navigation__trigger::after {
        transform: rotate(45deg);
    }

    .mob-navigation-list {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: opacity .3s ease-out, max-height .3s ease-out;
    }

    .mob-navigation-link {
        position: relative;
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 14px;
        font-weight: 600;
        line-height: 1;
        text-decoration: none;
        border-bottom: 1px solid #F0F0F0;
        color: #222222;
        padding: 18px 12px;
    }

    .mob-navigation-link:last-of-type {
        border-bottom: none;
    }

    .mob-navigation-link sup {
        color: #00AFFF;
    }

    .mob-navigation-link__logo {
        width: 14px;
        height: 14px;
    }

    .mob-navigation-link::before,
    .mob-navigation-link::after {
        position: absolute;
        content: '';
        width: 8px;
        height: 2px;
        background-color: #222222;
        border-radius: 2px;
        right: 14px;
    }

    .mob-navigation-link::before {
        transform: rotate(45deg);
        top: 22px;
    }

    .mob-navigation-link::after {
        transform: rotate(-45deg);
        bottom: 21px;
    }

    .mob-navigation.js-show {
        animation-name: showMobNav;
        opacity: 1;
        animation-fill-mode: forwards;
        animation-duration: 1s;
    }

    .mob-navigation.js-show-with-alert {
        animation-name: showMobNavWithAlert;
        opacity: 1;
        animation-fill-mode: forwards;
        animation-duration: 1s;
    }

    .mob-navigation.js-show-with-big-alert {
        animation-name: showMobNavWithBigAlert;
        opacity: 1;
        animation-fill-mode: forwards;
        animation-duration: 1s;
    }

    @keyframes showMobNav {
        0% {
            opacity: 0;
            top: 0;
        }

        100% {
            opacity: 1;
            top: 84px;
        }
    }

    @keyframes showMobNavWithAlert {
        0% {
            opacity: 0;
            top: 0;
        }

        100% {
            opacity: 1;
            top: 117px;
        }
    }

    @keyframes showMobNavWithBigAlert {
        0% {
            opacity: 0;
            top: 0;
        }

        100% {
            opacity: 1;
            top: 133px;
        }
    }

    @keyframes showElement {
        0% {
            opacity: 0;
            bottom: -60px;
        }

        100% {
            opacity: 1;
            bottom: 0;
        }
    }
}