/* Хедер */
.header {
    width: 100%;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 101;
}

/* Верхняя серая полоса */
.header__top {
    background-color: #e8e8e8;
    height: 40px;
    display: flex;
    align-items: center;
}


.top-menu {
    display: flex;
    align-items: center;
    gap: 40px;
}

.top-menu__item {
    font-size: 15px;    
    color: rgba(42, 42, 42, 0.6);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: color 0.3s;
}

.top-menu__item:hover {
    color: #2a2a2a;
}

.top-menu__item img {
    width: 16px;
    height: 16px;
}

/* Основная белая часть */
.header__main {
    background-color: #ffffff;
}

/* Контейнер */
.header__container {
    background: #FFFFFF;
}

.header__main-top {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 40px;
}

/* Логотип */
.logo {
    width: 218px;
    height: auto;
}

.logo img {
    width: 100%;
    height: auto;
}

/* Город и телефоны */
.header-contacts {
    display: flex;
    align-items: center;
    gap: 40px;
}

.city-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* Мобильный город - скрыт на десктопе */
.city-selector--mobile {
    display: none;
}

.city-selector__name {
    font-size: 15px;
    color: #2a2a2a;
}

.city-selector__arrow {
    width: 13px;
    height: 7px;
}

.header-contacts__phones {
    display: flex;
    gap: 15px;
}

.header-contacts__phone {
    font-size: 15px;
    color: #2a2a2a;
    transition: color 0.3s;
}

.header-contacts__phone:hover {
    color: #f23300;
}

/* Иконки справа */
.header-actions {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-actions__item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    color: #2a2a2a;
    transition: color 0.3s;
    position: relative;
}

.header-actions__item:hover {
    color: #f23300;
}

.header-actions__badge {
    position: absolute;
    top: -8px;
    left: 10px;
    background-color: #f23300;
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Нижняя строка каталог, поиск, корзина */
.header__main-bottom {
    display: grid;
    grid-template-columns: 400px 1fr 400px;
    align-items: center;
    gap: 21px;
    padding-bottom: 40px;
}

/* Кнопка каталога */
.catalog-btn {
    background-color: #f23300;
    color: #ffffff;
    min-width: 215px;
    flex-grow: 1;
    height: 55px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 25px;
    font-size: 15px;
    transition: background-color 0.3s;
}

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

.catalog-btn img {
    width: 18px;
    height: 18px;
}


/* Поиск */
.search {
    width: 100%;    
    height: 55px;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 25px;
    justify-content: space-between;
}

.search input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 15px;
    color: #2a2a2a;
}

.search input::placeholder {
    color: rgba(42, 42, 42, 0.5);
}

.search__btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search__btn img {
    width: 18px;
    height: 18px;
}

/* Корзина */
.header-cart {
    background-color: #f23300;
    color: #ffffff;
    min-width: 215px;
    flex-grow: 1;
    height: 55px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    font-size: 15px;
    transition: background-color 0.3s;
    position: relative;
}

.header-cart:hover {
    background-color: #d62e00;
}

.header-cart__content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-cart__content img {
    width: 20px;
    height: 20px;
}

.header-cart__text {
    font-weight: 600;
    font-size: 15px;
}

.header-cart__price {
    font-weight: bold;
    font-size: 15px;
    padding-top: 2px;
}

.header-cart__badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: #f23300;
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Мобильное меню снизу - скрыто на десктопе */
.mobile-menu {
    display: none;
}

/* Мобильные элементы - скрыты на десктопе */
.catalog-btn--mobile,
.search--mobile {
    display: none;
}

/* Адаптивность для меньших экранов */
@media (max-width: 1440px) {
    .header__top-container, .header__container {
        padding: 0 20px;
    }
}

@media (min-width: 1441px) {
    .header__top-container, .header__container {
        padding: 0 60px;
    }
}

@media (max-width: 1240px) {
    .header__main-bottom {
        grid-template-columns: 300px 1fr 300px;
    }

    .header-brand {
        gap: 20px;
    }

    .header-contacts {
        gap: 20px;
    }

    .header-actions {
        gap: 15px;
    }
}

