/* assets/css/header.css */
/* ===== УБИРАЕМ ПОДЧЕРКИВАНИЯ У ВСЕХ ССЫЛОК ===== */
.header a,
.header a:hover,
.header a:focus,
.header a:active {
    text-decoration: none !important;
}

/* ===== ОСНОВНЫЕ СТИЛИ ===== */
.header {
    background: var(--color-bg-white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

@media (max-width: 768px) {
    /* Отлепляем шапку на мобильных, чтобы освободить экран */
    .header {
        position: static !important;  /* или relative */
        top: auto !important;
        z-index: 100 !important; /* Уменьшаем z-index, чтобы не перекрывала модалки */
    }
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
}

.logo-text {
    font-family: var(--font-primary);
    font-size: 28px;
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    text-decoration: none;
}

.logo-text span {
    color: var(--color-primary);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-menu {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ===== МЕНЮ - УБИРАЕМ ВСЕ ПОДЧЕРКИВАНИЯ ===== */
.main-menu li a {
    text-decoration: none !important;
    color: var(--color-text-secondary);
    font-size: var(--font-sm);
    font-weight: var(--font-medium);
    padding: 6px 0;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
}

.main-menu li a:hover,
.main-menu li a.active {
    color: var(--color-primary);
    text-decoration: none !important;
}

/* ===== ПОЛНОСТЬЮ УБИРАЕМ СИНЮЮ ПОЛОСКУ ===== */
.main-menu li a::after {
    display: none !important; 
}

/* ===== КНОПКА ВХОДА/КАБИНЕТА - ФИКСИРОВАННАЯ ===== */
.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 110px; /* Если слово "Кабинет" будет обрезаться на узких экранах, увеличьте до 115-120px */
    min-width: 110px;
    max-width: 110px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-sizing: border-box;
    flex-shrink: 0;
    line-height: 1.2;
    overflow: hidden; /* Защищает кнопку от растягивания содержимым */
}

/* При наведении */
.header-btn:hover {

    border-color: var(--color-border-hover);
    text-decoration: none !important;
}

/* ===== СТИЛИ ДЛЯ НОВОЙ SVG ИКОНКИ ===== */
.header-btn .header-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0; /* Иконка никогда не сжимается */
    /* Цвет меняется сам благодаря stroke="currentColor" при hover кнопки */
}

/* ===== ФИКСИРУЕМ ТЕКСТ ===== */
.header-btn .link-text {
    flex-shrink: 0;
    display: inline-block;
    min-width: 50px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis; /* Добавит "...", если шрифт пользователя слишком широкий */
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ ===== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-primary);
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 1024px) {
    .header-nav {
        gap: 20px;
    }
    .main-menu {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }
    .mobile-menu-btn {
        display: block;
        order: 1;
    }
    .header-nav {
        display: none;
        width: 100%;
        order: 2;
        margin-top: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .header-nav.active {
        display: flex;
    }
    .main-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    .main-menu li {
        border-bottom: 1px solid var(--color-border);
        width: 100%;
    }
    .main-menu li:last-child {
        border-bottom: none;
    }
    .main-menu li a {
        display: block;
        padding: 12px 0;
        text-decoration: none !important;
    }
    .main-menu li a::after {
        display: none !important;
    }
    /* Кнопка в мобильной версии */
    .header-btn {
        width: 100%;
        min-width: unset;
        max-width: unset;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 24px;
    }
}