/* Header Styles */
.header {
    padding: 40px 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 101;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    max-width: calc(100vw - 200px);
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-image {
    width: 260px;
}

.logo-text {

    font-weight: 600;
    font-size: 18px;
    color: #383d4c;
    letter-spacing: -0.3px;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

.catalog-btn {
    background-color: #4a8cf0;
    color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 13px 30px;

    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 170px;
    box-shadow: 0px 18.01px 17px rgba(13, 78, 20, 0.07);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.catalog-btn:hover {
    background-color: #3a7bd8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.icon-link:hover {
    opacity: 0.7;
}

.icon-link img {
    width: 18px;
    height: 18px;
}

/* Стили для счетчика корзины */
.cart-icon-link {
    position: relative;
}

.cart-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: #ffffff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
    animation: cart-counter-pulse 0.3s ease-out;
}

/* Анимация появления счетчика */
@keyframes cart-counter-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Класс для анимации обновления */
.cart-counter-pulse {
    animation: cart-counter-update 0.3s ease-out;
}

@keyframes cart-counter-update {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Адаптация для больших чисел */
.cart-counter[data-count="10"],
.cart-counter[data-count="11"],
.cart-counter[data-count="12"],
.cart-counter[data-count="13"],
.cart-counter[data-count="14"],
.cart-counter[data-count="15"],
.cart-counter[data-count="16"],
.cart-counter[data-count="17"],
.cart-counter[data-count="18"],
.cart-counter[data-count="19"] {
    min-width: 22px;
    font-size: 10px;
}

/* Для чисел больше 99 */
.cart-counter.large-count {
    min-width: 24px;
    font-size: 9px;
    padding: 0 2px;
}

/* Инвертированные цвета для главной секции */
.inverted .logo-text {
    color: #ffffff;
}

.inverted .icon-link img {
    filter: brightness(0) invert(1);
}

.inverted.menu-btn {
    background-color: #ffffff;
    color: #383d4c;
}

.inverted .menu-icon .line {
    background-color: #383d4c;
}

/* Инвертированные цвета при открытом меню */
.header.menu-open .logo-image {
    filter: brightness(0) invert(1);
}

.header.menu-open .icon-link img {
    filter: brightness(0) invert(1);
}

.header.menu-open .catalog-btn {
    background-color: #ffffff;
    color: #4a8cf0;
}

.header.menu-open .menu-btn {
    background-color: #ffffff;
    color: #383d4c;
}

.header.menu-open .menu-icon .line {
    background-color: #383d4c;
}

/* Счетчик корзины остается видимым в инвертированном режиме */
.header.menu-open .cart-counter,
.inverted .cart-counter {
    background: #e74c3c;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {

    .header {
        top: -11px !important;
    }

    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .header-center {
        width: 100%;
        justify-content: center;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .header-center {
        display: none;
    }

    .header-logo {
        order: 2;
    }

    .header-content {
        max-width: calc(100vw - 60px);
        gap: 10px;
    }

    /* Адаптация счетчика корзины для мобильных */
    .cart-counter {
        top: -6px;
        right: -6px;
        min-width: 16px;
        height: 16px;
        font-size: 10px;
    }

    .cart-counter[data-count="10"],
    .cart-counter[data-count="11"],
    .cart-counter[data-count="12"],
    .cart-counter[data-count="13"],
    .cart-counter[data-count="14"],
    .cart-counter[data-count="15"],
    .cart-counter[data-count="16"],
    .cart-counter[data-count="17"],
    .cart-counter[data-count="18"],
    .cart-counter[data-count="19"] {
        min-width: 20px;
        font-size: 9px;
    }

    .cart-counter.large-count {
        min-width: 22px;
        font-size: 8px;
    }
}