/* Mega Menu Styles */
.mega-menu-wrapper { position: relative; display: inline-block; }

/* Невидимый мост между кнопкой и меню - убирает мигание */
.mega-menu-wrapper::after { content: ''; position: fixed; top: 55px; left: 0; right: 0; height: 25px; z-index: 9998; opacity: 0; pointer-events: none; }

.mega-menu-wrapper:hover::after { pointer-events: auto; }

.mega-menu-dropdown { position: fixed; top: 80px; left: 0; right: 0; width: 100vw; background: #ffffff; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); border-top: 1px solid #e8e8e8; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 9999; max-height: 0; overflow: hidden; }

.mega-menu-wrapper:hover .mega-menu-dropdown,
.mega-menu-dropdown:hover { opacity: 1; visibility: visible; transform: translateY(0); max-height: 600px; }

.mega-menu-content { padding: 40px 20px; animation: fadeIn 0.3s ease-in-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.mega-menu-column { margin-bottom: 20px; }

.mega-menu-item { display: flex; align-items: flex-start; padding: 20px; border-radius: 12px; text-decoration: none; color: #333; transition: all 0.3s ease; background: #f8f9fa; border: 2px solid transparent; height: 100%; position: relative; overflow: hidden; }

.mega-menu-item::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent); transition: left 0.5s ease; }

.mega-menu-item:hover { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #ffffff; transform: translateY(-5px); box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3); border-color: #667eea; }

.mega-menu-item:hover::before { left: 100%; }

.mega-menu-icon { flex-shrink: 0; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 12px; margin-right: 20px; transition: all 0.3s ease; }

.mega-menu-item:hover .mega-menu-icon { background: #ffffff; transform: scale(1.1) rotate(5deg); }

.mega-menu-icon i { font-size: 28px; color: #ffffff; transition: color 0.3s ease; }

.mega-menu-icon img { width: 32px; height: 32px; object-fit: contain; }

.mega-menu-item:hover .mega-menu-icon i { color: #667eea; }

.mega-menu-text { flex: 1; }

.mega-menu-title { display: block; font-size: 16px; font-weight: 600; margin: 0 0 8px 0; color: #333; transition: color 0.3s ease; }

.mega-menu-item:hover .mega-menu-title { color: #ffffff; }

.mega-menu-text p { font-size: 14px; margin: 0; color: #666; line-height: 1.5; transition: color 0.3s ease; }

.mega-menu-item:hover .mega-menu-text p { color: rgba(255, 255, 255, 0.9); }

.new-label-mega { position: absolute; top: 10px; left: 10px; background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: #ffffff; padding: 4px 12px; border-radius: 20px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; animation: pulse 2s infinite; }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Адаптивность для планшетов */
@media (max-width: 991px) {
    .mega-menu-content { padding: 30px 15px; }
    .mega-menu-icon { width: 50px; height: 50px; margin-right: 15px; }
    .mega-menu-icon i { font-size: 24px; }
    .mega-menu-text h3 { font-size: 16px; }
    .mega-menu-text p { font-size: 13px; }
    .mega-menu-item { padding: 15px; }
}

/* Адаптивность для мобильных */
@media (max-width: 767px) {
    .mega-menu-dropdown { display: none !important; }
    .mega-menu-wrapper { display: inline-block; }
}

/* Улучшенная анимация при наведении на весь ряд */
.mega-menu-content .row:hover .mega-menu-item { opacity: 0.7; }

.mega-menu-content .row .mega-menu-item:hover { opacity: 1; }

/* Дополнительные эффекты для перехода */
.mega-menu-column { animation-fill-mode: both; }

.mega-menu-wrapper:hover .mega-menu-column:nth-child(1) .mega-menu-item { animation-delay: 0.05s; }

.mega-menu-wrapper:hover .mega-menu-column:nth-child(2) .mega-menu-item { animation-delay: 0.1s; }

.mega-menu-wrapper:hover .mega-menu-column:nth-child(3) .mega-menu-item { animation-delay: 0.15s; }

.mega-menu-wrapper:hover .mega-menu-column:nth-child(4) .mega-menu-item { animation-delay: 0.2s; }

.mega-menu-wrapper:hover .mega-menu-column:nth-child(5) .mega-menu-item { animation-delay: 0.25s; }

.mega-menu-wrapper:hover .mega-menu-column:nth-child(6) .mega-menu-item { animation-delay: 0.3s; }

.mega-menu-wrapper:hover .mega-menu-column:nth-child(7) .mega-menu-item { animation-delay: 0.35s; }

.mega-menu-wrapper:hover .mega-menu-column:nth-child(8) .mega-menu-item { animation-delay: 0.4s; }

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mega-menu-wrapper:hover .mega-menu-item { animation: slideInUp 0.3s ease-out; }

/* Обеспечение правильного z-index для навигации */
.sb-topnav { position: relative; z-index: 10000; }

/* Services Navigation Bar */
.services-nav {
    width: 100%;
    padding: 12px 0 4px;
}

.services-nav-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
}

.services-nav-scroll::-webkit-scrollbar { display: none; }

.services-nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    color: #444;
    padding: 8px 14px;
    border-radius: 10px;
    text-align: left;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e4e7ec;
}

.services-nav-item:hover {
    background: #eef0f5;
    color: #222;
    text-decoration: none;
    border-color: #c8cdd6;
}

.services-nav-item.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.services-nav-item.active:hover { background: #5a71d4; color: #fff; }

.services-nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 7px;
    flex-shrink: 0;
}

.services-nav-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.services-nav-icon i {
    font-size: 18px;
    color: inherit;
}

.services-nav-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
}

/* Scroll fade for services-nav (dark bg variant) */
.scroll-fade-dark::before { left: -1px; background: linear-gradient(to right, #343a40 0%, #343a40 20%, rgba(52, 58, 64, 0.8) 50%, rgba(52, 58, 64, 0.4) 80%, transparent 100%); }

.scroll-fade-dark::after { right: -1px; background: linear-gradient(to left, #343a40 0%, #343a40 20%, rgba(52, 58, 64, 0.8) 50%, rgba(52, 58, 64, 0.4) 80%, transparent 100%); }

@media (max-width: 767px) {
    .scroll-fade-dark::before, .scroll-fade-dark::after { width: 30px; }
    .services-nav { padding: 8px 0 2px; }
    .services-nav-scroll { gap: 6px; padding-bottom: 6px; }
    .services-nav-item { padding: 6px 10px; border-radius: 8px; }
    .services-nav-icon { width: 20px; height: 20px; margin-right: 6px; }
    .services-nav-icon img { width: 18px; height: 18px; }
    .services-nav-icon i { font-size: 15px; }
    .services-nav-label { font-size: 12px; }
}

