/* ============================================
   CSS VARIABLES (берём из глобальных)
   ============================================ */
:root {
    --header-bg: #26252d;
    --header-height: 82px;
    --header-max-width: 1400px;
}

/* ============================================
   RESET для хедера
   ============================================ */
.aipanda-header *,
.aipanda-header *::before,
.aipanda-header *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================
   HEADER
   ============================================ */
.aipanda-header {
    position: relative;
    z-index: 1000;
    font-family: var(--font-mono);
    background-color: var(--header-bg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    padding: 0;
    margin-top: 0 !important;
}

body > .aipanda-header:first-child,
body > .aipanda-header:first-of-type {
    margin-top: 0;
}

.aipanda-header__container {
    display: flex;
    align-items: center;
    max-width: var(--header-max-width);
    margin: 0 auto 0;
    height: var(--header-height);
    background-color: transparent;
    padding: 0 40px;
    box-shadow: none;
    border: none;
}

/* Логотип, навигация */
.aipanda-header__logo { flex-shrink: 0; }

.aipanda-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-text-on-dark);
    transition: opacity 0.3s ease;
}
.aipanda-logo-link:hover { opacity: 0.85; }

.aipanda-logo-img,
.aipanda-logo-svg {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}
.aipanda-logo-img { border-radius: 50%; object-fit: cover; }

.aipanda-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-on-dark);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.aipanda-header__divider {
    width: 1px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.15);
    margin: 0 24px;
    flex-shrink: 0;
}

.aipanda-header__nav { flex-grow: 1; overflow: hidden; }

.aipanda-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
}
.aipanda-menu li { list-style: none; }

.aipanda-menu-link,
.aipanda-menu-link:visited {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--color-text-on-dark);
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}
.aipanda-menu-link:hover {
    color: var(--color-primary-start);
    background: rgba(10, 186, 181, 0.1);
}

.aipanda-menu li.current-menu-item > a,
.aipanda-menu li.current_menu_item > a,
.aipanda-menu li.current-menu-item > a:visited,
.aipanda-menu li.current_page_item > a,
.aipanda-menu li.current_page_item > a:visited {
    background: rgba(10, 186, 181, 0.2) !important;
    color: var(--color-primary-start) !important;
    box-shadow: none !important;
}

.aipanda-menu li.current-menu-item span.removed-link,
.aipanda-menu li.current_page_item span.removed-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    background-color: rgba(10, 186, 181, 0.2) !important;
    color: var(--color-primary-start) !important;
    box-shadow: none !important;
    cursor: default;
}

.aipanda-menu li.current-menu-item .aipanda-menu-icon svg,
.aipanda-menu li.current_page_item .aipanda-menu-icon svg,
.aipanda-menu-link--active .aipanda-menu-icon svg {
    stroke: var(--color-primary-start) !important;
}

.aipanda-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.aipanda-menu-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    transition: stroke 0.3s ease;
}

/* Бургер */
.aipanda-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}
.aipanda-burger:hover { background-color: rgba(255, 255, 255, 0.1); }

.aipanda-burger__line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--color-text-on-dark);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.aipanda-burger.active .aipanda-burger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.aipanda-burger.active .aipanda-burger__line:nth-child(2) {
    opacity: 0;
}
.aipanda-burger.active .aipanda-burger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .aipanda-menu-link { padding: 8px 12px; font-size: 15px; }
    .aipanda-header__divider { margin: 0 16px; }
    .aipanda-logo-text { font-size: 20px; }
}

@media (max-width: 768px) {
    .aipanda-header { position: relative; }
    .aipanda-header__container {
        padding: 0 20px;
        height: 64px;
        flex-wrap: nowrap;
        margin-bottom: 0;
    }
    .aipanda-header__divider { display: none; }

    .aipanda-burger { display: flex; margin-left: auto; }

    .aipanda-header__nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--header-bg);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        padding: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.05);
        overflow: visible;
    }
    .aipanda-header__nav.open { display: block; }

    .aipanda-menu { flex-direction: column; align-items: stretch; gap: 4px; }
    .aipanda-menu-link { justify-content: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 16px; }
    .aipanda-menu-link:hover { background-color: rgba(255, 255, 255, 0.05); }
}

@media (max-width: 400px) {
    .aipanda-logo-text { font-size: 16px; }
    .aipanda-logo-img,
    .aipanda-logo-svg { width: 40px; height: 40px; }
    .aipanda-header__container {
        height: 56px;
        padding: 0 12px;
        margin-bottom: 0;
    }
}