/* MEGA MENU DESKTOP — от 1024px (lg) */
@media (min-width: 1024px) {
    #navbar {
        position: relative !important;
    }

    .dropdown--mega {
        position: static !important;
    }

    .dropdown-content.mega-menu {
        display: none;
        position: absolute;
        left: 0 !important;
        right: 0 !important;
        top: calc(100% - 12px);
        width: 100% !important;
        background: #ffffff;
        box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.18);
        z-index: 9999 !important;
        border-top: 1px solid #e2e8f0;
        padding: 52px 0 40px;
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity 0.22s ease, transform 0.22s ease;
        pointer-events: none;
    }

    .dropdown-content.mega-menu.mega-open {
        display: block !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        pointer-events: auto;
    }

    /* Невидимый мост до панели (переход с «Услуги») */
    .dropdown-content.mega-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 20px;
        background: transparent;
    }

    .mega-menu-container {
        max-width: 1280px;
        margin: 0 auto;
        padding: 0 48px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: 56px;
        row-gap: 24px;
    }

    .mega-menu-column {
        min-width: 0;
    }

    /* Заголовки колонок — тихий капс, без плашек и полос */
    .mega-menu-column__title {
        display: block;
        font-size: 0.6875rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        line-height: 1.3;
        margin: 0 0 20px;
        padding: 0 12px;
        color: #64748b;
    }

    .mega-menu-column--spotlight .mega-menu-column__title {
        color: #6d28d9;
    }

    .mega-menu-column--audit .mega-menu-column__title {
        color: #1d4ed8;
    }

    .mega-menu-column--seo .mega-menu-column__title {
        color: #047857;
    }

    .mega-menu-column--build .mega-menu-column__title {
        color: #c2410c;
    }

    .mega-menu-column ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mega-menu-column ul li {
        margin-bottom: 2px;
    }

    .mega-menu-column ul li a {
        display: block;
        padding: 7px 12px;
        margin-left: 0;
        color: #334155;
        text-decoration: none;
        font-size: 0.875rem;
        font-weight: 500;
        line-height: 1.35;
        border-radius: 6px;
        transition: color 0.15s ease, background 0.15s ease;
    }

    .mega-menu-column ul li a:hover,
    .mega-menu-column ul li a.active {
        color: #0078d4;
        background: #f4f8fd;
    }

    /* Продвигаемые пункты — только вес текста, без плашек и полос */
    .mega-menu-column ul li a.featured {
        font-weight: 700;
        font-size: 0.8125rem;
        white-space: normal;
    }

    .mega-menu-footer {
        margin-top: 18px;
        padding-top: 14px;
        border-top: 1px solid #f1f5f9;
    }

    .mega-menu-all-link {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.875rem;
        font-weight: 700;
        color: #0078d4;
        text-decoration: none;
        padding: 6px 0;
    }

    .mega-menu-all-link:hover {
        color: #005a9e;
        text-decoration: underline;
    }
}

/* MOBILE ACCORDION — до 1023px */
@media (max-width: 1023px) {
    .mobile-menu {
        display: none;
        overflow-y: auto;
        max-height: 80vh;
        z-index: 99999;
        position: relative;
        background: #fff;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .mobile-menu.active {
        display: block !important;
    }

    .mobile-menu-btn {
        cursor: pointer;
        z-index: 100000;
        position: relative;
        padding: 8px;
    }

    .mobile-menu-btn i {
        pointer-events: none;
    }

    .mobile-accordion-item {
        border-bottom: 1px solid #f1f5f9;
        overflow: hidden;
    }

    .mobile-accordion-header {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 16px;
        font-size: 0.875rem;
        font-weight: 700;
        color: #1e293b;
        background: #fff;
        text-align: left;
    }

    .mobile-accordion-content {
        display: none;
        background: #f8fafc;
        padding: 4px 16px 12px 16px;
    }

    .mobile-accordion-content a {
        display: block;
        padding: 10px 0;
        font-size: 0.875rem;
        color: #475569;
        text-decoration: none;
        border-bottom: 1px solid rgba(241, 245, 249, 0.5);
    }

    .mobile-accordion-content a.active {
        color: #0078d4;
        font-weight: 600;
    }

    .mobile-accordion-content a:last-child {
        border-bottom: none;
    }

    .mobile-accordion-item.active .mobile-accordion-content {
        display: block !important;
    }

    .mobile-accordion-item.active i {
        transform: rotate(180deg);
    }
}
