/* ============================================
   HEADER — ЛИПКАЯ ШАПКА С СУБМЕНЮ
   ============================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg, #1a1a2e);
    color: var(--header-text, #fff);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    font-family: Arial, sans-serif;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    gap: 20px;
}

/* ===== ЛОГОТИП ===== */
.header-logo {
    flex-shrink: 0;
}
.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--header-text, #fff);
    font-size: 22px;
    font-weight: 700;
}
.header-logo img {
    max-height: 45px;
    width: auto;
    display: block;
}
.header-logo span {
    font-size: 22px;
    font-weight: 700;
    color: var(--header-text, #fff);
}

/* ===== ДЕСКТОПНОЕ МЕНЮ ===== */
.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: center;
}
.header-nav > a {
    color: var(--header-text, #fff);
    text-decoration: none;
    font-size: 15px;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.header-nav > a:hover {
    opacity: 0.7;
}

/* ===== ВЫПАДАЮЩЕЕ МЕНЮ (десктоп) ===== */
.nav-item-has-children {
    position: relative;
}
.nav-item-has-children > a {
    color: var(--header-text, #fff);
    text-decoration: none;
    font-size: 15px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}
.nav-item-has-children > a:hover {
    opacity: 0.7;
}
.nav-arrow {
    font-size: 10px;
    transition: transform 0.3s;
}
.nav-item-has-children:hover .nav-arrow {
    transform: rotate(180deg);
}
.nav-sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--header-bg, #1a1a2e);
    padding: 10px 0;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    list-style: none;
    z-index: 1001;
}
.nav-item-has-children:hover .nav-sub-menu {
    display: block;
}
.nav-sub-menu li a {
    display: block;
    padding: 8px 20px;
    color: var(--header-text, #fff);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}
.nav-sub-menu li a:hover {
    background: rgba(255,255,255,0.1);
}

/* ===== ТЕЛЕФОН (десктоп) ===== */
.header-phone {
    flex-shrink: 0;
}
.header-phone a {
    color: var(--header-text, #fff);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.header-phone a:hover {
    opacity: 0.8;
}

/* ===== БУРГЕР ===== */
.header-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    flex-shrink: 0;
}
.header-burger span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--header-text, #fff);
    border-radius: 3px;
    transition: all 0.3s ease;
}
.header-burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.header-burger.active span:nth-child(2) {
    opacity: 0;
}
.header-burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ===== МОБИЛЬНЫЙ ТЕЛЕФОН (под шапкой) ===== */
.header-mobile-phone {
    display: none;
    text-align: center;
    padding: 8px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
}
.header-mobile-phone a {
    color: var(--header-text, #fff);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ===== МОБИЛЬНОЕ МЕНЮ (выпадающее) ===== */
.header-mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--header-bg, #1a1a2e);
    padding: 10px 20px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    gap: 4px;
}
.header-mobile-menu.open {
    display: flex;
}
.header-mobile-menu > a {
    color: var(--header-text, #fff);
    text-decoration: none;
    font-size: 18px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.header-mobile-menu > a:last-child {
    border-bottom: none;
}

/* ===== МОБИЛЬНОЕ СУБМЕНЮ ===== */
.mobile-menu-item-has-children {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mobile-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}
.mobile-menu-link {
    color: var(--header-text, #fff);
    text-decoration: none;
    font-size: 18px;
}
.mobile-arrow {
    color: var(--header-text, #fff);
    font-size: 14px;
    cursor: pointer;
    padding: 0 10px;
    user-select: none;
    transition: transform 0.3s;
}
.mobile-arrow.open {
    transform: rotate(180deg);
}
.mobile-sub-menu {
    display: none;
    flex-direction: column;
    padding-left: 20px;
    gap: 4px;
    padding-bottom: 8px;
}
.mobile-sub-menu.open {
    display: flex;
}
.mobile-sub-link {
    color: var(--header-text, #fff);
    text-decoration: none;
    font-size: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    opacity: 0.8;
}
.mobile-sub-link:hover {
    opacity: 1;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .header-nav {
        display: none !important;
    }
    .header-phone {
        display: none !important;
    }
    .header-burger {
        display: flex !important;
    }
    .header-mobile-phone {
        display: block !important;
    }
    .header-inner {
        padding: 10px 16px;
    }
    .header-logo img {
        max-height: 38px;
    }
    .header-logo span {
        font-size: 20px;
    }
}

@media (min-width: 769px) {
    .header-mobile-phone {
        display: none !important;
    }
    .header-mobile-menu {
        display: none !important;
    }
}