.kbps-header-desktop {
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #fff;
    padding: 20px 20px 10px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.kbps-header-container {
    max-width: var(--max-content-width);
    width: 100%;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.kbps-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 6rem;
    padding: 1em 0;
}

.kbps-logo img {
    width: auto;
    height: 6rem;
    object-fit: contain;
    transition: height 0.7s ease, transform 0.7s ease;
}

.kbps-logo.small img {
    height: 3rem;
    transform: scale(0.9);
}


.kbps-header-right {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

.kbps-header-icon-container {
    padding-top: 0;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-items: flex-start;
}

.kbps-social-icons {
    display: flex;
    gap: 15px;
}

.kbps-social-icons a {
    font-size: 2.4rem;
    color: var(--kbps-global-color-main);
    transition: all 0.25s ease;
}

.kbps-social-icons a:hover {
    color: var(--kbps-global-color-secondary);
    transform: scale(1.1);
}

.kbps-menu {
    position: relative;
    padding-left: 10px;
    font-weight: 100;
}

.kbps-menu-content {
    position: static;
    padding: 0;
    margin: 0;
    opacity: 1;
    max-height: none;
    overflow: visible;
    transform: none;
    transition: 
        opacity 0.3s ease-out,
        max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.3s ease-out,
        padding 0.3s ease-out ;
    background: none;
    box-shadow: none;
    z-index: auto;
}

.kbps-menu-vertical {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 0;
    margin: 0;
    list-style: none;
    opacity: 1;
    max-height: 1000px;
    overflow: hidden;
    transform: none;
    transition: 
        opacity 0.4s ease-out,
        max-height 0.5s ease-out,
        transform 0.4s ease-out;
}

.menu-item {
    padding: 0 ;
    margin: 0 ;
    display: block ;
    list-style: none ;
    line-height: normal ;
    transition: all 0.2s ease;
}

.menu-item a {
    font-size: x-small;
    font-weight: 500;
    padding: 0;
    margin: 0;
    line-height: 1;
    transition: all 0.2s ease;
}

.kbps-menu-title {
    margin: 0 0 0 0;
    text-transform: uppercase;
    color: var(--kbps-global-color-main);
    font-weight: 500;
    font-size: 2.4rem;
    transition: all 0.2s ease ;
}

.kbps-menu-title.scrolled {
    cursor: pointer;
}

.kbps-menu li.page_item {
    color: var(--kbps-global-color-text);
    transition: all 0.2s ease;
}

.kbps-menu li.page_item:hover {
    color: var(--kbps-global-color-main);
}

.kbps-menu li.current_page_item {
    color: var(--kbps-global-color-main);
    text-decoration: underline;
}

.kbps-cart {
    position: relative;
    padding-right: 20px;
    padding-top: 2px;
}

.kbps-cart a {
    position: relative;
    padding-top: 2px;
    font-size: 2rem;
    color: var(--kbps-global-color-main);
    transition: all 0.25s ease;
}

.kbps-cart a:hover {
    color: var(--kbps-global-color-secondary);
    transform: scale(1.1);
}

/*
.kbps-cart-count {
    background-color: var(--kbps-global-color-secondary);
    color: white;
}

.kbps-cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff0000;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-out;
    pointer-events: none;
}

.kbps-cart-count.active {
    background-color: blue !important;
*/

/*
.kbps-cart-count:empty {
    display: none !important;
}
*/

/*
.kbps-cart-count {
    display: block;
    position: absolute;
    opacity: 1 !important;
    width: 20px;
    height: 20px;
    font-size: x-small;
    font-weight: 400;
    border-radius: 50%;
    background-color: var(--kbps-global-color-secondary);
    color: white;
    top: -6px !important;
    right: -10px !important;
}

.kbps-cart-count.active {
    display: inline-flex;
    width: 20px;
    height: 20px;
    font-size: x-small;
    font-weight: 400;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-out;
    pointer-events: none;
    top: -6px !important;
    right: -10px !important;
}

*/


/* Стили для самого счетчика */
.kbps-cart-count {
    position: absolute;
    width: 20px;
    height: 20px;
    font-size: x-small;
    font-weight: 400;
    border-radius: 50%;
    background-color: var(--kbps-global-color-secondary);
    color: white;
    /* Эти значения top, right, etc. нужно будет подкорректировать, */
    /* чтобы счетчик был точно над иконкой корзины. */
    /* Используйте отрицательные значения для смещения вверх/влево от угла родителя */
    top: -6px; /* Пример: чуть выше иконки */
    right: -6px; /* Пример: чуть правее иконки */
    display: none; /* Скрываем по умолчанию, пока active не добавится */
    transition: all 0.2s ease-out; /* Плавное появление/исчезновение */
    pointer-events: none; /* Чтобы не мешал кликам */
    align-items: center; /* Центрирование текста по вертикали */
    justify-content: center; /* Центрирование текста по горизонтали */
}

/* Стили, когда счетчик активен (отображается) */
.kbps-cart-count.active {
    display: inline-flex; /* Это покажет его */
    /* Все остальные стили берутся из .kbps-cart-count */
}






body {
    padding-top: var(--header-height);
}

.kbps-header-mobile {
    display: none;
}

.kbps-header-desktop.scrolled {
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #fff;
    padding: 10px 20px ;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) ;
}

.kbps-header-desktop.scrolled .kbps-menu-vertical {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    padding-top: 0 ;
    padding-bottom: 0 ;
    transform: translateY(-10px) ;
    gap: 0 ;
    transition: 
        opacity 0.3s ease-out,
        max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.3s ease-out;
}

.kbps-header-desktop.scrolled .kbps-menu-content {
    position: absolute ;
    top: 100% ;
    right: 0 ;
    background: #fff ;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3) ;
    min-width: 180px ;
    max-width: calc(100vw - 20px) ;
    z-index: 999 ;
    opacity: 0 ;
    max-height: 0 ;
    overflow: hidden ;
    padding: 0 ;
    transform: translateY(-10px) ;
    transition: 
        opacity 0.3s ease-out,
        max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.3s ease-out,
        padding 0.3s ease-out;
}

.kbps-header-desktop.scrolled .kbps-menu.open .kbps-menu-content {
    opacity: 1;
    max-height: var(--menu-max-height, 300px) ;
    padding: 10px;
    transform: translateY(0);
    transition: 
        opacity 0.3s ease-out,
        max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.3s ease-out,
        padding 0.3s ease-out;
}

.kbps-header-desktop.scrolled .kbps-menu.open .kbps-menu-vertical {
    gap: 0 ;
    padding: 0 ;
    margin: 0 ;
    opacity: 1 ;
    max-height: 1000px;
    overflow: visible;
    transform: none;
    transition: 
        opacity 0.3s ease-out,
        max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.3s ease-out,
        padding 0.3s ease-out;
}

.kbps-header-desktop.scrolled .kbps-menu.open .kbps-menu-vertical li {
    padding: 0 ;
    margin: 0 ;
    display: block ;
    margin-bottom: 5px ;
}

.kbps-header-desktop.scrolled .kbps-menu.open .kbps-menu-vertical li:last-child {
    margin-bottom: 0 ;
}

.kbps-header-desktop.scrolled .kbps-menu.open .kbps-menu-vertical li a {
    color: #000 ;
    font-size: 1rem ;
    text-decoration: none ;
    display: block ;
    padding: 5px 10px ;
}

@media (max-width: 768px) {
    body {
    padding-top: 0;
    }
    
    .kbps-header-desktop {
        display: none ;
    }

    .kbps-header-mobile {
        display: block ;
        background-color: var(--kbps-global-color-main);
        transition: all 0.3s ease;
    }

    .kbps-header-mobile .kbps-header-container {
        display: flex ;
        flex-direction: row ;
        justify-content: space-between ;
        align-items: flex-end ;
        width: 100% ;
        max-width: 100% ;
        padding: 10px ;
        box-sizing: border-box ;
        gap: 4px ;
        flex-wrap: nowrap ;
    }

    .kbps-header-mobile .kbps-header-container > * {
        flex-shrink: 1 ;
        min-width: 0 ;
    }

    .kbps-social-icons {
        display: flex ;
        flex-shrink: 1 ;
        gap: 5px ;
    }

    .kbps-social-icons a {
        color: #fff ;
        margin: 0 0 ;
        font-size: 2rem ;
        transition: all 0.2s ease;
    }

    .kbps-header-mobile .kbps-logo-container {
        display: flex ;
        justify-content: flex-end ;
        align-items: flex-end ;
        flex-shrink: 1 ;
    }

    .kbps-header-mobile .kbps-logo {
        padding-bottom: 0 ;
        flex-shrink: 1 ;
        transition: all 0.3s ease;
    }

    .kbps-header-mobile .kbps-logo img {
        max-width: 100% ;
        height: auto ;
        width: 80px ;
        transition: all 0.3s ease;
    }

    .kbps-header-mobile .kbps-logo a {
        color: #fff ;
    }

    .kbps-header-mobile .kbps-menu {
        position: relative ;
        flex-shrink: 1 ;
    }

    .kbps-header-mobile .kbps-menu-title {
        font-weight: 300 ;
        cursor: pointer ;
        color: #fff ;
        margin: 0 ;
        padding: 0 ;
        font-size: clamp(0.5rem, 7vw, 4rem) ;
        transition: all 0.2s ease;
    }

    .kbps-header-mobile .kbps-menu-content {
        position: absolute ;
        top: 100% ;
        right: -20 ;
        width: auto ;
        min-width: 120px ;
        max-width: calc(100vw - 20px) ;
        background: #fff ;
        color: #000 ;
        max-height: 0 ;
        overflow: hidden ;
        transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) ;
        opacity: 0 ;
        z-index: 10 ;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3) ;
        transform: translateY(-10px);
    }

    .kbps-header-mobile .kbps-menu.open .kbps-menu-content {
        position: absolute ;
        max-height: 100vh ;
        opacity: 1 ;
        width: max-content ;
        transform: translateY(0);
    }

    .kbps-header-mobile .kbps-menu-vertical {
        padding: 10px ;
        margin: 0 ;
        list-style: none ;
        white-space: nowrap ;
        transition: all 0.3s ease;
    }

    .kbps-header-mobile .kbps-menu-vertical li {
        padding: 8px 16px ;
        transition: all 0.2s ease;
    }

    .kbps-header-mobile .kbps-menu-vertical a {
        color: inherit ;
        text-decoration: none ;
        display: block ;
        transition: all 0.2s ease;
    }

    .kbps-header-mobile .kbps-header-icon-container {
        flex-shrink: 1 ;
    }

    .kbps-cart a {
        color: #fff ;
        font-size: clamp(0.5rem, 7vw, 4rem) ;
        transition: all 0.2s ease;
    }

    @media (max-width: 480px) {
        .kbps-header-mobile .kbps-header-container {
            gap: 5px ;
        }
        .kbps-header-mobile .kbps-logo img {
            width: 60px ;
        }
    }

    @media (max-width: 320px) {
        .kbps-header-mobile .kbps-header-container {
            gap: 0 ;
        }
        .kbps-header-mobile .kbps-logo img {
            width: 50px ;
        }
    }
}

.kbps-logo-container {
    transition: none ;
}

.kbps-header-icon-container {
    transition: none ;
}





/*TODO Check previous styles*/

.kbps-header-desktop .kbps-menu-content {
    transition: 
    opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.kbps-header-desktop.scrolled .kbps-menu-content {
    opacity: 0;
    max-height: 0;
    transform: translateY(-15px);
}

.kbps-header-desktop.scrolled .kbps-menu.open .kbps-menu-content {
    opacity: 1;
    max-height: 1000px;
    transform: translateY(0);
}

/* Мобильное меню */
.kbps-header-mobile .kbps-menu-content {
    transition: 
    opacity 0.3s ease-out,
    max-height 0.4s ease-out;
}

.kbps-header-mobile .kbps-menu-content:not(.open) {
    opacity: 0;
    max-height: 0;
}

.kbps-header-mobile .kbps-menu.open .kbps-menu-content {
    opacity: 1;
    max-height: 1000px;
}