/* Сброс и чистая верстка шапки для мобильных */

/* НА ДЕСТОПЕ: Скрываем мобильную кнопку и текст */
@media screen and (min-width: 1025px) {
    .btn-submit-header {
        display: none !important;
    }
}

/* НА МОБИЛЬНЫХ И ПЛАНШЕТАХ */
@media screen and (max-width: 1024px) {
    /* Контейнер шапки */
    header .max.flex-center {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 5px 10px !important;
        min-height: 50px;
    }

    /* Бургер-меню */
    .catalog-menu-button {
        margin: 0 !important;
        flex-shrink: 0;
    }

    /* Логотип */
    .logo {
        margin: 0 8px !important;
        font-size: 16px !important;
        white-space: nowrap !important;
        flex-shrink: 1; 
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Блок иконок и кнопки */
    .icons-block {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0;
        margin-left: auto !important;
    }

    /* Кнопка "Подать объявление" */
    .btn-submit-header {
        display: flex !important;
        background: #f05a7e !important;
        color: #fff !important;
        padding: 6px 12px !important;
        border-radius: 20px !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        white-space: nowrap !important;
        margin-right: 8px !important;
        box-shadow: 0 2px 4px rgba(240, 90, 126, 0.2);
    }

    /* Иконка пользователя */
    .icons-block .c-login {
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
        flex-shrink: 0;
    }

    .icons-block .c-login__text {
        display: none !important;
    }

    .icons-block .c-login__icon {
        margin: 0 !important;
        width: 24px;
        height: 24px;
    }

    /* Скрываем дубли в бургере */
    .catalog-menu li.bold, .c-menu li.bold {
        display: none !important;
    }
}

@media screen and (max-width: 360px) {
    .logo {
        font-size: 14px !important;
    }
    .btn-submit-header {
        padding: 5px 8px !important;
        font-size: 10px !important;
    }
}

/* --- ОБНОВЛЕНИЕ СПИСКА КАНАЛОВ (CHIPS) --- */

.channel-links {
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 15px !important;
    gap: 12px !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    scrollbar-width: none; 
    -ms-overflow-style: none;
    margin-bottom: 10px !important;
    background: #fff;
    position: relative;
}

.channel-links::-webkit-scrollbar {
    display: none;
}

.channel-links::after {
    content: "";
    position: sticky;
    right: -15px;
    top: 0;
    height: 100%;
    width: 30px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
    flex-shrink: 0;
}

.channel-link {
    display: flex !important;
    align-items: center !important;
    padding: 10px 18px !important;
    background: #fdfdfd !important;
    border: 1.5px solid #ececec !important;
    border-radius: 50px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03) !important;
    color: #444 !important;
    font-weight: 500 !important;
    font-size: 14px !important;
}

.channel-link img, .channel-link .channel-icon-emoji {
    width: 24px !important;
    height: 24px !important;
    margin-right: 10px !important;
    border-radius: 50%;
    object-fit: cover;
}

.channel-link.active {
    background: #f05a7e !important;
    color: #fff !important;
    border-color: #f05a7e !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(240, 90, 126, 0.3) !important;
}

/* Жесткое удаление подчеркиваний у каналов */
.channel-link.active::after, 
.channel-link.active::before, 
.channel-links .active::after,
.channel-links .active::before {
    display: none !important;
    content: none !important;
    border: none !important;
    height: 0 !important;
    width: 0 !important;
}

.channel-link {
    border-bottom: 1.5px solid #ececec !important; /* Возвращаем рамку чипа если она перебилась */
}

.channel-link.active {
    border-bottom: 1.5px solid #f05a7e !important;
}

/* Центрирование кнопки Купить в 1 клик */
.product-wrapper.post .buy-container .mg-buy-click-button {
    width: 100% !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: 45px !important;
    border-radius: 30px !important;
    background: #f05a7e !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: none !important;
}
