/* Styles for fixed header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 8px 0;
    box-shadow: none;
    border-bottom: 1px solid rgba(240, 240, 240, 0.8);
}

.header.scrolled {
    padding: 6px 0;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: none;
}

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

@media (max-width: 1400px) {
    .header__container {
        padding: 0 30px;
    }
}

@media (max-width: 1200px) {
    .header__container {
        padding: 0 20px;
    }
}

.header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header__logo img {
    width: 96px;
    height: 34px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .header__logo img {
        height: 35px;
    }
}

@media (max-width: 480px) {
    .header__logo img {
        height: 30px;
    }
}

.header__nav {
    display: flex;
    align-items: center;
}

.header__menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 70px;
    align-items: center;
    position: relative;
    z-index: 1002;
    margin-left: auto;
    transform: translateX(-50px);
}

.header__menu li a,
.header__menu li a span {
    color: #333 !important;
    text-decoration: none;
    font-size: 16px;
    position: relative;
    transition: color 0.3s ease;

    border: none !important;
    background: transparent !important;
    pointer-events: auto;
    z-index: 1003;
    font-family: 'Gilroy', sans-serif !important;
    font-weight: 500 !important;
}

.header__menu li a:hover,
.header__menu li a:hover span {
    color: #FF6B00 !important;
    background: transparent !important;
    border: none !important;
}

/* Style for current page */
.header__menu li a.current-page,
.header__menu li a.current-page span {
    font-weight: 500;
    color: #FF6B00 !important;
    background: transparent !important;
    border: none !important;
}

/* Dropdown menu */
.header__dropdown {
    position: relative;
}

.header__dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color 0.3s ease;
    border: none !important;
    padding: 8px 16px;
    color: #333 !important;
    background: transparent !important;
    text-decoration: none !important;
}

.header__dropdown-toggle:hover,
.header__dropdown-toggle:hover span {
    color: #FF6B00 !important;
    background: transparent !important;
    border: none !important;
}

.header__dropdown:hover .header__dropdown-toggle,
.header__dropdown:hover > .header__dropdown-toggle {
    color: #FF6B00 !important;
}

/* Additional selectors for reliability */
.header__dropdown:hover .header__dropdown-toggle span,
.header__dropdown-menu:hover + .header__dropdown-toggle,
li.header__dropdown:hover .header__dropdown-toggle {
    color: #FF6B00 !important;
}

.header__dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    color: inherit;
    display: inline-block;
    transform-origin: center;
    flex-shrink: 0;
}

.header__dropdown.active .header__dropdown-arrow {
    transform: rotate(180deg) !important;
}

.header__dropdown.active .header__dropdown-toggle {
    color: #FF6B00 !important;
    background: transparent !important;
    border: none !important;
}

.header__dropdown-menu {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    width: 100vw;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(240, 240, 240, 0.8);
    border-bottom: 1px solid rgba(240, 240, 240, 0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    padding: 0;
    margin-top: 0;
    pointer-events: none;
}

/* Адаптивная позиция меню для скроллнутой шапки */
.header.scrolled .header__dropdown-menu {
    top: 62px;
}

.header__dropdown.active .header__dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.header__dropdown-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;
}

.header__dropdown-item {
    flex: 1;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.header__dropdown-item:hover {
    color: #333;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.header__dropdown-card {
    padding: 0;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.header__dropdown-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px 0;
    line-height: 1.2;
    transition: color 0.3s ease;
    font-family: 'Gilroy', sans-serif !important;
}

.header__dropdown-item:hover .header__dropdown-title {
    color: #FF6B00;
}

.header__dropdown-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
    flex-grow: 1;
    font-family: 'Gilroy', sans-serif !important;
    font-weight: 400 !important;
}

/* Контейнер для контактов */
.header__contacts {
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Мобильный индикатор живого общения */
.header__mobile-live-indicator {
    display: none;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-live-indicator__avatar {
    position: relative;
    width: 32px;
    height: 32px;
}

.mobile-live-indicator__avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.header__mobile-live-indicator:hover .mobile-live-indicator__avatar img {
    /* transform: scale(1.05); */
}

.mobile-live-indicator__status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border: 2px solid #fff;
    border-radius: 50%;
    animation: pulse-small 2s infinite;
}

/* Тултип для мобильного индикатора */
.header__mobile-live-indicator::after {
    content: 'I will answer your questions';
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1004;
}

.header__mobile-live-indicator::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1004;
}

