/* ============================================================
   MEGA MENU STYLES
   ============================================================ */

.mega-menu {
    /* Flexbox ngang — mỗi .mega-menu-col là 1 cột độc lập */
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    height: auto !important;
    gap: 16px;
    padding: 0;
    list-style: none;
    margin: 0;
    box-sizing: border-box;
}

/* Mỗi col chứa 1 nhóm items (2 items), flex-direction: column để expand tự nhiên */
.mega-menu-col {
    flex: 0 0 calc(50% - 8px) !important;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    height: auto;
    box-sizing: border-box;
}

/* --- Cấp 1 Item --- */
.mega-menu-item {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.mega-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.mega-menu-title {
    font-weight: 600;
    font-size: 15px;
    color: #00387b !important;
    text-decoration: none;
    flex: 1;
    transition: color 0.2s;
    padding: 5px !important;
    padding-left: 15px !important;
    border-left: 4px solid #be0c11;
}

.mega-menu-title:hover {
    color: #00387b;
}

/* --- Nút mũi tên --- */
.mega-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: transform 0.25s ease, color 0.2s;
    border-radius: 4px;
    flex-shrink: 0;
}

.mega-menu-toggle:hover {
    color: #00387b;
    background: #f0f0f0;
}

/* Xoay mũi tên khi active */
.mega-menu-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* --- Cấp 2 (mặc định ẩn) --- */
.mega-menu-children {
    display: none;
    padding-left: 12px;
    margin-top: 8px;
}

.mega-menu-children.active {
    display: block;
    animation: megaMenuFadeIn 0.2s ease-out;
}

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

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

.mega-menu-children li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mega-menu-children li:last-child {
    border-bottom: none;
}

.mega-menu-children a {
    font-size: 14px;
    color: #333 !important;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
    display: block;
    padding: 5px !important;
}

.mega-menu-children a:hover {
    color: #00387b;
    padding-left: 4px;
}

/* ============================================================
   RESPONSIVE — Mobile (<= 768px): 1 cột
   ============================================================ */
@media (max-width: 768px) {
    .mega-menu {
        flex-direction: column !important;
        align-items: stretch !important;
        align-content: flex-start !important;
    }

    .mega-menu-col {
        flex: 0 0 100% !important;
    }

    .mega-menu-title {
        font-size: 14px;
    }

    .mega-menu-children a {
        font-size: 13px;
    }

    .mega-menu-item {
        padding-bottom: 8px;
    }
}
