@import url('root.css');

/* ===== ХЕДЕР  ===== */
.header {
    position: fixed;
    left: 0;
    width: 100%;
    background-color: rgba(44, 62, 80, 0.0);
    z-index: 1000;
    transition: background-color 0.9s ease;
    backdrop-filter: blur(5px);
}

.header {
    will-change: background-color;
}


.header.scrolled {
    background-color: #25262783;
    /* Непрозрачный фон */
}

/* Иконка */

.header-icon {
    width: clamp(2rem, 4vw, 3rem);
    height: clamp(2rem, 4vw, 3rem);
    border-radius: 50%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden
}


.header-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}


/* Стили для переключателя */
.theme-switch-wrapper {
    margin-right: 1rem;
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    /* Все стили для мобильных в одном месте */
    .theme-switch-wrapper {
        margin-left: auto;
        margin-right: 0.5rem;
    }
    
    .header-container {
        gap: 10px;
        padding: 12px 15px;
    }
    
    .header-icon {
        display: none;
    }
    
    /* ... остальные стили ... */
}

.theme-switch {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 34px;
    margin: 0 10px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Контейнер */

.header-container {
    max-width: 1400px;
    min-width: 0;
    margin: 0 auto;
    padding: 15px clamp(15px, 5vw, 20px);
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: clamp(20px, 3vw, 40px);
    box-sizing: border-box;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ ===== */
@media (max-width: 768px) {
    .header-container {
        gap: 10px;
        padding: 12px 15px; /* Уменьшаем отступы */
        width: 100%;
        box-sizing: border-box;
    }

    /* Скрываем иконку */
    .header-icon {
        display: none;
    }

    /* Показываем кнопку бургера */
    .hamburger-button {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 30px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
        position: relative;
        margin-left: auto;
    }

    .hamburger-line {
        width: 100%;
        height: 3px;
        background-color: white;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    /* Анимация крестика */
    .hamburger-button.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(8px, 7px);
    }

    .hamburger-button.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .hamburger-button.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Мобильное меню - выезжает справа */
    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: rgba(44, 62, 80, 0.95);
        backdrop-filter: blur(20px);
        transition: right 0.3s ease;
        z-index: 1000;
        padding-top: 80px;
        margin: 0;
        display: block !important;
    }

    .header-nav.active {
        right: 0;
    }

    /* Меню на мобильных - вертикальное */
    .menu-items {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 20px;
        margin: 0;
    }

    .nav-link {
        font-size: 1.2rem;
        display: block;
        padding: 10px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .header-container {
        grid-template-columns: 1fr auto;
        gap: 10px;
    }

    .logo__ears {
        font-size: 0.8rem;
    }

    .hamburger-button {
        width: 25px;
        height: 25px;
    }
}


/* Логотип */

.header-logo {
    flex-shrink: 0;
    display: flex; 
    align-items: center;
}


@media (max-width: 480px) {
    .logo__link {
        margin: 0;
        padding: 0;
    }
}

.logo__text {
    min-width: clamp(1rem, 4vw, 1.3rem);
    font-size: var(--heading-font-size);
}


.logo a {
    color: white;
    text-decoration: none;
    font-size: var(--heading-font-size);
    font-weight: bold;
    letter-spacing: 1px;
    transition: 0.3s;
    font-family: var(--heading-font);
    margin-left: clamp(0.5rem, 0vw, 2rem);
    white-space: nowrap;
}


.logo a:hover {
    color: #ffffff;
}

@media (max-width: 768px) {
    .header-logo {
        flex-shrink: 1; /* Позволяем сжиматься */
    }
    
    .logo__link {
        gap: 3px;
        overflow: hidden; /* Скрываем переполнение */
    }
    
    
    .logo__ears {
        font-size: 0.8rem;
        flex-shrink: 0; /* Уши не сжимаем */
    }
}

/* Навигационное меню */
.header-nav {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    width: 100%;
}


.nav-menu {
    display: block;
    width: 100%;
}

.menu-items {
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}


.nav-link {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.9s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    color: #ffffff;
}

/* Эффект подчеркивания при наведении */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #ffffff;
    transition: width 0.4s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Гамбургер меню */
.hamburger-button {
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    display: none;
}

.hamburger-button:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-line {
    will-change: transform, opacity;
}

/* Стили для открытого меню */
.menu-items.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Logo_script  */

.logo__link {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    font-family: Mulish, sans-serif;
    color: white;
}

.logo__ears {
    display: flex;
    gap: 2px;
    margin-right: 5px;
}

.logo__ear {
    display: inline-block;
    font-size: 1.2rem;
    transform-origin: bottom center;
    transition: transform 0.2s ease;
}

.logo__link:hover .logo__ear:first-child {
    animation: ear-twitch-left 0.5s ease infinite;
}

.logo__link:hover .logo__ear:last-child {
    animation: ear-twitch-right 0.5s ease infinite;
}

@keyframes ear-twitch-left {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    25% {
        transform: rotate(-10deg) scale(1.1);
    }

    75% {
        transform: rotate(5deg) scale(1.05);
    }
}

@keyframes ear-twitch-right {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    25% {
        transform: rotate(10deg) scale(1.1);
    }

    75% {
        transform: rotate(-5deg) scale(1.05);
    }
}

.logo__link:hover .logo__text {
    animation: glow-pulse 1.5s ease infinite;
}

@keyframes glow-pulse {

    0%,
    100% {
        text-shadow: 0 0 5px #ffd700;
    }

    50% {
        text-shadow: 0 0 20px #ffd700, 0 0 30px #ffaa00;
    }
}

/* Logo_script */


/* Оверлей (затемнение) */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Анимация для меню */
.header-nav {
    transition: left 0.3s ease;
}

/* Для десктопа убираем лишнее */
@media (min-width: 769px) {
    .header-nav {
        position: static;
        width: auto;
        height: auto;
        background: none;
        backdrop-filter: none;
        padding-top: 0;
    }
    
    .menu-overlay {
        display: none;
    }
}