/* Мобильная версия */
@media (max-width: 1024px) {
    /* Верхняя белая полоса с городом */
    .header__top {
        height: 30px;
        background-color: #ffffff; /* Белый фон вместо серого */
        border-bottom: 1px solid rgba(42, 42, 42, 0.1);
    }

    /* Контейнер для top-menu на мобилках */
    .header__top-container, .header__container {
        padding: 0;
    }

    .top-menu {
        display: none;
    }

    /* Показать мобильный город */
    .city-selector--mobile {
        display: flex;
        gap: 5px;
        align-items: center;
        padding: 0 9px;
    }

    /* Иконка местоположения */
    .city-selector--mobile::before {
        content: '';
        display: block;
        width: 11px;
        height: 11px;
        background-image: url('images/geo.svg');
        background-size: contain;
        background-repeat: no-repeat;
        flex-shrink: 0;
    }

    .city-selector--mobile .city-selector__name {
        font-size: 10px;
    }

    .city-selector--mobile .city-selector__arrow {
        width: 9px;
        height: 9px;
        flex-shrink: 0;
    }

    /* Основной хедер */
    .header__main-top {
        height: 60px;
        padding: 0 10px;
        gap: 10px;
    }

    .catalog-btn {
        min-width: 20px;
        flex-grow: 0;
    }

    /* Показать мобильный бургер-меню */
    .catalog-btn--mobile {
        display: flex;
        width: 20px;
        height: 20px;
        border-radius: 0;
        background-color: transparent;
        padding: 0;
        flex-shrink: 0;
    }

    .catalog-btn--mobile:hover {
        background-color: transparent; /* Убрать оранжевую подсветку */
    }

    .catalog-btn--mobile img {
        width: 20px;
        height: 20px;
        filter: brightness(0);
    }

    .catalog-btn--mobile span {
        display: none;
    }

    /* Логотип рядом с бургером */
    .logo {
        width: 87px;
        flex-shrink: 0;
    }

    /* Скрыть город и телефоны из основного хедера */
    .header-contacts {
        display: none;
    }

    /* Скрыть иконки справа */
    .header-actions {
        display: none;
    }

    /* Показать мобильный поиск */
    .search--mobile {
        display: flex;
        width: 100%;
        height: 33px;
        border: 1px solid #2a2a2a;
        border-radius: 6px;
        padding: 0 0 0 9px;
        position: relative;
        flex: 1;
    }

    .search--mobile input {
        font-size: 10px;
        padding-right: 38px;
    }

    .search--mobile input::placeholder {
        font-size: 10px;
    }

    .search--mobile .search__btn {
        position: absolute;
        right: -2px; /* Компенсация границы */
        top: -0; /* Компенсация границы */
        width: 38px;
        height: 100%; /* Высота по контейнеру с учетом границы */
        background-color: #2a2a2a;
        border-radius: 6px;
        border: none;
    }

    .search--mobile .search__btn img {
        width: 16px;
        height: 16px;
        filter: brightness(0) invert(1);
    }

    /* Скрыть десктопную нижнюю строку полностью */
    .header__main-bottom {
        display: none;
    }

    /* Мобильное меню снизу */
    .mobile-menu {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: #ffffff;
        border-top: 1px solid rgba(42, 42, 42, 0.1);
        height: 51px;
        justify-content: center;
        align-items: center;
        gap: 20px;
        z-index: 1000;
        padding: 7px 0;
    }

    .mobile-menu__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        color: rgba(42, 42, 42, 0.6);
        font-size: 10px;
        position: relative;
        width: 54px;
    }

    .mobile-menu__item img {
        width: 18px;
        height: 18px;
        /* Убрать фильтры, чтобы иконки были видны */
    }

    .mobile-menu__item--active {
        color: #f23300;
    }

    
	.mobile-menu__item--active img {
		filter: invert(29%) sepia(100%) saturate(10000%) hue-rotate(0deg) brightness(0.8) contrast(1.2);
	}

    /* Сделать иконки активных пунктов оранжевыми */
    .mobile-menu__item:not(.mobile-menu__item--active) img {
        filter: brightness(0); /* Черные иконки для неактивных */
    }

    .mobile-badge {
        position: absolute;
        top: -3px;
        left: 50%;
        margin-left: 5px;
        background-color: #f23300;
        color: #ffffff;
        border-radius: 50%;
        width: 15px;
        height: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: bold;
    }
}