/* header.css — только стили хедера */

/* Принудительно задаём белый цвет и шрифт для всего хедера и его детей */
.header,
.header * {
    font-family: Arial, sans-serif !important;
    font-size: 16px !important;
    line-height: normal !important;
    color: #fff !important;          /* белый цвет текста везде внутри хедера */
}

/* Ссылки внутри хедера — отдельно, чтобы цвет не перебивался никакими другими правилами */
.header a,
.header__menu li a,
.auth-block a {
    color: #fff !important;
    text-decoration: none;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 70px;
    background-color: #48036F;
    /* color: #fff; — уже задан выше через .header */
    padding: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: top 0.3s;
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 24px;
}

/* Логотип */
.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

.logo {
    max-height: 70px;
    width: auto;
}

@media (min-width: 819px) {
    .logo-text {
        display: none;
    }
}

.logo-text {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

/* Бургер */
.menu-burger__header {
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.burger-line {
    height: 3px;
    width: 24px;
    background: #fff;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.5s ease;
}

.menu-burger__header::before,
.menu-burger__header::after {
    content: '';
    position: absolute;
    height: 3px;
    width: 24px;
    background: #fff;
    transition: transform 0.4s ease;
}

.menu-burger__header::before {
    top: calc(50% - 6px);
    transform: translateY(-50%);
}

.menu-burger__header::after {
    bottom: calc(50% - 6px);
    transform: translateY(50%);
}

.menu-burger__header.open-menu .burger-line {
    opacity: 0;
}

.menu-burger__header.open-menu::before {
    transform: translateY(-50%) rotate(45deg);
}

.menu-burger__header.open-menu::after {
    transform: translateY(50%) rotate(-45deg);
}

/* Навигация: на мобильных — выезжающая панель справа */
.header__nav {
    position: absolute;
    top: 70px;
    right: -100%;
    width: 320px;
    background: #f5f6f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: right 0.4s ease;
}

.header__nav.open-menu {
    right: 0;
}

.header__menu {
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

.header__menu li {
    margin: 8px 0;
}

.header__menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.header__menu li a svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

/* Тултипы */
.tooltip-item {
    position: relative;
}

.tooltip {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: #48036F;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 10;
}

.tooltip-item:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Блок авторизации */
.auth-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-block p,
.auth-block a {
    color: #fff;
    padding: 5px 10px;
    text-decoration: none;
}

.auth-block.authorized {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.auth-block.authorized p,
.auth-block.authorized a {
    font-size: 0.9em;
    transition: font-size 0.3s ease;
}

.auth-block a:hover {
    color: #4CAF50;
    text-decoration: none;
}

/* Десктоп: горизонтальное меню */
@media (min-width: 1105px) {
    .menu-burger__header {
        display: none;
    }

    .header__nav {
        position: static;
        display: flex;
        gap: 16px;
        flex: 1 1 auto;
        right: auto;
        top: auto;
        width: auto;
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    .header__menu {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        align-items: center;
    }

    .header__menu li {
        margin: 0 1px;
        padding: 0;
        position: relative;
    }

    .header__menu li a {
        color: #fff;
        text-decoration: none;
        font-weight: bold;
        padding: 5px 10px;
        font-size: 16.5px;
        line-height: 1;
        white-space: nowrap;
        transition: color 0.2s ease;
    }

    .header__menu li a:hover {
        text-decoration: none;
        color: #4CAF50;
    }

    .header__menu li a svg {
        margin-right: 8px;
        display: inline-block;
    }

    .auth-block {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
    }
}

/* Планшеты и мобильные: бургер-навигация + скрытие авторизации */
@media (max-width: 1104px) {
    .auth-block {
        display: none !important;
    }

    .logo-text {
        font-size: 1.1rem;
    }
}

/* Компактнее на узких экранах */
@media (max-width: 850px) {
    .auth-block.authorized p,
    .auth-block.authorized a {
        font-size: 0.9em;
    }

    .auth-block.authorized {
        gap: 5px;
    }
}

/* Адаптив для пунктов меню на планшетах */
@media (max-width: 768px) {
    .header__menu li {
        margin: 0;
        padding: 0;
    }

    .header__menu li a {
        display: block;
        text-align: center;
        padding: 12px 0;
    }
}

@media (max-width: 470px) {
    .header__menu li a {
        font-size: 16px;
    }
}