/* Класс для показа тултипа через JavaScript */
.header__mobile-live-indicator.show-tooltip::after,
.header__mobile-live-indicator.show-tooltip::before {
    opacity: 1;
    visibility: visible;
}

@keyframes pulse-small {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Номер телефона */
.header__phone {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header__phone:hover {
    color: #FF6B00;
}

/* Десктопная версия - только текст */
.header__phone--desktop {
    display: flex;
    color: #FF6B00;
    font-weight: 600;
}

.header__phone--desktop:hover {
    color: #e55a00;
}

/* Мобильная версия - только иконка */
.header__phone--mobile {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: transparent;
    border: none;
    transition: all 0.3s ease;
}

.header__phone--mobile:hover {
    background-color: transparent;
    color: #FF6B00;
    /* transform: scale(1.1); */
}

.header__phone-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.header__phone-text {
    white-space: nowrap;
}

/* Wrapper для Telegram с тултипом */
.header__telegram-wrapper {
    position: relative;
}

/* Новый десктопный аватар Telegram */
.header__telegram-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.header__telegram-avatar {
    position: relative;
    width: 40px;
    height: 40px;
}

.header__telegram-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.header__telegram-contact:hover .header__telegram-avatar img {
    /* transform: scale(1.05); */
}

.header__telegram-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #4CAF50;
    border: 2px solid #fff;
    border-radius: 50%;
    animation: pulse-desktop 2s infinite;
}

@keyframes pulse-desktop {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Старые стили иконки больше не нужны */
.header__telegram-icon {
    display: none;
}

/* Всплывающая подсказка для Telegram */
.header__telegram-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1003;
    border: 1px solid #e0e0e0;
}

.header__telegram-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
}

.header__telegram-wrapper:hover .header__telegram-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.telegram-tooltip__content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.telegram-tooltip__avatar {
    flex-shrink: 0;
}

.telegram-tooltip__avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.telegram-tooltip__info {
    flex: 1;
}

.telegram-tooltip__name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
    font-family: 'Gilroy', sans-serif !important;
}

.telegram-tooltip__text {
    font-size: 12px;
    color: #666;
    font-family: 'Gilroy', sans-serif !important;
    font-weight: 400 !important;
}

.header__contact-button {
    background-color: #FFFFFF;
    color: #FF6B00;
    font-size: 16px;
    padding: 10px 24px;
    border-radius: 32px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border: 1px solid transparent;
    font-family: 'Gilroy', sans-serif !important;
}

.header__contact-button:hover {
    background-color: #000;
    color: #fff;
    transform: translateY(-2px);
}

/* Мобильная навигация */
.header__burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 20px;
    cursor: pointer;
    z-index: 1002;
}

.header__burger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333;
    transition: all 0.3s ease;
}

/* Анимация бургера в крестик */
.header__burger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.header__burger.active span:nth-child(2) {
    opacity: 0;
}

.header__burger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: #fff;
    padding: 80px 20px 20px;
    z-index: 1001;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu__overlay.active {
    display: block;
}

.mobile-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu__item {
    margin-bottom: 20px;
}

.mobile-menu__link {
    color: #333;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s ease;
    font-family: 'Gilroy', sans-serif !important;
    font-weight: 500 !important;
}

.mobile-menu__link:hover {
    color: #FF6B00;
}

/* Style for current page */
.mobile-menu__link.current-page {
    font-weight: 500;
    color: #FF6B00;
}

/* Мобильное выпадающее меню */
.mobile-menu__dropdown {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 5px;
}

.mobile-menu__dropdown-toggle {
    display: flex;
    align-items: center;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: none;
    gap: 12px;
    font-family: 'Gilroy', sans-serif !important;
    font-weight: 500 !important;
}

.mobile-menu__dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    color: #333;
    flex-shrink: 0;
}

.mobile-menu__dropdown.active .mobile-menu__dropdown-arrow {
    transform: rotate(180deg);
}

.mobile-menu__dropdown-items {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: transparent;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 12px;
}

.mobile-menu__dropdown.active .mobile-menu__dropdown-items {
    max-height: 200px;
}

.mobile-menu__dropdown-items li {
    margin-bottom: 2px;
}

.mobile-menu__dropdown-items li:last-child {
    margin-bottom: 0;
}

