.header,
.navbar,
.navbar-collapse,
.navbar-nav {
    overflow: visible !important;
}

.header-logo {
    max-height: 65px;
}

.header-social-box {
    border-left: 1px solid #e1e1e1;
    padding-left: 15px;
}

.header-social-links {
    gap: 15px;
}

.header-date {
    color: #5e5e5e;
    font-size: 13px;
    white-space: nowrap;
}

.header-lang-btn {
    font-size: 12px;
}

.mega-nav-item {
    position: static;
}

.mega-main-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 170px;
}

.mega-main-title {
    display: inline-block;
    max-width: 135px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu_arrow {
    margin-right: 6px;
    font-size: 10px;
    transition: 0.2s ease;
    flex-shrink: 0;
}

.mega-nav-item:hover .menu_arrow {
    transform: rotate(180deg);
}

.mega-menu-panel {
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%);
    width: min(960px, calc(100vw - 30px));
    z-index: 9999;
    display: none;
}

@media (min-width: 992px) {
    .mega-nav-item:hover .mega-menu-panel {
        display: block;
    }
}

.mega-menu-box {
    height: min(430px, calc(100vh - 130px));
    min-height: 320px;
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: flex;
    border: 1px solid #f1f1f1;
}

.mega-menu-sidebar {
    width: 240px;
    min-width: 240px;
    background: #f8f9fb;
    border-left: 1px solid #eeeeee;
    padding: 10px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.mega-menu-category {
    height: 40px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #333;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    transition: 0.2s ease;
    border-right: 3px solid transparent;
    min-width: 0;
}

.mega-menu-category:hover,
.mega-menu-category.active {
    background: #fff;
    color: #e53935;
    border-right-color: #e53935;
}

.mega-menu-category-right {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex: 1;
}

.mega-menu-category-right i {
    width: 18px;
    min-width: 18px;
    text-align: center;
    font-size: 14px;
    color: #888;
    transition: 0.2s ease;
}

.mega-menu-category:hover .mega-menu-category-right i,
.mega-menu-category.active .mega-menu-category-right i {
    color: #e53935;
}

.mega-menu-category-text {
    display: block;
    min-width: 0;
    max-width: 165px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mega-menu-category-arrow {
    font-size: 10px;
    color: #aaa;
    margin-right: 8px;
    flex-shrink: 0;
}

.mega-menu-content-area {
    flex: 1;
    position: relative;
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 22px;
}

.mega-menu-content-panel {
    display: none;
}

.mega-menu-content-panel.active {
    display: block;
}

.mega-menu-content-area.has-active .mega-menu-empty {
    display: none;
}

.mega-menu-content-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.mega-menu-content-header a {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: #e53935;
    text-decoration: none;
}

.mega-menu-content-header a span {
    display: block;
    max-width: 270px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mega-menu-empty {
    height: 100%;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    background:
        radial-gradient(circle at top left, rgba(229, 57, 53, 0.04), transparent 35%),
        #fff;
}

.mega-menu-empty-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 20px;
}

.mega-menu-empty-inner i {
    font-size: 30px;
    color: #ddd;
}

.mega-menu-empty-inner span {
    font-size: 12.5px;
    color: #aaa;
}

.mega-no-child {
    font-size: 13px;
    color: #999;
    padding: 10px;
}

.mega-tree-node {
    width: 100%;
    min-width: 0;
}

.mega-tree-title,
.mega-tree-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: 0.2s ease;
    min-width: 0;
}

.mega-tree-title {
    color: #222;
    font-size: 13.5px;
    font-weight: 800;
    margin-bottom: 8px;
}

.mega-tree-title::before {
    content: "";
    width: 3px;
    min-width: 3px;
    height: 14px;
    border-radius: 10px;
    background: #e53935;
    display: inline-block;
}

.mega-tree-link {
    color: #666;
    font-size: 12.5px;
    font-weight: 500;
    margin-bottom: 5px;
}

.mega-tree-title span,
.mega-tree-link span {
    display: block;
    max-width: 190px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mega-tree-title i,
.mega-tree-link i {
    font-size: 10px;
    color: #aaa;
    flex-shrink: 0;
}

.mega-tree-title:hover,
.mega-tree-link:hover {
    color: #e53935;
    padding-right: 4px;
}

.mega-tree-list {
    list-style: none;
    margin: 6px 12px 8px 0;
    padding: 0 10px 0 0;
    border-right: 1px solid #eeeeee;
}

.mega-tree-list li {
    margin-bottom: 4px;
}

.mega-tree-level-2 .mega-tree-link {
    font-size: 12.2px;
    color: #777;
}

.mega-tree-level-3 .mega-tree-link {
    font-size: 12px;
    color: #888;
}

.mega-tree-level-4 .mega-tree-link,
.mega-tree-level-5 .mega-tree-link,
.mega-tree-level-6 .mega-tree-link,
.mega-tree-level-7 .mega-tree-link,
.mega-tree-level-8 .mega-tree-link,
.mega-tree-level-9 .mega-tree-link,
.mega-tree-level-10 .mega-tree-link {
    font-size: 11.8px;
    color: #999;
}

@media (max-width: 991px) {
    .navbar-nav {
        width: 100%;
        align-items: stretch !important;
        gap: 0 !important;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .mega-nav-item {
        position: relative !important;
    }

    .mega-main-link {
        max-width: 100%;
        justify-content: space-between;
    }

    .mega-main-title {
        max-width: calc(100vw - 110px);
    }

    .mega-menu-panel {
        position: static;
        display: none;
        width: 100%;
        transform: none;
        margin-top: 8px;
    }

    .mega-nav-item.open .mega-menu-panel {
        display: block;
    }

    .mega-nav-item.open .menu_arrow {
        transform: rotate(180deg);
    }

    .mega-menu-box {
        display: block;
        height: auto;
        min-height: auto;
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 14px;
        box-shadow: none;
    }

    .mega-menu-sidebar {
        width: 100%;
        min-width: 100%;
        border-left: none;
        padding: 8px 0;
        overflow: visible;
    }

    .mega-menu-content-area {
        padding: 14px;
        border-top: 1px solid #eeeeee;
    }

    .mega-tree-title span,
    .mega-tree-link span {
        max-width: calc(100vw - 120px);
    }
}