.mobile-menu__dropdown-items .mobile-menu__link {
    padding: 4px 40px 4px 24px;
    font-size: 18px;
    border-bottom: none;
    display: block;
}

.mobile-menu__dropdown-items .mobile-menu__link:last-child {
    border-bottom: none;
}

/* Контакты в мобильном меню */
.mobile-menu__contacts {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.mobile-menu__phone {
    display: block;
    color: #FF6B00;
    text-decoration: none;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
    font-family: 'Gilroy', sans-serif !important;
}

.mobile-menu__phone:hover {
    color: #e55a00;
}

/* Улучшенная CTA для Telegram в мобильном меню */
.mobile-menu__telegram-cta {
    display: block;
    padding: 16px 0;
}

.mobile-telegram-cta__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mobile-telegram-cta__avatar {
    position: relative;
    flex-shrink: 0;
}

.mobile-telegram-cta__avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-telegram-cta__status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #4CAF50;
    border: 2px solid #fff;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.mobile-telegram-cta__info {
    flex: 1;
}

.mobile-telegram-cta__name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 2px;
    font-family: 'Gilroy', sans-serif !important;
}

.mobile-telegram-cta__button {
    display: block;
    width: 100%;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    color: #0088cc;
    background-color: #e3f2fd;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-telegram-cta__button:hover {
    background-color: #bbdefb;
    color: #0066aa;
}

.mobile-menu__telegram {
    display: block;
    text-decoration: none;
    color: #333;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    font-family: 'Gilroy', sans-serif !important;
    font-weight: 500 !important;
}

/* Адаптивность для выпадающего меню */
@media (max-width: 1400px) {
    .header__dropdown-container {
        gap: 15px;
    }
    
    .header__dropdown-title {
        font-size: 16px;
    }
    
    .header__dropdown-description {
        font-size: 13px;
    }
}

@media (max-width: 992px) {
    .header__dropdown-container {
        gap: 12px;
        flex-direction: column;
        align-items: center;
    }
    
    .header__dropdown-item {
        max-width: 300px;
        width: 100%;
    }
    
    .header__dropdown-card {
        text-align: center;
    }
    
    .header__dropdown-title {
        font-size: 15px;
    }
    
    .header__dropdown-description {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .header__dropdown-container {
        padding: 20px;
    }
    
    .header__dropdown-title {
        font-size: 14px;
    }
    
    .header__dropdown-description {
        font-size: 12px;
    }
}

@media (max-width: 1200px) {
    .header__menu {
        display: none;
    }
    
    .header__burger {
        display: flex;
        order: 3;
    }
    
    .header__logo {
        order: 1;
    }
    
    .header__contacts {
        order: 2;
        margin-left: auto;
        margin-right: 24px;
    }
    
    .header__telegram-wrapper {
        display: none;
    }
    
    .header__mobile-live-indicator {
        display: block;
    }
    
    /* Переключаем версии телефона */
    .header__phone--desktop {
        display: none;
    }
    
    .header__phone--mobile {
        display: flex;
    }
}

@media (max-width: 992px) {
    .header__contacts {
        gap: 24px;
        margin-right: 24px;
    }
}

@media (max-width: 768px) {
    .header__contacts {
        gap: 24px;
        margin-right: 24px;
    }
}

@media (max-width: 480px) {
    .header__contacts {
        gap: 4px;
    }
}

/* Дополнительные стили для статей */
@media (max-width: 768px) {
    .header__menu {
        gap: 15px;
    }
    
    .header__menu li a {
        padding: 5px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .header__menu {
        gap: 5px;
    }
    
    .header__menu li a {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Запрет прокрутки для тела страницы */
body.no-scroll {
    overflow: hidden;
}

/* Автоматический тултип для десктопного аватара */
.header__telegram-wrapper::after {
    content: 'I will answer your questions';
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1003;
}

.header__telegram-wrapper::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    right: 20px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1003;
}

/* Класс для показа десктопного тултипа */
.header__telegram-wrapper.show-desktop-tooltip::after,
.header__telegram-wrapper.show-desktop-tooltip::before {
    opacity: 1;
    visibility: visible;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Дополнительное правило для hover "Медиа" */
.header__dropdown:hover .header__dropdown-toggle,
.header__dropdown:hover .header__dropdown-toggle span {
    color: #FF6B00 !important;
}